Security prompts and signing

Note that when unsigned MIDlets access the contacts database, the system asks the user whether or not to allow the MIDlet access. This permission is not stored in any way, so the system will ask for permission every time the MIDlet tries to access the database. This means that in the emulator, with two default contacts on the SIM card, there will be five queries when the application starts, and more if the search functionality is used:

  1. Once for PIM.getInstance().

  2. Once for PIM.listPIMLists().

  3. Once for PIM.openPIMList() on the SIM card contacts list.

  4. Once for Contact.getString() on the first contact.

  5. Once for Contact.getString() on the second contact.

Removing prompts from the emulator

When the emulator is running, open Tools from the emulator program menu. Go to the MIDP tab and check Disable user security prompts.

Removing prompts from the application on the phone

There are two ways around this: one option is to sign your MIDlet JAR, but it would be overkill for testing. A better solution for development and testing purposes is to find the installed JAR in the Applications list on the phone and open its menu (open Options menu in non-touch devices, tap and hold to open an item-specific popup menu in touch devices). In the menu open the Application settings submenu and select Application access. In the next screen select Data access, then Read user data, and set it to Ask first time. This way you will only have to answer the authorization question once. However, you will have to set this option again when you install a new version of the application.