A
A
Alexander Sinitsyn2016-03-27 08:36:50
Android
Alexander Sinitsyn, 2016-03-27 08:36:50

Is it necessary to use a ContentProvider to use SQLite?

The SQLite database is only available to the application that creates it. If you want to share data with other applications, you can use the ContentProvider.

And what to use if access to other applications is not required? Is there anything outdated?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Gamega, 2016-03-27
@gadfi

ContentProvider is not required to work with the database, but it is very stable and convenient (yes, convenient, despite the disgusting interface)
example of work:
data changes in some stream, for example, something is loaded from the server,
this information must be displayed in an up-to-date form
using the ContentProvider binding + CursorLoader saves you a headache, you don't think what screen you currently have is visible, what happens in another thread, you just display the data, if necessary, they update themselves
from the minuses of the terrible api - a bunch of zeros in the parameters offend my sense of beauty
CursorAdapter does not support RecyclerView (solution googled in five minutes)
SQLiteOpenHelper, various orm ... and the ContentProvider itself is not marked as @Deprecated

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question