Reputation: 4736
my android application is handling a large database of bus passage time and we would like to allow others application to be able to display certains bus passage time. We would like to use a content provider to do that. Most example seems to be about using an SQL database, but... we use some custom text file. I was wondering what would be the best way to do that. I was thinking I could use a Content Provider and implement the Cursor interface on a custom object that I would manually fill with my text data. Would this be possible ? Anyone have a better idea (excluding changing to SQL lite of course) ?
Thanks in advance.
Upvotes: 2
Views: 2151
Reputation: 1007349
Would this be possible ?
Sure. ConetntProvider
is, in effect, a facade, not dictating all that much about the internal implementation.
The key will be documentation. If you are not using SQLite as a data store, you most likely will not be supporting full WHERE
clauses for query()
and such. Hence, you need to make sure that whatever you do support for WHERE
clauses, available columns, and the like, you document it well, so developers integrating with your content provider know how to do it. Otherwise, they may make faulty assumptions.
Upvotes: 3