Saving Data on Android



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

annotation-driven
 system of creating entities and queries
make this process 
tremendously easier
.
Start by opening the starter project for this chapter in Android Studio 3.2 or greater 
by going to 
File 

 New 

 Import Project
, and selecting the 
build.gradle
 file in the 
root of the project.
Once the starter project finishes loading and building, run the app on a device or an 
emulator.
Right now, the app is just an empty canvas, but that is about to change!
Saving Data on Android
Chapter 6: Entity Definitions
raywenderlich.com
105


Tables and en//es
Most databases consist of 
tables
 and 
entities
. If you were to draw a parallel with 
object-oriented programming, you could think of entities as a 
class definition

which defines what the objects in the table should look like and how their respective 
properties behave. Once you create those objects — instances of classes, or entities 
in your case — you can store somewhere 
in memory
, which is the table. The table as 
such is a 
container
 for all the created objects of some entity type.
This is a very brief, high-level description of how databases work, which is why it's 
also beneficial to see real-life examples.
Tables
If you reached this section of the book you're probably already familiar with 
relational databases, tables and SQLite. However, it is important to review other key 
concepts before you proceed to create your entities using Room.
Note
: In this chapter, I am only going to cover the basics of database tables; if 
you want to learn more, check out the SQLite chapters of the previous section 
of the book.
Simply put, tables are structures similar to spreadsheets or two-dimensional arrays 
that let you store records as rows with one or more fields defined as columns — or, as 
mentioned above, a container for entity data.
For example, this is how a table that stores information about movies could look:
Columns
 represent a field or property of your data like the Title, Description, 
ReleaseDate or Rating. Columns usually have specific data types such as 

Download 19,28 Mb.

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