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. Reading Cause Codes after call

Hello.

I have a big problem. I have this task: "... recognise dropped calls,
and get information about cause of the drop...". Use these

For example: If in a phone call the called partner presses the red end
call button, the Call Controll sends the following message to me:  "
Cause No.17 "user busy" " (3GPP 24.008)

So, I would like to read cause codes ( exit codes in Symbian) when the
call is ended. I can use Java or C++ (JNI).

Thank.

-- 

2. Spinner in Android

Hello friends,

Is it possible to include Multiple rows of data with different font in
single row of spinner.

-- 
Thanks,
Jatin D N Patel
Masters, Computer Sci.
Suny Binghamton Univ, NY.

You Got To Think HIGH to RISE.

-- 

3. Intent from gmail app once contacts are synced.

4. full screen issues.

5. How to convert .swf to .apk ?

6. Always show notification bar

7. Android Device hooked up tot Terminal Server and printing