Can you access sim contacts from J2ME?

2.3k views Asked by At

Hi I am developing a mobile application where I need to access the phonebook of the users, SIM and phone contacts.

Is this possible?

3

There are 3 answers

0
bharath On

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.

0
chiranjib On

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

  1. http://developers.sun.com/mobility/apis/articles/pim/index.html
  2. 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.

0
funkybro On

Depends on the handset, some only let you access phone contacts, some do both phone and sim. Make sure you iterate over all the PIMLists supplied by PIM.listPIMLists(), often this method returns two lists, one of which will be phone, the other will be sim.