[android-developers] Re: How to display all contacts?

2010-04-24 Thread JohnT
Thank you! That did the trick. On Apr 19, 4:52 pm, Dmitri Plotnikov dplotni...@google.com wrote: You need to escape the mime type. Better yet, do this: Cursor cursor = mResolver.query( Data.CONTENT_URI,      new String[]{Event.DISPLAY_NAME, Event.DATA},      Data.MIMETYPE + =? AND +

[android-developers] Re: How to display all contacts?

2010-04-19 Thread JohnT
Hello, I implemented Dmitri's cursor code: Cursor cursor = mResolver.query( Data.CONTENT_URI, new String[]{Event.DISPLAY_NAME, Event.DATA}, Data.MIMETYPE + = + Event.CONTENT_ITEM_TYPE + AND + Event.TYPE + = + Event.TYPE_BIRTHDAY, null, Data.DISPLAY_NAME ); But I'm getting the

[android-developers] Re: How to display all contacts?

2010-04-19 Thread JohnT
Hello, I'm using Dmitri's code but am getting the following error: ERROR/AndroidRuntime(529): Caused by: android.database.sqlite.SQLiteException: near .: syntax error: , while compiling: SELECT display_name, data1 FROM view_data_restricted data WHERE (1) AND

Re: [android-developers] Re: How to display all contacts?

2010-04-19 Thread Dmitri Plotnikov
You need to escape the mime type. Better yet, do this: Cursor cursor = mResolver.query( Data.CONTENT_URI, new String[]{Event.DISPLAY_NAME, Event.DATA}, Data.MIMETYPE + =? AND + Event.TYPE + =?, new String[]{Event.CONTENT_ITEM_TYPE , String.valueOf(Event.TYPE_BIRTHDAY)},

[android-developers] Re: How to display all contacts?

2010-03-13 Thread ydario
Hi Dmitri, Cursor cursor = mResolver.query( Data.CONTENT_URI,     new String[]{Event.DISPLAY_NAME, Event.DATA},     Data.MIMETYPE + = + Event.CONTENT_ITEM_TYPE + AND + Event.TYPE + = + Event.TYPE_BIRTHDAY, I use a similar code, and I can retrieve data edited using Google Contacts on the

Re: [android-developers] Re: How to display all contacts?

2010-03-13 Thread Dmitri Plotnikov
Code snippets provided on this mailing list are often sketches or ideas without the expectation that they would work by simply copying and pasting. mResolver in the above snippets is assumed to have been initialized like this: ContentResolver mResolver; onCreate() { ... mResolver =

[android-developers] Re: How to display all contacts?

2010-03-12 Thread Nox
Thank you for your replies but I´ve still a problem. I´ve pasted the last code from Dmitri Plotnikov into my project but Eclipse doesn´t know what mResolver is. Do you know how to fix this problem? By the way, I tried the code from Karan too, but there I have the same problem with mResolver and

[android-developers] Re: How to display all contacts?

2010-03-11 Thread Karan
Use the following code to read the data. Cursor cursor = mResolver.query( Data.CONTENT_URI, null, where, null, Data.DISPLAY_NAME ); if( cursor != null ) { while( cursor.moveToNext() ) { String rawContactID = cursor.getString( cursor.getColumnIndex( Data.RAW_CONTACT_ID ) );

Re: [android-developers] Re: How to display all contacts?

2010-03-11 Thread Dmitri Plotnikov
Nice, but this might be even better: Cursor cursor = mResolver.query( Data.CONTENT_URI, new String[]{Event.DISPLAY_NAME, Event.DATA}, Data.MIMETYPE + = + Event.CONTENT_ITEM_TYPE + AND + Event.TYPE + = + Event.TYPE_BIRTHDAY, null, Data.DISPLAY_NAME ); if( cursor != null ) {

[android-developers] Re: How to display all contacts?

2010-03-10 Thread SREEHARI
Use the below code to display all contacts with their number package com.wipro.address; import android.app.ListActivity; import android.database.Cursor; import android.os.Bundle; import android.provider.Contacts.Phones; import android.provider.Contacts.People; import

Re: [android-developers] Re: How to display all contacts?

2010-03-10 Thread Dmitri Plotnikov
Sorry, but the above answer is misleading. First of all, it uses obsolete API. Second, it returns phone numbers, not birthdays. You should use the Data.CONTENT_URI and constrain the mime type to Event. And then you should do some magic about parsing dates, because we don't impose any format. So

[android-developers] Re: How to display all contacts?

2010-03-10 Thread Nox
Thank you for your replies, but unfortunately it doesn´t work. If I open my app there´ll appear the error message: The application has stopped unexpectedly. Please try again. Do you know what I have to do now? On 10 Mrz., 16:56, Dmitri Plotnikov dplotni...@google.com wrote: Sorry, but the

Re: [android-developers] Re: How to display all contacts?

2010-03-10 Thread Mark Murphy
Nox wrote: Thank you for your replies, but unfortunately it doesn´t work. If I open my app there´ll appear the error message: The application has stopped unexpectedly. Please try again. Do you know what I have to do now? Use adb logcat, DDMS, or the DDMS perspective in Eclipse to look at

[android-developers] Re: How to display all contacts?

2010-03-08 Thread saru
there are hundreds of posts regarding this. Just do a google search. On Mar 8, 6:40 pm, Nox v.beh...@googlemail.com wrote: Hello everybody, I want to develop an app, which displays every Contacts with their birthdays but I don´t know how to display the contacts. Is there a way to do that?