How can i fetch builtin contacts in mobile...?

by Desu Vinod Kumar » Fri, 07 Aug 2009 20:23:37 GMT


Sponsored Links
 HI

Thanks a lot ...
it will be very useful for me....









-- 
Regards
-------------------
Desu Vinod Kumar
vinny.s...@gmail.com
09176147148

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



Other Threads

1. Need help, in case of accessing STARRED contacts

I am using the following code,


ArrayList<String> starListNames = new ArrayList<String>();
ArrayList<String> starListIds = new ArrayList<String>();


 */**** Extracting and Storing the Starred Contacts into the lists
named starListIds and starListNames  BEGIN  ***/*

  Cursor c = getContentResolver().query(Contacts.CONTENT_URI, null,
 Contacts.STARRED + "=?", new String[] { "1" }, null);

 while (c.moveToNext()) {

StarListIds.add(c.getString(c.getColumnIndexOrThrow(RawContacts._ID)));
 Log.i("Star-List", starListIds.get(blackListIds.size() - 1));
name = c.getString(c.getColumnIndexOrThrow(Contacts.DISPLAY_NAME));
 Log.i("Star-List", name);
starListNames.add(name);

 }

*/**** Extracting and Storing the Starred Contacts into the lists
named starListIds and starListNames  END***/*

 /**** The above block of code is working fine, in both emulator and Android
Phone(LG P500)  ****/


*/**** Extracting the contact whose RawContacts._ID, is stored in the
array-list starListIds at a given position  ***/
*

int position=2;
Cursor c1 = getContentResolver().query(


 ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
 null,
ContactsContract.Data.RAW_CONTACT_ID + "=?"
+ " AND "
 + ContactsContract.Data.MIMETYPE + "='"
+ Phone.CONTENT_ITEM_TYPE + "'",
 new String[] { starListIds.get( position ) },
null);

 String id1=c1.getString(c1.getColumnIndex(Data.RAW_CONTACT_ID));


 *Whats the Problem ?*
*In the above code, the id1 is not getting initialized in all cases.*
*e.g.,*

 *the id1 is getting initialized for the contacts that are manually added,
and popping a message of "Force Close" for the contacts that got
synchronized via., my gmail account.*
05-14 20:47:41.327: WARN/dalvikvm(32719): threadid=1: thread exiting with
uncaught exception (group=0x40020ac0)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719): FATAL EXCEPTION: main
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):
android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a
size of 0
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
android.database.AbstractCursor.checkPosition(AbstractCursor.java:580)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:214)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:41)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
android.database.CursorWrapper.getString(CursorWrapper.java:135)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
com.ProtoType.ViewBlackList$1$1.onClick(ViewBlackList.java:111)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
android.os.Handler.dispatchMessage(Handler.java:99)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
android.os.Looper.loop(Looper.java:123)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
android.app.ActivityThread.main(ActivityThread.java:4627)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
java.lang.reflect.Method.invokeNative(Native Method)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
java.lang.reflect.Method.invoke(Method.java:521)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
05-14 20:47:41.337: ERROR/AndroidRuntime(32719):     at
dalvik.system.NativeStart.main(Native Method)
05-14 20:47:41.457: WARN/ActivityManager(1363):   Force finishing activity
com.ProtoType/.ViewBlackList


-- 



Regards,
Bikkanati Prabhakar.
E-Mail: prabhakar.9...@gmail.com
Blog:    http://LetsXploreIT.blogspot.com

-- 

2. Arabic Language Support

Arabic Language support is currently starred to the top of the issues
on the Android project page on the Google Code website with currently
1681 stars and hundreds and hundreds of comments:
http://code.google.com/p/android/issues/list

This issue was big on the issues list and then got a huge boost after
this post on "Ardroid: Android for Arab Users" tech blog:
http://ardroid.com/2010/01/07/arabic-on-android/

currently the admins on the google code page are asking people to
bring the discussion here but it would be hard since the efforts are
already fragmented and it won't be easy to get the same overwhelming
response on a google group.

My point is that Arabic is in huge demand, at least having the ability
to display Arabic characters and providing an Arabic keyboard are of
utmost important to huge slice of potential market. I've seen so many
calls for Arabic support but nothing official from Google. Quite
frustrating really.

3. IWindowManager Hard Key Blocking/Mapping

4. OOT: senin besok cuti bersama, happy holiday

5. Aplikasi Travel Guide dan Direktori Lokasi Wisata (Alpha Release) Untuk skripsi

6. Recommendations for 'specialization'.

7. glsurfaceview makes other views slow with hardwareAccelerated=true