Saving Data on Android



Download 19,28 Mb.
Pdf ko'rish
bet146/292
Sana24.01.2022
Hajmi19,28 Mb.
#407089
1   ...   142   143   144   145   146   147   148   149   ...   292
Bog'liq
Bailey J., Dominguez A., Djermanovic D. - Saving Data on Android (1st Edition) - 2019

separation of concerns
 to create a more structured application and improve its 
testability.
In Room, the DAOs are defined as 
interfaces
 or 
abstract classes
. The only difference 
between both implementations is that the abstract class can 
optionally
 accept a 
RoomDatabase
 instance, as a constructor parameter. They are also convenient for 
defining large database transactions, using the 
@Transaction
 annotation on a 
method, and calling multiple different methods within.
If you are wondering why DAOs are defined as abstract classes or interfaces, it is 
because Room takes care of creating each DAO implementation at compile time, by 
generating the business logic code for your definitions.
Note
: Remember that Room does not support database access on the main 
thread by default since performing long running operations such as database 
transactions might cause your app to freeze or crash. If you still want to take 
this risk, you will need to explicitly call 
allowMainThreadQueries()
 on your 
database builder.
But, alright, that's enough theory. Think about all the operations that you will need 
to perform on your database to make the DroidQuiz app work:
• You will need to 

Download 19,28 Mb.

Do'stlaringiz bilan baham:
1   ...   142   143   144   145   146   147   148   149   ...   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