"Application Error" While running application in real device

HI all, When i run application on real device( Nokia 7360), It gives me Application ErrorMy application is running well in wireless toolkit Emulator..I dont know why this is happining on real device?...regardsPravin
[257 byte] By [pravin_bluebirda] at [2007-10-3 10:16:43]
# 1
give some details or code
sailesh_dita at 2007-7-15 5:37:35 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

Here is the code

It just create a new contact in the AddressBook

and i use Nokia 7360 for running my application

import javax.microedition.midlet.*;

import javax.microedition.lcdui.*;

import javax.microedition.pim.*;

import java.util.Enumeration;

public class AddContact extends MIDlet implements CommandListener,Runnable

{

Form form;

Display display;

Command exit;

Command add;

Alert alert;

public Thread th;

private boolean quit = false;

public AddContact()

{

display = Display.getDisplay(this);

form = new Form("Add Contact");

exit = new Command("Exit",Command.EXIT,1);

add = new Command("Add Contact",Command.OK,1);

alert = new Alert("Add Contact","Contact Added Succesfully",null,null);

alert.setTimeout(Alert.FOREVER);

form.addCommand(add);

form.addCommand(exit);

form.setCommandListener(this);

}

public void startApp()

{

display.setCurrent(form);

th = new Thread(this);

}

public void pauseApp()

{

}

public void destroyApp(boolean unconditional)

{

}

public void commandAction(Command c, Displayable d) {

if(c==exit)

{

destroyApp(false);

notifyDestroyed();

}

else if (c == add)

{

if(!quit)

{

th.start();

display.setCurrent(alert);

}

}

}

public void quit()

{

quit = true;

}

public void run()

{

while (!quit)

{

try

{

PIM pim = PIM.getInstance();

ContactList cl = null;

Contact new_contact = null;

Enumeration read_contact = null;

String final_no="";

try

{

cl = (ContactList)pim.openPIMList(PIM.CONTACT_LIST,PIM.READ_WRITE);

}

catch(PIMException pime)

{

Alert alert_1 = new Alert("Error","Error Accessing Database"+pime,null,null);

alert_1.setTimeout(Alert.FOREVER);

alert_1.setType(AlertType.ERROR);

display.setCurrent(alert_1);

}

catch(SecurityException se)

{

Alert alert_2 = new Alert("Error","Security Error"+se,null,null);

alert_2.setTimeout(Alert.FOREVER);

alert_2.setType(AlertType.ERROR);

display.setCurrent(alert_2);

}

new_contact = cl.createContact();

new_contact.addString(Contact.TEL,Contact.ATTR_HOME,"123456");

new_contact.addString(Contact.FORMATTED_NAME,Contact.ATTR_NONE,"AasdD");

new_contact.addString(Contact.TEL,Contact.ATTR_MOBILE,"2634465");

new_contact.addString(Contact.TEL,Contact.ATTR_FAX,"+91 7834465");

new_contact.addString(Contact.TEL,Contact.ATTR_PAGER,"7034465");

new_contact.addString(Contact.TEL,Contact.ATTR_MOBILE,"9234465");

try

{

new_contact.commit();

}

catch(PIMException piem)

{

Alert alert_4 = new Alert("Error","Error while saving Data"+piem,null,null);

alert_4.setTimeout(Alert.FOREVER);

alert_4.setType(AlertType.ERROR);

display.setCurrent(alert_4);

}

try

{

cl.close();

}

catch(PIMException piem)

{

Alert alert_5 = new Alert("Error","Error Closing Application"+piem,null,null);

alert_5.setTimeout(Alert.FOREVER);

alert_5.setType(AlertType.ERROR);

display.setCurrent(alert_5);

}

}

catch (Exception e)

{

Alert alert_4 = new Alert("Error","Error on first try"+e,null,null);

alert_4.setTimeout(Alert.FOREVER);

alert_4.setType(AlertType.ERROR);

display.setCurrent(alert_4);

}

quit();

}

}

}

pravin_bluebirda at 2007-7-15 5:37:35 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3
waiting for some ones reply
pravin_bluebirda at 2007-7-15 5:37:35 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4
Did you set the PIM API permissions in your JAD file?
Ashish_Javaa at 2007-7-15 5:37:35 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5
HI Ashish,I have set the permissionjavax.microedition.pim.ContactList.readjavax.microedition.pim.ContactList.writeis it ok or any other things still missing?...and what about my code ?...any change needed?...regards Pravin
pravin_bluebirda at 2007-7-15 5:37:35 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 6
Have you able to add contacts? if notit can be permission problems all the signing stuff u needand show ur alert after contact added i.e lastly in run of addcontact
sailesh_dita at 2007-7-15 5:37:35 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 7

HI ,

I set all permission,but i can not able to add and edit .

i also check the midlet access option and i set it to add edit user data

So that it allows me to add and edit data.

but my problem is because of

http://forum.nokia.com/Technical_Library/FNTL/General_phone_number_cannot_be_accessed_by_using_PIM_API_JSR-75.htm

I am testing on Nokia 7360...which contains General numbers...

so that i can not able to use

countValues(Contact.TEL) to count total TEL numbers

because it gives error due to the bug i mention earlier......

and i also want to know about signing midlet...

i just know about Sign Midlet Option in WTK emulator.

Can i sign midlet from WTK emulator or is there anything i have to do from my mobile..

regards

Pravin

pravin_bluebirda at 2007-7-15 5:37:35 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 8
signing is long typical processbased on your mobile model you need certificatejust search this forumall the best
sailesh_dita at 2007-7-15 5:37:35 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 9
Hi,I just want to know that using PIM API can we edit the numbers already stored by user or only that numbers which are added using PIM API Application.......regards
pravin_bluebirda at 2007-7-15 5:37:35 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 10
I think you can edit you need thave signed midlet for acessing any restricted api
sailesh_dita at 2007-7-15 5:37:35 > top of Java-index,Java Mobility Forums,Java ME Technologies...