Saving Data on Android



Download 19,28 Mb.
Pdf ko'rish
bet103/292
Sana24.01.2022
Hajmi19,28 Mb.
#407089
1   ...   99   100   101   102   103   104   105   106   ...   292
Bog'liq
Bailey J., Dominguez A., Djermanovic D. - Saving Data on Android (1st Edition) - 2019

Model/ToDoDbSchema.kt

Controller/provider/
ToDoContentProvider.kt
 and 
Controller/ToDoDatabaseHandler.kt
 by right 
clicking them, selecting 
Refactor
 > 
Safe Delete...
. Uncheck any boxes that would 
search for usages and hit OK. If the 
Usages Detected
 dialog pops up simply press 
Delete Anyway
. Allow the editor to sync the gradle dependencies if prompted to.
9. Once those files are removed, run the app. Any items you've added in the
Saving Data on Android
Chapter 4: ContentProvider
raywenderlich.com
88


previous app will show in the new app. But how is this possible? You just deleted 
the database handler class as well as the schema and the content provider. If you 
create, update or delete any to-do items and then run the previous app that 
contains the content provider, those changes will reflect in that app as well. The 
two apps are sharing data through the same content provider.
10. Congratulate yourself! You just created two apps that are sharing the same data, 
think of the possibilities! :]
Key Points
• Content providers sit just above the data source of the app, providing an 
additional level of abstraction from the data repository.
• A content provider allows for the sharing of data between apps
• A content provider can be a useful way of making a single data provider if the data 
is housed in multiple repositories for the app.
• It is not necessary to use a content provider if the app is not intended to share 
data with other apps.
• The content resolver is utilized to run queries on the content provider.
• Using a content provider can allow granular permissions to be set on the data.
• Use best practices such as selection clauses and selection arguments to prevent 
SQL Injection when utilizing a content provider, or any raw query data 
mechanism.
• Data in a content provider can be accessed via exposed URIs that are matched by 
the content provider.

Download 19,28 Mb.

Do'stlaringiz bilan baham:
1   ...   99   100   101   102   103   104   105   106   ...   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