We have problem programming on Java ME for samsung phones. When we try to read contacts with PIM API (JSR 75).
Code example:
import javax.microedition.pim.Con
tact;
import javax.microedition.pim.Con
tactList;
import javax.microedition.pim.PIM
;
public class PimReader {
public Vector getPhoneBook() {
ContactList contactLists = null;
Enumeration contactEnums = null;
try {
contactLists = (ContactList)PIM.getInstan
ce().openP
IMList(PIM
.CONTACT_L
IST, PIM.READ_ONLY);
if (contactLists != null && contactLists.isSupportedFi
eld(Contac
t.TEL)) {
contactEnums = contactLists.items();
}
} catch (Exception e) {
System.err.println("Except
ion in PIMReader " + e);
return null;
}
--------------------------
--------
Then contactEnums is not null but it's empty. contactEnums.hasMoreElemen
ts() returns false on first call. On another phones this code works properly. Can we fixed this problem or get contacts another way? Thank you.
Start Free Trial