×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    43

    Thumbs up Application Error While running application in real device

    HI all,
    When i run application on real device( Nokia 7360), It gives me Application Error

    My application is running fine in wireless toolkit Emulator..

    I dont know why this is happining on real device?...

    regards
    Pravin

  2. #2
    Regular Contributor
    Join Date
    Aug 2006
    Location
    Rawalpindi, Pakistan
    Posts
    486

    Re: Application Error While running application in real device

    Well There are many differences bewteen a real device and emulator. first make sure u have the correct version of CLDC and MIDP i mean if ur using CLDC 1.1 and MIDP 2.0 then make sure ur mobile supports it as well.
    Regards
    Nouman

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    43

    Re: Application Error While running application in real device

    HI,
    I have already check the version of CLDC and MIDP....

    I use Nokia 7360 and it supports CLDC 1.1 MIDP 2.0 .
    And i have created my application with CLDC 1.1 and MIDP 2.0 .

    Well my application is related to Contact Book Updation..

    I also check for the PIM support and Nokia 7360 also support PIM 1.0 as well..

    Now Do you have any other solution for this?...


    regards Pravin

  4. #4
    Regular Contributor
    Join Date
    Jun 2004
    Posts
    60

    Re: Application Error While running application in real device

    It must be something ur initalizing at startup, try commenting out some things, if it then works, work backwards to find what is causing it. Otherwise post the MIDlet class and someone might finds something
    Ian Strain

    J2ME Developer

  5. #5
    Registered User
    Join Date
    Nov 2006
    Posts
    43

    Re: Application Error While running application in real device

    Code:
    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("Check PIM support");
    	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();
    		}
    	}
    }

    This application is simply add new contact in AddressBook.....

    Is there any problem with code....


    I am waititng for reply


    wth regards
    Pravin

Similar Threads

  1. Why my application doesn't run when some application running in
    By bb_sathya in forum Mobile Java General
    Replies: 1
    Last Post: 2005-12-03, 15:30
  2. Bluetooth Security: What exactly is an untrusted device?
    By rahulmcs in forum Bluetooth Technology
    Replies: 1
    Last Post: 2005-12-02, 06:26
  3. Connect emulated device via Bluetooth to a real device
    By ulimativ in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-06-17, 17:54
  4. HTTP Connection problem with real series 40 device
    By pagadi in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2004-06-17, 09:28
  5. Replies: 1
    Last Post: 2003-03-14, 06:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×