could you please in updating phone contacts as the below code can't change
i'm trying to update phone number of all existing contacts, below code
run but don't update contact phone number
package com.third;
import android.app.Activity;
import android.content.ContentUris;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Contacts.People.Phones;
import android.provider.ContactsContract;
import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Data;
import android.util.Log;
public class ThirdAppActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Cursor cursor =
getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,null,
null, null, null);
while (cursor.moveToNext()) {
String contactId =
cursor.getString(cursor.getColumnIndex(
ContactsContract.Contacts._ID));
String hasPhone =
cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER));
Cursor phones =
getContentResolver().query(
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = "+
contactId, null, null);
while (phones.moveToNext()) {
String phoneNumber =
phones.getString(phones.getColumnIndex(
ContactsContract.CommonDataKinds.Phone.NUMBER));
ContentValues values = new ContentValues();
values.clear();
values.put(Phones.NUMBER,"1234567890");
values.put(Phones.TYPE,2);
Uri phoneUri =
ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI,
Long.valueOf(contactId));
int raw= getContentResolver().update(phoneUri,
values, null, null);
}
phones.close();
}
}
}
On Sat, Aug 6, 2011 at 2:03 AM, Nick Risaro <[email protected]> wrote:
>
> On Fri, Aug 5, 2011 at 6:04 PM, neuromit <[email protected]> wrote:
>
>> I'm extremely interested in streaming audio and or video from a
>> computer to an android device?
>>
>> Ideally an event on the computer would trigger the creation of the A/V
>> stream, the computer would then notify the phone via sms, or some
>> other mechanism, about the stream at which point the phone could
>> connect and play the audio and or video in the stream.
>>
>> Is something like this currently possible without creating everything
>> from scratch?
>>
>> You can read something about DLNA
> http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance some devices
> had support for it out of the box.
>
> --
>> 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
>
>
> --
> 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
--
Mohamed Abdelrahman khalil
Etisalat Misr
E2E Network Voice Quality
Mobile:011-4000753
--
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