inserting email address into ContactMethods table in 0.9 beta

by kingkung » Sat, 30 Aug 2008 09:46:07 GMT


Sponsored Links
 For whatever reason, I'm having trouble inserting email addresses into
the ContactMethods table in 0.9... the code worked perfectly fine in
m5.

The insert() call is successful (no exception), but it consistently
says that 0 rows have been inserted.  These are the values that I set
in my ContentValues object:

cv = new ContentValues();
cv.put(ContactMethods.KIND,KIND_EMAIL); //KIND_EMAIL is an integer (1)
cv.put(ContactMethods.PERSON_ID, ac.mobileID); //long
cv.put(ContactMethods.DATA, email.value); //string
cv.put(ContactMethods.TYPE, email.type); //integer btwn 0-3
int rows =
context.getContentResolver().bulkInsert(getMethodUri(personUri),generateAddressCVarray(ac));
Logger.log(rows);

private static Uri getMethodUri(Uri contactUri)
{
        return
contactUri.buildUpon().appendPath(ContactMethods.CONTENT_URI.getLastPathSegment()).build();
}

Is there something I'm missing or something else that I need to set?
As I said before, this worked perfectly fine in m5.


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



inserting email address into ContactMethods table in 0.9 beta

by kingkung » Sat, 30 Aug 2008 09:50:17 GMT


 Slightly confusing code... the ContentValues properties (below) are
set in the method generateAddressCVarray(), which generates an array
of CVs for each email address...

cv = new ContentValues();
cv.put(ContactMethods.KIND,KIND_EMAIL); //KIND_EMAIL is an integer (1)
cv.put(ContactMethods.PERSON_ID, ac.mobileID); //long
cv.put(ContactMethods.DATA, email.value); //string
cv.put(ContactMethods.TYPE, email.type); //integer btwn 0-3

...........

The following line is then called for a bulkInsert... and the rows
always come out as 0.  Even if I insert them one at a time, I get the
same result.

int rows =
context.getContentResolver().bulkInsert(getMethodUri(personUri),generateAddressCVarray(ac));
Logger.log(rows);

private static Uri getMethodUri(Uri contactUri)
{
 return
contactUri.buildUpon().appendPath(ContactMethods.CONTENT_URI.getLastPathSegment()).build();
}

Can anyone help?
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


inserting email address into ContactMethods table in 0.9 beta

by Jeff Hamilton » Sat, 30 Aug 2008 09:54:14 GMT


 Does anything show up in the log when you see the failure?

-Jeff




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



inserting email address into ContactMethods table in 0.9 beta

by kingkung » Wed, 03 Sep 2008 01:21:31 GMT


 It's not a failure, it's just that 0 addresses are added.




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



inserting email address into ContactMethods table in 0.9 beta

by kingkung » Wed, 03 Sep 2008 04:09:11 GMT


 Never mind, my types are set to "0", and there is no "0" type anymore.





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



Other Threads

1. HTC Hero Update 2.1 --> Broke Audio Streaming ????

Hi there,
I have installed the 2.1 update on my HTC Hero yesterday, and happy as
a puppy I instaleld my streaming app... Just to discover that it won't
stream decently... It has to stream an mp3 stream and it works on my
ADP 1.6 device, on a Samsung Galaxy S test-device (with 2.1) and on
the 2.1 emulator...
Logcat is gettign the follwoing errors :

06-30 10:14:18.360: INFO/AudioPolicyService(56): stopOutput(): before
lock
06-30 10:14:21.259: DEBUG/dalvikvm(1906): GC freed 28 objects / 1944
bytes in 186ms
06-30 10:14:21.439: INFO/AudioHardwareMSM72XX(56): AudioHardware pcm
playback is going to standby.
06-30 10:14:21.439: DEBUG/StreamProcess(56):
OutputStreamProcess::ResetAOLC()
06-30 10:14:22.919: INFO/AudioPolicyService(56): startOutput(): before
lock
06-30 10:14:22.987: INFO/AudioHardwareMSM72XX(56): AUDIO_START: start
kernel pcm_out driver.
06-30 10:14:26.329: DEBUG/dalvikvm(287): GC freed 11 objects / 488
bytes in 268ms
06-30 10:14:47.789: INFO/AudioPolicyService(56): stopOutput(): before
lock
06-30 10:14:50.879: INFO/AudioHardwareMSM72XX(56): AudioHardware pcm
playback is going to standby.
06-30 10:14:50.879: DEBUG/StreamProcess(56):
OutputStreamProcess::ResetAOLC()
06-30 10:14:53.911: INFO/AudioPolicyService(56): startOutput(): before
lock
06-30 10:14:54.022: INFO/AudioHardwareMSM72XX(56): AUDIO_START: start
kernel pcm_out driver.

The result is a playing player, which stops (pauzes) every 10 seconds,
the restarts... This will work for about 8-10 restarts and then will
simply stop without ever thrwoing an exception or something like
that... Which makes it somewhat difficult (if not impossible) to catch
for us developers...
So has anyone been experiencing the same problem ? Does anyone have a
clue if in this update another OpenCore lib has been used ? Does
anyone have any solution ?

-- 

2. Question about .asec (encryption) on Froyo 2.2 (Emulator)

Apps on SD card are stored in an encrypted container for platform security
purposes -- so that other applications can not modify or corrupt them.  When
mounting the SD card, these containers are mounted so that they can be
accessed in the same way as apps stored in internal storage.




> 

3. Is it a good idea to change the default Android controls?

4. Regarding coding standards for GPL license device drivers code

5. Your content must have a ListView whose id attribute is 'android.R.id.list'

6. Why this Exception is coming ?

7. Setting multiple alarms