Contacts DataBase

by Alexandru Mos » Fri, 03 Oct 2008 01:37:47 GMT


Sponsored Links
 I have 2 questions. Do you know why I can't update the contact phone
numbers and how can I read an IM (Instant message) account in the new
version of sdk (v 1.0) ?

-- 
Ing. Alexandru Mos


--~--~---------~--~----~------------~-------~--~----~



Contacts DataBase

by dailyLife » Thu, 16 Oct 2008 10:31:39 GMT


 Query:
public Cursor queryAll(String[] returnSequence) {
  Cursor cusor = null;
  ContentResolver contentResolver = mContext.getContentResolver();
  cusor = contentResolver.query(Contacts.People.CONTENT_URI, returnSequence, 
null, null, null);// DEFAULT_SORT_ORDER
  return cusor;
 }
 public Cursor queryByName(String[] returnSequence, String name) {
  Cursor cusor = null;
  ContentResolver contentResolver = mContext.getContentResolver();
  cusor = contentResolver.query(Contacts.People.CONTENT_URI, returnSequence, 
Contacts.People.NAME + "=?", new String[] { name }, Contacts.People.NAME + " 
ASC");// DEFAULT_SORT_ORDER
  return cusor;
 }
update:
String[] projection = new String[] { Contacts.People._ID, Contacts.People.NAME, 
Contacts.People.NUMBER };
   cusor = contentResolver.query(Contacts.People.CONTENT_URI, projection, 
Contacts.People.NAME + "=?", new String[] { oldName }, Contacts.People.NAME + " 
ASC");
   cusor.moveToFirst();
   ContentValues values = new ContentValues();
   Uri uri = Uri.withAppendedPath(Contacts.People.CONTENT_URI, 
cusor.getString(cusor.getColumnIndex(Contacts.People._ID)));
   values.put(Contacts.People.NAME, newName);
   values.put(Contacts.People.STARRED, 0);
   contentResolver.update(uri, values, null, null);

[EMAIL PROTECTED]
200806
----- Original Message ----- 
From: Alexandru Mos 
To: android-developers 
Sent: 2008-10-02, 23:32:49
Subject: [android-developers] Contacts DataBase


I have 2 questions. Do you know why I can't update the contact phone
numbers and how can I read an IM (Instant message) account in the new
version of sdk (v 1.0) ?

-- 
Ing. Alexandru Mos



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. No output with playing a media file with Android APIDemos Mediaplayer

Hi, I am trying to run a sample media file  (.mp4/ H.264 avc1 format)
with the APIDemos's Mediaplayer on emulator, but I only see a blank
screen. If I understand correctly then support for .mp4 files already
exists with Android.

Doing logcat on emulator shows the following:

$ adb -s emulator-5554 logcat
W/KeyCharacterMap(  169): No keyboard for id 0
W/KeyCharacterMap(  169): Using default keymap: /system/usr/keychars/
qwerty.k
D/MediaPlayerDemo(  169): surfaceDestroyed called
I/ActivityManager(   52): Starting activity: Intent
{ cmp=com.example.android
D/MediaPlayerDemo(  169): surfaceCreated called
W/PlayerDriver(   31): Using generic video MIO
D/AudioSink(   31): bufferCount (4) is too small and increased to 12
W/MediaPlayer(  169): info/warning (1, 44)
D/MediaPlayerDemo(  169): surfaceChanged called
I/MediaPlayer(  169): Info (1,44)
D/MediaPlayerDemo(  169): onPrepared called
E/PVOMXVidDecNode(   31): Ln 1373 OMX_EventError nData1 -2147479541
nData2 0
W/MediaPlayer(  169): info/warning (1, 16)
I/MediaPlayer(  169): Info (1,16)
E/PVOMXVidDecNode(   31): Ln 1373 OMX_EventError nData1 -2147479541
nData2 0
W/MediaPlayer(  169): info/warning (1, 16)
I/MediaPlayer(  169): Info (1,16)
E/PVOMXVidDecNode(   31): Ln 1373 OMX_EventError nData1 -2147479541
nData2 0
W/MediaPlayer(  169): info/warning (1, 16)
I/MediaPlayer(  169): Info (1,16)
I/ActivityManager(   52): Displayed activity
com.example.android.apis/.media.
V/MediaPlayerDemo(  169): onVideoSizeChanged called
V/MediaPlayerDemo(  169): startVideoPlayback
D/MediaPlayerDemo(  169): surfaceChanged called
W/AudioFlinger(   31): write blocked for 70 msecs, 1 delayed writes,
thread 0
E/SurfaceFlinger(   52): layer 0x33d098, texture=5, using format 114,
which i
E/PVOMXVidDecNode(   31): Ln 1373 OMX_EventError nData1 -2147479541
nData2 0
W/MediaPlayer(  169): info/warning (1, 16)
I/MediaPlayer(  169): Info (1,16)
E/PVOMXVidDecNode(   31): Ln 1373 OMX_EventError nData1 -2147479541
nData2 0
W/MediaPlayer(  169): info/warning (1, 16)
I/MediaPlayer(  169): Info (1,16)
E/PVOMXVidDecNode(   31): Ln 1373 OMX_EventError nData1 -2147479541
nData2 0
W/MediaPlayer(  169): info/warning (1, 16)
I/MediaPlayer(  169): Info (1,16)
E/PVOMXVidDecNode(   31): Ln 1373 OMX_EventError nData1 -2147479541
nData2 0
W/MediaPlayer(  169): info/warning (1, 16)
I/MediaPlayer(  169): Info (1,16)
E/PVOMXVidDecNode(   31): Ln 1373 OMX_EventError nData1 -2147479541
nData2 0
W/MediaPlayer(  169): info/warning (1, 16)
...
...
....

I have already tried setting the resolution of the emulator to be
higher than that of the mp4 file's resolution.

Any ideas/ suggestions what could be wrong?
Thanks in advance,
Divkis

2. info: miley cyrus fans! Miley has been rooted!

http://translate.google.com/translate?u=http%3A%2F%2Fwww.android-hilfe.de%2Fnews-ankuendigungen%2F15014-android-hilfe-de-rootet-milestone.html

3. CRC on androi

4. easy to register

5. Breakpoints on device debugging

6. boot KAMIO-1251 board equipped with a MIPS AU1250 CPU

7. I am a german market developer. How can I see the english comments to my program?