Saving Data on Android


ViewModels   and  Views



Download 19,28 Mb.
Pdf ko'rish
bet154/292
Sana24.01.2022
Hajmi19,28 Mb.
#407089
1   ...   150   151   152   153   154   155   156   157   ...   292
Bog'liq
Bailey J., Dominguez A., Djermanovic D. - Saving Data on Android (1st Edition) - 2019

ViewModels
 
and 
Views
.
If you need even more proof of the awesome work you did in this chapter, you can 
add some 
Log.d()
 statements to the tests, to print out the data being read from the 
in-memory database. But the tests should be proof enough!
Saving Data on Android
Chapter 8: The DAO Pattern
raywenderlich.com
145


Key points

Database Access Objects
 are commonly referred to as 
DAOs
.
• DAOs are objects that provide access to your app's data by abstracting most of the 
complexity behind 
querying and updating
 your database.
• In Room, DAOs can be defined as 
interfaces
 or 
abstract classes
.
• The 
@Insert
 annotation is a marker, which allows you to automatically create an 
INSERT INTO
 query.

@Insert
 can take an 
OnConflictStrategy
 parameter, that allows you to specify 
what happens in case there is a conflict when creating a new database entry.

@Query
 allows you to perform any kind of 
queries
 in your database. You can also 
use 

Download 19,28 Mb.

Do'stlaringiz bilan baham:
1   ...   150   151   152   153   154   155   156   157   ...   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