Saving Data on Android



Download 19,28 Mb.
Pdf ko'rish
bet113/292
Sana24.01.2022
Hajmi19,28 Mb.
#407089
1   ...   109   110   111   112   113   114   115   116   ...   292
Bog'liq
Bailey J., Dominguez A., Djermanovic D. - Saving Data on Android (1st Edition) - 2019

INSERT INTO
 query using the object that you 
received as a parameter to create a new record.
3. The 
@Query
 annotation executes the query passed as a parameter. In this case, 
you are performing a delete operation by executing a 
DELETE FROM
 query.
4. This is another 
@Query
 annotated method that retrieves all the questions from 
your database.
Don't worry if something does not make sense right now. You will be learning much 
more about DAOs in the 
The DAO Pattern
 chapter.
Repository
This class acts as a bridge between your data sources and your app. The repository 
class handles the interaction with your Room database and other backend endpoints 
such as web services and Open APIs.
Saving Data on Android
Chapter 5: Room Architecture
raywenderlich.com
98


ViewModel
Just like the 
Repository
 acts as a bridge between your data sources and your app, 
the 
ViewModels
 act as a bridge between your repository and your user interface. The 
ViewModel
 communicates the data coming from your 
Repository
 to your Views and 
has the advantage of surviving configuration changes since it's lifecycle-aware.
LiveData
LiveData
 is a data holder class that implements the 
Observer
 pattern. This means it 
can hold information and be observed for changes. Your views such as 
Fragments
 or 
Activities
 observe 
LiveData
 objects returned from your 
ViewModels
 and update 
the relevant widgets as needed.
The interaction between the above components can be illustrated by the following 
diagram:
You will be learning much more about the above components in the upcoming 
chapters, , this is all you need to know.
Saving Data on Android
Chapter 5: Room Architecture
raywenderlich.com
99



Download 19,28 Mb.

Do'stlaringiz bilan baham:
1   ...   109   110   111   112   113   114   115   116   ...   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