[android-developers] Re: Querys involving more than one table of Contatcs Content Provider

2008-12-15 Thread pjv
I've written my own FilteredCursor that filters rows away from one cursor, by joining it with another (uses CursorJoiner internally). It suits my needs and is not quite general. The sort ASC presumption is a big downside. It's in the source code for my Collectionista project (revision 48,

[android-developers] Re: Querys involving more than one table of Contatcs Content Provider

2008-12-15 Thread jarkman
On Dec 14, 4:23 pm, pjv ezelsping...@gmail.com wrote: Would you please share your custom solutions (in code) for reuse? Sure - take a look at jarkman.co.uk/code/ JoiningAndFilteringCursors.zip There are two CursorWrapper derived classes in there, FilteringCursor and JoiningCursor.

[android-developers] Re: Querys involving more than one table of Contatcs Content Provider

2008-12-14 Thread pjv
Richard, Mark, Would you please share your custom solutions (in code) for reuse? CursorJoiner doesn't do very much and doesn't seem to be able to give you a new joint Cursor back eventually. I think a lot of people could benefit from some code reuse here. Thanks, pjv On 6 dec, 09:53, jarkman

[android-developers] Re: Querys involving more than one table of Contatcs Content Provider

2008-12-14 Thread Mark Murphy
pjv wrote: Would you please share your custom solutions (in code) for reuse? Alas, my implementation was made under contract for another firm, so I cannot release it at this time. I'll see about rewriting it at some point, perhaps as part of a chapter in my upcoming Advanced Android book. I

[android-developers] Re: Querys involving more than one table of Contatcs Content Provider

2008-12-06 Thread jarkman
Mark - thanks for the suggestion. I ended up making a couple of general-purpose CursorWrapper subclasses, one for joining two providers one for filtering a provider (with a callback to define the desired rows). They certainly seem to work, and they make the calling code very tidy. I do still

[android-developers] Re: Querys involving more than one table of Contatcs Content Provider

2008-11-26 Thread jarkman
Dianne - thanks for the confirmation. I had spent a while banging my head on this issue, convinced that there ought to be an easy way if only I found the right ContentProvider magic. I can see that we will need to solve similar problems more than once, and I would love to stay in the world of

[android-developers] Re: Querys involving more than one table of Contatcs Content Provider

2008-11-26 Thread Dianne Hackborn
On Wed, Nov 26, 2008 at 3:37 AM, jarkman [EMAIL PROTECTED] wrote: I have the slightly hazy idea that we could write our own Cursor that took a pair of Cursors and a join expression, so as to do this in a general way. That would be handy in all sorts of ways. Do you think that would be

[android-developers] Re: Querys involving more than one table of Contatcs Content Provider

2008-11-25 Thread jarkman
I've been looking at a similar problem. Something like this: Cursor cursor = context.getContentResolver().query( Contacts.GroupMembership.CONTENT_URI, new String[] {Contacts.GroupMembership._ID,Contacts.GroupMembership.PERSON_ID,

[android-developers] Re: Querys involving more than one table of Contatcs Content Provider

2008-11-25 Thread Mark Murphy
jarkman wrote: I'd love to make a cursor which also included the name of the person, but as far as I know there is no way to do that with a single query. That's probably true. That is, as far as I can tell, there's no way to do a join via the content provider interface, and permissions