Saving Data on Android


Key points • SharedPreferences



Download 19,28 Mb.
Pdf ko'rish
bet52/292
Sana24.01.2022
Hajmi19,28 Mb.
#407089
1   ...   48   49   50   51   52   53   54   55   ...   292
Bog'liq
Bailey J., Dominguez A., Djermanovic D. - Saving Data on Android (1st Edition) - 2019

Key points

SharedPreferences
 are a great way to store 
small bits of data
 for an app.
• User—specific app configuration data is often stored in 
SharedPreferences
.

Preferences
 are also stored in an app's default 
SharedPreferences
, but they are 
not to be confused with each other.

SharedPreferences
 are not a good choice to store structured data, like various 
entities, use a database for that.

SharedPreferences
 are organized in 
key—value pairs
 that are ultimately written 
out to a file in .xml format.
• Each app has its own 
SharedPreferences
. When the app is uninstalled or the data 
is deleted, these stored values are wiped away.
• You can create custom-named 
SharedPreferences
 files and store user's choices 
in them.
Saving Data on Android
Chapter 2: Shared Preferences
raywenderlich.com
47


• To edit 
SharedPreferences
, you first have to fetch its 
Editor
, by calling 
edit()
.
• When writing 
SharedPreferences
, use 
apply()
 instead of 
commit()
 to perform 
an asynchronous, thread—safe write.

Download 19,28 Mb.

Do'stlaringiz bilan baham:
1   ...   48   49   50   51   52   53   54   55   ...   292




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish