Skip to main content

Samsung A867 Contacts UID Issue.

4 replies [Last post]
abhijeetrajenamdeo
Offline
Joined: 2008-04-01
Points: 0

Hi All,

I am developing J2me application for backing up contacts.In this application user can upload and download contacts from mobile to web and vice-versa.

For avoiding duplication of contacts on web side and device side I am using contact UID for checking contacts.

This application is properly working on Sony, LG, Nokia, Motorola, Pantech and ATT Quickfire devices, But i am getting problem on SAMSUNG A867.

In SAMSUNG A867 contacts UID is not stable. In this device contact UID returns in encoded form like " com.svn.kvemmidp.pim.PIMProxy$Item@343bc1d". Every time when we read contacts from device,Device PIM returns different UID in encoded form for same contact.

Because contact UID is not same, So that I am getting duplicate contacts.

Contacts UID generated by device itself when any contacts creates on device. I can't modify contacts UID also Device PIM returns different UID in encoded form for same contact at every reading.

Is there any way to resolve this problem?

I need to know what encoding device system is using for generating contact's UID?

Please reply if someone give me any information regaring this issue.

Thanks a lot in Advance.

You can also reply me at abhijeet.namdeo@techendeavour.com

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sfitzjava
Offline
Joined: 2003-06-15
Points: 0

Looking at the information you presented "com.svn.kvmmidp.pim.PIMProxy$Item@343bc1d" looks to be a pointer address for the object you are trying to reference. You may want to do a getClass().getName() on that object and see what it really is. Samsung may not have followed the actual spec and this object may be of an unexpected type to what you are expecting.

-Shawn

abhijeetrajenamdeo
Offline
Joined: 2008-04-01
Points: 0

Thanks for the reply.

I am getting this ID "com.svn.kvmmidp.pim.PIMProxy$Item@343bc1d" when creating any new contact in device using J2ME PIM API. When i am reading contacts from device, it returns different ID everytime. This is the my question, why system is returning different ID everytime.

sfitzjava
Offline
Joined: 2003-06-15
Points: 0

it's different because that is not the UID you are seeing. it is a memory address pointer, and that will change from execution to execution of an app, or if you call it 3 times it may create the object in 3 different locations of memory.

The UID according to the PIM spec is an 'int'. An INT is a primitive and not an object so you could not be getting the value you have stated if your code was working. Since you have not provided any code snippet there is no clue as to what you have done wrong.

I would recommend you read a book or five on Java and JavaME to get a better understanding of the way the VM works and how data types are managed in memory. Two I would recommend are "Java in a nutshell" and "kicking butt with midp and msa".

-Shawn

mikeutt
Offline
Joined: 2009-05-11
Points: 0

I’m having the same problem with this code and Samsung phones.

try {

PIM pim = PIM.getInstance();

String[] names = pim.listPIMLists(PIM.CONTACT_LIST);

pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY, names[0]);

ContactList addressbook = (ContactList) (pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY));

Enumeration items = null;
items = addressbook.items();

while (items.hasMoreElements()) {

Contact contact = (Contact) items.nextElement();

String uid = contact.getString(Contact.UID, 0);

System.out.println(uid);

}

} catch (SecurityException e) {
System.out.println(e);

} catch (Exception e){
System.out.println(e);

}

It’s prints out a list of memory address pointer for each contact like so.

…
com.sun.j2me.pim.PIMProxy$Item@751fe84
com.sun.j2me.pim.PIMProxy$Item@e243f63f
com.sun.j2me.pim.PIMProxy$Item@a4072de
com.sun.j2me.pim.PIMProxy$Item@ed4c5c91
…

I am new to java and j2me so any help is greatly appreciated. And I do have a copy of “JAVA in a Nutshell”.

Message was edited by: mikeutt