Friday, February 22, 2013

[android-developers] Re: Is it possible to do a query that joins the Events and Reminders tables?

Short answer: no unless there is a special data view provided by CalendarContract that provides this feature (I do not know about that).

Long answer: as I understand the design decisions behind the Android ContentProvider, it is meant to be data source backend-neutral. An implementation of a ContentProvider might as well use something else than SQLite. It could be even just a bunch of XML files. And the way the ContentProvider interface is currently implemented it is unfortunately not possible to make a nice table join.

There used to be hacks in the past where programmers injected table join statements into ContentProvider queries. The problem is that you have to figure out the proper table names and hope for the best that these are the same on all devices and remain the same in the future. So in other words: that shouldn't be done because it will break.

Because of this lack of making proper joins the Android framework provides a hack called CursorJoiner. It basically solves that joining problem in Java-land.

On Friday, February 22, 2013 7:02:52 PM UTC-6, Dawn Rhummy wrote:
I want to do a query that joins the Events.CONTENT_URI and Reminders.CONTENT_URI tables into one query. Is this possible?

--
--
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
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment