问题
Hi I am developing a mobile application where I need to access the phonebook of the users, SIM and phone contacts.
Is this possible?
回答1:
Depends on the handset, some only let you access phone contacts, some do both phone and sim. Make sure you iterate over all the PIMList
s supplied by PIM.listPIMLists()
, often this method returns two lists, one of which will be phone, the other will be sim.
回答2:
Yeah its possible. Look on this discussion on Nokia forum. Here it will be described clearly about how to get the contacts from phone and sim.
回答3:
You can access the contacts using the following API
JSR 75: PDA Optional Packages for the J2METM Platform
http://www.jcp.org/en/jsr/detail?id=75
This is an optional package & maynot be there for all the mobile devices.
You can check the following URL for the sample programs
- http://developers.sun.com/mobility/apis/articles/pim/index.html
- http://www.java2s.com/Code/Java/J2ME/PersonalInformationManager.htm
Use the following code to check whether the device supports PIM or not :
String currentVersion = System.getProperty("microedition.pim.version" )
if the device is not supported then it will return null
.
来源:https://stackoverflow.com/questions/4955323/can-you-access-sim-contacts-from-j2me