ayeshajavednoori
3,266 views
73 slides
Jun 02, 2019
Slide 1 of 73
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
About This Presentation
DATA PERSISTENCE IN ANDROID OPERATING SYSTEM
Size: 3.42 MB
Language: en
Added: Jun 02, 2019
Slides: 73 pages
Slide Content
Data
persistence in
Android
CS-6
TH
E
AYESHA JAVED (30)
Hira Saeed(46)
Hamna Nasir(55)
Tehseen Iqbal(06)
Is Android
supports only
SQLITE?
????
???N
O
NO
What is Data persistence?
•Persistence is "the continuance of an effect after its
cause is removed". In the context of storing data in a
computer system, this means that the data survives after
the process with which it was created has ended. In
other words, for a data store to be
considered persistent, it must write to non-volatile
storage
WHY Persisting data ?
•Persisting data is an important topic in application
development, as users typically expect to reuse data in the
future. For Android, there are primarily Four basic ways of
persisting data:
•A lightweight mechanism known as shared preferences to save
small chunks of data
•Traditional file systems (Internal)
•External systems (Flash,drive)..
•A relational database management system through the
support of SQLite databases
Android Storage Options:-
Shared
Preferences
s
Shared preferences
internal structure
•Shared preferences internally has an in-memory storage on
top of disk storage. Every operation goes through in-memory
storage first and then to the disk.
•In-memory storage is basically a HashMap which allows O(1)
runtime complexity for all operations.
V
C
S
-
C
6
T
H
S
-
T
C
E
-
T
A
T
Y
S
J
V
-
E
D
V
-
A
-
V
-
(
C
-
Y CHECK THE
CODE OF
SHARED
PREFERENCES
•shared preferences are the location where you can store the
secret information for your app, like setting cookies in the
browser, this can be used for login credentials and other.
•where as content provider stores and retrieves the data and
make it available to other applications also. like suppose you
want to access the contacts available in the android phone,
they can be accessed by content providersC
S
-
C
6
T
H
S
-
T
C