Dear Mark,

your solution sounds really great but I discovered that it is just ...
impossible to make some bulk operation on contacts (at least until
release r3).

I then optimized my code to update just what has to be updated.

Thanks you by the way for your answer.

C.

On 28 sep, 14:19, Mark Murphy <mmur...@commonsware.com> wrote:
> cyril.at...@gmail.com wrote:
> > I have an application that updates all the contacts belonging to a
> > group, I currently do the following :
> > -> Get the group id
> > -> Get all the contacts id inside this group
> > -> For each of them I am doing an update on thecontact=> This is
> > really heavy and seems to take time in real phones while I expect it
> > to be "instantaneous".
>
> > I am wondering if we can, in the ContentResolver.update() method
> > specify a kind of join.
> > For instance I'd like to do something like :
> > UPDATE <people> SET <people.name>="<new name>" FROM People p,
> > GroupsMemberships gm WHERE p.person_id=gm.person_id and
> > gm.group_id=<my_group_id>
>
> > Does anyone know if it's possible or not?
>
> Not that I am aware of. Bear in mind that not all content providers will
> be using a SQL database as the place of data storage.
>
> Since the contacts content provider does appear to use SQLite, rather
> than iterating over your contacts, though, you could try the IN syntax
> in the WHERE-style constraint:
>
> [WHERE] person_id IN (...)
>
> where ... is a comma-delimited set of values, or possibly even a
> sub-select to get the IDs of the contacts to update.
>
> http://sqlite.org/lang_expr.html
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Looking for Android opportunities?http://wiki.andmob.org/hado
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to