i am trying to get the address from the contacts from the following
query in the Businesscard application
cursor = contentResolver.query(StructuredPostal.CONTENT_URI,
new String[]{StructuredPostal.FORMATTED_ADDRESS},
StructuredPostal.CONTACT_ID + "=" + contactId, null,
StructuredPostal.IS_SUPER_PRIMARY + " DESC");
System.out.println("cursor "+cursor.getCount());
try {
if (cursor.moveToFirst()) {
System.out.println("addadress "+cursor.getString
(cursor.getColumnIndex(StructuredPostal.FORMATTED_ADDRESS)));
}
} finally {
cursor.close();
}
But i am getting no results.Am i doing something wrong here?
On Dec 11, 12:49 am, Artak Kalantarian <[email protected]> wrote:
> Thanks Dmitry,
>
> The main issues ended up being that address has moved from a column called
> "data" to a column called "data1".
>
> On Thu, Dec 10, 2009 at 9:16 AM, Dmitri Plotnikov
> <[email protected]>wrote:
>
> > See these documents for descriptions of what you can get out of an
> > Android 2.0 contacts database and how:
>
> >http://d.android.com/reference/android/provider/ContactsContract.Data...
>
> >http://d.android.com/reference/android/provider/ContactsContract.Comm...
>
> > If you are building an APK that must work with both pre-Eclair and
> > Eclair contacts data, consider writing something like this:
>
> >http://code.google.com/p/android-business-card/source/browse/#svn/tru...
>
> > I hope these help.
> > - Dmitri
>
> > On Tue, Dec 8, 2009 at 7:54 PM, Artak <[email protected]> wrote:
> > > My app had in intent-filter to respond when users click on a person's
> > > address in the contacts application.
>
> > > In Android 1.5 I would get an intent with data like
> > > content://contacts/people/16/contact_methods/3
>
> > > In order to retrive the address from the contact I would later I would
> > > do:
>
> > > Cursor c = getContentResolver().query(intentUri, ...);
>
> > > Get the column called "data" and take the address from there.
>
> > > That stopped working on later android releases. On 2.0 all I get is:
>
> > > content://com.android.contacts/data/4
>
> > > And I do not know how to get the address form that. It fails when I
> > > query for it.
>
> > > Any suggestions?
>
> > > Thank you,
>
> > > Artak Kalantarian
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]<android-developers%[email protected]>
> > > 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 post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]<android-developers%[email protected]>
> > 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 post to this group, send email to [email protected]
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