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. Framework Support for Ogg Vorbis Decoder

Can someone summarize or point me to a description of Ogg Vorbis
support is divided between the Framework and kernel.

I have a drop from omapzoom.org that has a project named <root>/
external/tremor.
This looks like Vorbis support but I think its only the framework
support.
Are there additional kernel level module(s) required for Vorbis
decoding?

Regards,
Will

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

2. PMEM crashing

Dear all:

Initially, I did not have PMEM implemented such as I did not provide
8MB for pmem, and pmem_adsp.
Now I did provide that by reserving 16MB of memory out of my 128MB
SDRAM part.  Then Android won't boot, it keeps crashing after
launching the "Service Manager".
Can someone please tell me what I have missed in order to utilize the
PMEM feature effectively?

One more thing I want to point out is that, if I force a mapping error
for PMEM like saying I have 4MB of memory available for pmem, and
pmem_adsp, then I can boot Android successfully.
Here is a logcat error for the surface-flinger mapping:
   I/SurfaceFlinger( 1582): SurfaceFlinger is starting
      pmem: could not find allocation for map.
   I/SurfaceFlinger( 1582): SurfaceFlinger's main thread ready to run.
Initializing graphics H/W...
   E/MemoryHeapBase( 1582): mmap(fd=20, size=8388608) failed (Invalid
argument)

Attached is the logcat information of the crashing case so you can
review.

I/sysproc ( 1581): ServiceManager: 0x154f98
I/SurfaceFlinger( 1581): SurfaceFlinger is starting
I/SurfaceFlinger( 1581): SurfaceFlinger's main thread ready to run.
Initializing graphics H/W...
E/SurfaceFlinger( 1581): Couldn't open /sys/power/wait_for_fb_sleep
or /sys/power/wait_for_fb_wake
E/GLLogger( 1581): couldn't load <libhgl.so> library (Cannot find
library)
I/SurfaceFlinger( 1581): EGL informations:
I/SurfaceFlinger( 1581): # of configs : 6
I/SurfaceFlinger( 1581): vendor    : Android
I/SurfaceFlinger( 1581): version   : 1.31 Android META-EGL
I/SurfaceFlinger( 1581): extensions:
I/SurfaceFlinger( 1581): Client API: OpenGL ES
I/EGLDisplaySurface( 1581): using (fd=22)
I/EGLDisplaySurface( 1581): id           = mv87xx-fb
I/EGLDisplaySurface( 1581): xres         = 240 px
I/EGLDisplaySurface( 1581): yres         = 320 px
I/EGLDisplaySurface( 1581): xres_virtual = 240 px
I/EGLDisplaySurface( 1581): yres_virtual = 640 px
I/EGLDisplaySurface( 1581): bpp          = 16
I/EGLDisplaySurface( 1581): r            = 11:5
I/EGLDisplaySurface( 1581): g            =  5:6
I/EGLDisplaySurface( 1581): b            =  0:5
I/EGLDisplaySurface( 1581): width        = 240 mm (25.400000 dpi)
I/EGLDisplaySurface( 1581): height       = 320 mm (25.400000 dpi)
I/EGLDisplaySurface( 1581): refresh rate = 60.00 Hz
W/HAL     ( 1581): load: module=/system/lib/hw/copybit.mtekvision.so
error=Cannot find library
W/HAL     ( 1581): load: module=/system/lib/hw/copybit.default.so
error=Cannot find library
W/SurfaceFlinger( 1581): ro.sf.lcd_density not defined, using 160 dpi
by default.
I/SurfaceFlinger( 1581): OpenGL informations:
I/SurfaceFlinger( 1581): vendor    : Android
I/SurfaceFlinger( 1581): renderer  : Android PixelFlinger 1.0
I/SurfaceFlinger( 1581): version   : OpenGL ES-CM 1.0
I/SurfaceFlinger( 1581): extensions: GL_OES_byte_coordinates
GL_OES_fixed_point GL_OES_single_precision GL_OES_read_format
GL_OES_compressed_paletted_texture GL_OES_draw_texture
GL_OES_matrix_get GL_OES_query_matrix GL_ARB_texture_compression
GL_ARB_texture_non_power_of_two GL_ANDROID_direct_texture
GL_ANDROID_user_clip_plane GL_ANDROID_vertex_buffer_object
GL_ANDROID_generate_mipmap
W/HAL     ( 1581): load: module=/system/lib/hw/copybit.mtekvision.so
error=Cannot find library
W/HAL     ( 1581): load: module=/system/lib/hw/copybit.default.so
error=Cannot find library
W/HAL     ( 1581): load: module=/system/lib/hw/overlay.mtekvision.so
error=Cannot find library
W/HAL     ( 1581): load: module=/system/lib/hw/overlay.default.so
error=Cannot find library
I/sysproc ( 1581): System server: starting Android runtime.
I/sysproc ( 1581): System server: starting Android services.
I/SystemServer( 1581): Entered the Android system server!
I/sysproc ( 1581): System server: entering thread pool.
E/GLLogger( 1581): couldn't load <libhgl.so> library (Cannot find
library)
I/SystemServer( 1581): Starting Power Manager.
I/SystemServer( 1581): Starting Activity Manager.
I/DEBUG   ( 1563): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG   ( 1563): Build fingerprint: 'generic/generic/generic/:1.5/
CUPCAKE/eng.sbiswas.20090601.170816:eng/test-keys'
I/DEBUG   ( 1563): pid: 1581, tid: 1587  >>> system_server <<<
I/DEBUG   ( 1563): signal 11 (SIGSEGV), fault addr 4528e160
I/DEBUG   ( 1563):  r0 4528e160  r1 00000000  r2 80000000  r3 00000000
I/DEBUG   ( 1563):  r4 00000139  r5 00055400  r6 00008000  r7 000000f0
I/DEBUG   ( 1563):  r8 0000c000  r9 00184fa0  10 00000000  fp 00000000
I/DEBUG   ( 1563):  ip 00000000  sp 44967c24  lr 00000000  pc
afb04534  cpsr 80000010
I/DEBUG   ( 1563):          #00  pc 00004534  /system/lib/libcutils.so
I/DEBUG   ( 1563):          #01  pc 0000a96c  /system/lib/
libpixelflinger.so
I/DEBUG   ( 1563):          #02  pc 00009ae4  /system/lib/
libpixelflinger.so
I/DEBUG   ( 1563):          #03  pc 00011924  /system/lib/libagl.so
I/DEBUG   ( 1563):          #04  pc 0000a17c  /system/lib/libagl.so
I/DEBUG   ( 1563):          #05  pc 00009068  /system/lib/libagl.so
I/DEBUG   ( 1563):          #06  pc 000264fe  /system/lib/
libsurfaceflinger.so
I/DEBUG   ( 1563):          #07  pc 000252aa  /system/lib/
libsurfaceflinger.so
I/DEBUG   ( 1563):          #08  pc 00026562  /system/lib/
libsurfaceflinger.so
I/DEBUG   ( 1563):          #09  pc 0002cc98  /system/lib/
libsurfaceflinger.so
I/DEBUG   ( 1563):          #10  pc 0002ce68  /system/lib/
libsurfaceflinger.so
I/DEBUG   ( 1563):          #11  pc 0002f21e  /system/lib/
libsurfaceflinger.so
I/DEBUG   ( 1563):          #12  pc 000287f4  /system/lib/libutils.so
I/DEBUG   ( 1563):          #13  pc 000285d4  /system/lib/libutils.so
I/DEBUG   ( 1563):          #14  pc 0000f880  /system/lib/libc.so
I/DEBUG   ( 1563):          #15  pc 0000f3f4  /system/lib/libc.so
I/DEBUG   ( 1563): stack:
I/DEBUG   ( 1563):     44967be4  00000001
I/DEBUG   ( 1563):     44967be8  ffffffff
I/DEBUG   ( 1563):     44967bec  ace09b70  /system/lib/libcorecg.so
I/DEBUG   ( 1563):     44967bf0  001896ec  [heap]
I/DEBUG   ( 1563):     44967bf4  00000000
I/DEBUG   ( 1563):     44967bf8  00000008
I/DEBUG   ( 1563):     44967bfc  00000000
I/DEBUG   ( 1563):     44967c00  00000000
I/DEBUG   ( 1563):     44967c04  00184fa0  [heap]
I/DEBUG   ( 1563):     44967c08  00186230  [heap]
I/DEBUG   ( 1563):     44967c0c  acf0b228  /system/lib/
libpixelflinger.so
I/DEBUG   ( 1563):     44967c10  00000000
I/DEBUG   ( 1563):     44967c14  00000000
I/DEBUG   ( 1563):     44967c18  df002777
I/DEBUG   ( 1563):     44967c1c  e3a070ad
I/DEBUG   ( 1563):     44967c20  00000139
I/DEBUG   ( 1563): #00 44967c24  acf0a970  /system/lib/
libpixelflinger.so
I/DEBUG   ( 1563): #01 44967c28  00000008
I/DEBUG   ( 1563):     44967c2c  000013f8
I/DEBUG   ( 1563):     44967c30  001857dc  [heap]
I/DEBUG   ( 1563):     44967c34  000013f8
I/DEBUG   ( 1563):     44967c38  44967c5c
I/DEBUG   ( 1563):     44967c3c  44967c4c
I/DEBUG   ( 1563):     44967c40  000013f8
I/DEBUG   ( 1563):     44967c44  44967c6c
I/DEBUG   ( 1563):     44967c48  03010104
I/DEBUG   ( 1563):     44967c4c  00008000  /system/bin/app_process
I/DEBUG   ( 1563):     44967c50  00000000
I/DEBUG   ( 1563):     44967c54  00000008
I/DEBUG   ( 1563):     44967c58  000013f8
I/DEBUG   ( 1563):     44967c5c  00f0d400
I/DEBUG   ( 1563):     44967c60  0000c000  [heap]
I/DEBUG   ( 1563):     44967c64  00000008
I/DEBUG   ( 1563):     44967c68  000013f8
I/DEBUG   ( 1563):     44967c6c  acf08328  /system/lib/
libpixelflinger.so
I/DEBUG   ( 1563):     44967c70  03010104
I/DEBUG   ( 1563):     44967c74  00000077
I/DEBUG   ( 1563):     44967c78  00000000
I/DEBUG   ( 1563):     44967c7c  00000002
I/DEBUG   ( 1563):     44967c80  3c088889
I/DEBUG   ( 1563):     44967c84  00184fa0  [heap]
I/DEBUG   ( 1563):     44967c88  00186230  [heap]
I/DEBUG   ( 1563):     44967c8c  001862b0  [heap]
I/DEBUG   ( 1563):     44967c90  00186330  [heap]
I/DEBUG   ( 1563):     44967c94  00000000
I/DEBUG   ( 1563):     44967c98  00000004
I/DEBUG   ( 1563):     44967c9c  00000000
I/DEBUG   ( 1563):     44967ca0  00000001
I/DEBUG   ( 1563):     44967ca4  acf09ae8  /system/lib/
libpixelflinger.so
I/SystemServer( 1581): Starting telephony registry
I/SystemServer( 1581): Starting Package Manager.
I/Installer( 1581): connecting...
I/installd( 1569): new connection
I/PackageManager( 1581): Got library android.awt in /system/framework/
android.awt.jar
I/PackageManager( 1581): Got library android.test.runner in /system/
framework/android.test.runner.jar
I/PackageManager( 1581): Got library com.android.im.plugin in /system/
framework/com.android.im.plugin.jar
W/SurfaceComposerClient( 1581): lock_layer timed out (is the CPU
pegged?) layer=0, lcblk=0x41045020, state=00000012 (was 00000012)
I/DEBUG   ( 1563): de{*filter*}d committing suicide to free the zombie!
I/DEBUG   ( 1601): de{*filter*}d: Jun  1 2009 17:37:01
I/ServiceManager( 1560): service 'batteryinfo' died
I/ServiceManager( 1560): service 'usagestats' died
I/ServiceManager( 1560): service 'telephony.registry' died
I/ServiceManager( 1560): service 'SurfaceFlinger' died
I/ServiceManager( 1560): service 'power' died
E/installd( 1569): eof
E/installd( 1569): failed to read size
I/installd( 1569): closing connection
D/Zygote  ( 1565): Process 1581 terminated by signal (11)
android_power: wakeup (0->0) at 30327817000 (1970-01-01
00:00:30.327824000 UTC)
I/Zygote  ( 1565): Exit zygote because system server (1581) has
terminated

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website:  http://www.***.com/ 
-~----------~----~----~----~------~----~------~--~---

3. contextMenu and dialog

4. contextMenu for dialog

5. ListView - keep item selected

6. testing/understanding weak and strong pointers

7. Removing Missed Call Notification