Saving Data on Android



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

DroidQuiz

This app will allow your users to test their Android knowledge with a set of questions 
stored in a Room database:
DroidQuiz
 will help you learn about many important concepts behind Room:
• How to add the appropriate dependencies to your 
build.gradle
 file for Room and 
most of the architecture components such as 
LiveData
.
• How to create a local SQLite database using Room.
• How to use Database Access Objects or DAOs to interact with your Database.
• How to use Google's Android architecture components such as 
LiveData
 and 
ViewModel
 to interact with your Room database.
Saving Data on Android
Chapter 5: Room Architecture
raywenderlich.com
101


• How to create indices and relationships between your tables.
• How to test your database, migrations, and 
ViewModels
.
• And much more!!!
As you can see, there is a lot to learn, but this section will guide you through every, 
single step needed to build a final version of the app.
Key points
• Room is an ORM developed by Google as a part of Jetpack's architecture 
components to simplify the interaction with your SQLite database and to reduce 
the amount of boilerplate code.
• Entities in Room represent tables in your database.
• DAO stands for Data Access Object.
• The 
Repository
 class handles the interaction with your Room database and other 
backend endpoints.
• 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
 is a data holder class that can hold information and be observed for 
changes.
• ORM stands for Object Relational Mapper.
• Shared preferences are very useful when you need to store and share simple data 
such as user preferences as key-value pairs.
• The main disadvantage of using shared preferences is that you can't store large 
amounts of data since it's not efficient and there's no way to use queries to search 
for information.
Saving Data on Android
Chapter 5: Room Architecture
raywenderlich.com
102


• SQLite is a fast and lightweight local database natively supported by Android that 
allows you to store large amounts of data in a structured way.
• SQLite is available for most platforms and can be used with many popular 
programming languages.
• Because SQLite is  lightweight, it's suitable for devices with restricted memory 
such as smartphones and smart TVs.
• ORMs provide an additional layer of abstraction that allows you to interact with 
your relational database with an Object-Oriented Language syntax.
Saving Data on Android
Chapter 5: Room Architecture
raywenderlich.com
103



Download 19,28 Mb.

Do'stlaringiz bilan baham:
1   ...   113   114   115   116   117   118   119   120   ...   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