I have a similar question as here: Is it possible to use ContentProvider and direct data access to Database in Android? but in my case I want the widget application to be a separate application.
So I have a first Android application that is using a sqlite database using standard SQLiteOpenHelper. this helper is a singleton that is created in my Application onCreate. Works good.
Now I want to make a second application -so a widget application- that needs to access the database as well. So I would like to use a ContentProvider for that.
1) is it safe to do such way or do I have to refactor the main application to use only ContentProvider (clearly would be a showstopper for me!!)
2) if it is ok, how should I design the contentProvider? I guess I will have to reuse my singleton SQLiteOpenHelper and eventually create it in contentProvider.onCreate?
I am also trying to use a
ContentProviderand a singleton db object. This appears to be a valid approach.Quoting from: http://groups.google.com/group/android-developers/browse_thread/thread/20d8cbf7bf88f6d9