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 have some performance issues to deal with, but I'm sure they will respond to tweakery. Richard On Nov 26, 12:27 am, Mark Murphy <[EMAIL PROTECTED]> wrote: > jarkmanwrote: > > 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 prevent us from accessing > > the contacts database directly via SQL calls. I really hope somebody > > can prove me wrong! > > I will be dealing with a somewhat similar situation later this week, > when I attempt to join data from a ContentProvider and a SQLite database. > > Since what I want in the end is a Cursor, the approach I am trying is to > use a custom CursorWrapper subclass. It will get handed the Cursor from > the ContentProvider and will fold in the data from the SQLite database > on demand as the relevant values are requested. Caching gets a mite > tricky (gotta remember to flush the cache on requery(), for example), > but I see no reason it won't work. > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > _The Busy Coder's Guide to Android Development_ Version 1.4 Published! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---