Saving Data on Android


changed . • You should avoid  dropping the database



Download 19,28 Mb.
Pdf ko'rish
bet75/292
Sana24.01.2022
Hajmi19,28 Mb.
#407089
1   ...   71   72   73   74   75   76   77   78   ...   292
Bog'liq
Bailey J., Dominguez A., Djermanovic D. - Saving Data on Android (1st Edition) - 2019

changed
.
• You should avoid 
dropping the database
 if it changes, and try to 
migrate
 the 
structure between versions.
• Every database consists of the four standard operations - 
Create

Read

Update

and 
Delete
, or 
CRUD
 for short.
• To help you avoid so much 
SQL
 code, and to simplify the operations, Android 
utilizes the 
SQLiteOpenHelper
.
Saving Data on Android
Chapter 3: SQLite Database
raywenderlich.com
70


• To store data for operations, the SQLiteOpenHelper uses 
ContentValues
.

ContentValues
 are just a key-value pair structure, just like a Map, which is used to 
insert or update data in the database.
• You can inspect the database by copying it from the 
Device File Explorer
, and 
opening it with a tool, like the 
SQLite Browser
 or 
DB Browser
.
• It is a good practice to write some 
Unit tests
 for your database, to be sure 
everything works as expected, 
without running the application
.
Where to go from here?
If you would like to know more about SQLite and the syntax that makes up SQLite 
queries, a more in-depth guide for SQLite can be found in SQLite's Language Guide, 
which you can access here: 
https://sqlite.org/lang.html
.
This "Unit Testing with Robolectric" article is also an interesting guide about how 
using Robolectric with Android, which you can read here: 
https://github.com/
codepath/android_guides/wiki/Unit-Testing-with-Robolectric
.
Saving Data on Android
Chapter 3: SQLite Database
raywenderlich.com
71



Download 19,28 Mb.

Do'stlaringiz bilan baham:
1   ...   71   72   73   74   75   76   77   78   ...   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