This is actually two questions:
-
If i expose my SQLite as a
ContentProviderin my application it will work in an asynchronous fashion ? -
Imagine i have the following tables in my database:
TableChats
TableChatMessages
and i also have a class
Message
To work with ListViews and have those list views use data from the ContentProvider must that data returned be a Cursor ? or is it possible to query for all messages in a chat and return an array of Message.
Sorry i know this may be a dumb question but i’m new to android development and the concept of ContentProvider and ListViews and how to connect them isn’t quite yet clear to me.
To my knowledge
content providermanages access to a central repository of data which shared between multiple applications. Normally all methods access the data work on theUI thread. If you want asynchronous, they suggest to useCursorLoader.Cursorand put to yourMessageobject.Sample:
Or directly pass your cursor using
CursorAdapter