Reputation: 34257
My first android app stores all data in an SQLite database and acts as a backend/admin panel. What I require is to have this data accessible(readable) by my 2nd android app.
Is it possible via Data Binding or Content Providers? If yes then how, please provides example code.
Looking forward to credible guidelines.
Upvotes: 1
Views: 305
Reputation: 14226
A ContentProvider
is what you need.
It let's you define a SQL like interface to your data.
You can query, update, insert, delete data.
You can define, which permission scope is allowed to access the data and so on.
In most cases it's just a wrapper around your SQLiteDatabase
.
A good example for a ContentProvider
is the sms or contacts database, accessible via content://sms/...
or similar UIRs.
https://developer.android.com/guide/topics/providers/content-providers.html
Upvotes: 1