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 +
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
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
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)},
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
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 =
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
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 ) );
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 ) {
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
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
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
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
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?
14 matches
Mail list logo