Is it Possible to access the sqlite3 db of one application from other in Android?
I am using android build target vendor version 2.2.
I want to access/read sqlite3 database file of an application A fr开发者_运维知识库om an application B. Is it possible to do so? because i don't want to import that DB file of apps A in Apps B.
Short answer is no, not directly, although it is possible to expose the data from application A via a ContentProvider
and consume it from application B in a similar fashion.
See here for more on ContentProvider
s.
Actually, assuming that apps A and B are both yours, it might well be possible using the sharedUserId (and possibly sharedUserLabel) attributes in your AndroidManifest.xml - if both apps are running under the same UID, you should be able to read app A's files from app B. I've never done it myself, but here and here look like places to learn the ins and outs of that method.
精彩评论