Adding Custom Data Types to Contacts

by Tabibito » Wed, 16 Dec 2009 02:50:04 GMT


Sponsored Links
 I find the documentation on custom data types for contacts very sparse
and the only example I can find in the documentation doesn't seem to
work.  I am trying to add a custom field to all my contacts, called
"isBusiness", which will hold a true or false.  I want to be able to
add this field and set its value for any rawcontact of my choosing.
Can someone give an example, from the creation of the data to insert
right up to the actual insert/update, including how to define the
CONTENT_ITEM_TYPE (is it just Boolean.CONTENT_ITEM_TYPE?), etc...

The example I found in the documentation (with my questions inline):

 values.put(Data.RAW_CONTACT_ID, rawContactId);
 values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);
    // I assume I need to put the mime type of the data I'm inserting
- what's the mime type for a boolean?
 values.put(StructuredName.DISPLAY_NAME, "Mike Sullivan");
    // Since I'm adding isBusiness, what should I use for the first
argument, and where do I define this constant?
 getContentResolver().insert(Data.CONTENT_URI, values);
    // Data doesn't seem to have a CONTENT_URI defined... what should
I use instead?

Thank you for any help you can give me!
-Dan W

--



Other Threads

1. <Wta> about 3g dogwatcher..

Guys mau nny donk ko 3g dogwatcher saia dr kemaren o,o% trus y usagenya
crnya gimana biar kedetect usage yg uda dipake...
Mhon pencerahannya

-- 
=========================
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:

Click  

2. System Calls in Android

Hi,

Is there any way I can find out the system calls invoked by Android
for specific tasks?

For example, for writing/deleting contacts or writing/deleting SMS
what are the Linux system calls invoked by Android for these tasks?

I can't find any links explaining on this.

Thanks in Advance,
Perumal

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: 

3. Get supported media types ( programatically)

4. Menu Item Name

5. Live coverage of Google's Android phone announcement ( 10:00 PST - 18:00 GMT )

6. How to downgrade T-Mobile G1 from Donut to Cupcake?

7. File creation problem in Android source build