views:

62

answers:

1

Hi folks,

Not sure of the absolute utility of this but seems as though it should be possible and useful. Can you extend ContentProvider to provide URIs representing new queries (i.e., joins across multiple tables not specified by existing URIs) for an existing system database? The alternative seems to be that I need to write a series of cursor queries then join them -- seems like a lot of unnecessary code duplication.

I have been trying this for the contacts database as an exercise, but no love so far. The crux seems to be that I cannot open a database in another package during the setup phase. Am I just completely out in left field here? It's possible as I am new to both Java and Android.

Comments and/or pointers to relevant resources are appreciated.

Thanks,

Steve

A: 

Can you extend ContentProvider to provide URIs representing new queries (i.e., joins across multiple tables not specified by existing URIs) for an existing system database?

Not really, only because you don't have direct access to existing system databases, in terms of SQLite. Now, creating a ContentProvider that performs your joins for you, as a reusability measure, is certainly doable, though I would get worried about the performance overhead of multiple cross-process hops.

CommonsWare
Hi Mark -- sorry for my egregious lapse in marking as answered :)
jstevenco

related questions