×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    8

    My application run perfectly on Emulator but can't run on mobile device (Socket)

    I have develope the application using http and socket connection.
    It work perfectly on many emulator
    but when I install my application to Nokia 6681 There are some problem.

    First, it can perfectly show my user interface. that is very good even there are some adjustment that i have to fixed but not so serious.

    The seriously problem is when it try to conncet to socket server, the phone automatic restart itself.
    I think there are some problem in this step because when I comment this step it work perfectly again

    The code of socket connection are provide below

    Please help me to find the solution. In advance, I would like to say thank you very much for your attention.

    ChatchawanS@seamico.co.th

    --------------------------------------------------------------

    public void createConnection() {
    String endPoint = SystemConfig.ENDPOINT_IP + ":" + SystemConfig.ENDPOINT_PORT;
    //System.out.println("xxx " + endPoint);
    try {
    //System.out.println("Create Connection");
    sc = (SocketConnection) Connector.open(endPoint);
    //sc = (SocketConnection) Connector.open("socket://192.9.200.25:4321");
    is = sc.openInputStream();
    os = sc.openOutputStream();
    System.out.println("Finish");
    }
    catch(ConnectionNotFoundException cnfe)
    {
    System.out.println("Error connection not found");
    }
    catch (Exception e) {
    System.out.println("Error here");
    e.printStackTrace();
    }

    }

    -------------------------------------------------------------------------

  2. #2
    Regular Contributor
    Join Date
    Oct 2005
    Posts
    83

    Re: My application run perfectly on Emulator but can't run on mobile device (Socket)

    Is it a signed MIDlet? Is so, have you requested socket permissions in the JAD and manifest files? Is it possible that an exception is being thrown and your phone can't handle the print statements? If you do not have the correct permissions, connecting to a socket will throw an exception.
    John

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    8

    Re: My application run perfectly on Emulator but can't run on mobile device (Socket)

    Quote Originally Posted by johnbutler
    Is it a signed MIDlet? Is so, have you requested socket permissions in the JAD and manifest files? Is it possible that an exception is being thrown and your phone can't handle the print statements? If you do not have the correct permissions, connecting to a socket will throw an exception.
    John
    Dear JohnButler
    I try to add the following permission to my application but it still not work for a real mobile device.
    javax.microedition.io.Connector.socket
    javax.microedition.io.Connector.http
    javax.microedition.io.Connector.serversocket
    javax.microedition.io.Connector.datagramreceiver

    Do you have any suggestion.

    I use WTK22 as a compiler. And Series 60 (Nokia 6681) as a device for this application

    Thank you in advance

  4. #4
    Regular Contributor
    Join Date
    Oct 2005
    Posts
    83

    Re: My application run perfectly on Emulator but can't run on mobile device (Socket)

    I would suggest changing your code to display an alert in your catch blocks rather than outputting to std out. I don't know how phones handle the std out. This way you will see if you are getting an exception on the device.

  5. #5
    Registered User
    Join Date
    Sep 2005
    Posts
    8

    Unhappy Re: My application run perfectly on Emulator but can't run on mobile device (Socket)

    I am already remove all system.out function from my application but it still not work for my mobile

    Do you have any suggestion. Thank you in advance

  6. #6
    Registered User
    Join Date
    Oct 2005
    Posts
    16

    Re: My application run perfectly on Emulator but can't run on mobile device (Socket)

    Quote Originally Posted by x1054
    I am already remove all system.out function from my application but it still not work for my mobile

    Do you have any suggestion. Thank you in advance
    I've come to the conclusion that the 668x just plain doesn't support socket connections; see this thread:

    http://discussion.forum.nokia.com/fo...ad.php?t=68306

    Even with a signed application, a securityexception is thrown whenever Connector.open("socket://...") is called. UDP and HTTP work fine, however.

Similar Threads

  1. Application works on device, but not emulator
    By vodkaloon in forum Symbian
    Replies: 0
    Last Post: 2005-06-14, 11:15
  2. Replies: 0
    Last Post: 2005-05-28, 10:20
  3. Mobile Application
    By mathi77in in forum Mobile Java General
    Replies: 5
    Last Post: 2005-05-17, 13:40
  4. sonify.org to focus on mobile device audio
    By hp3 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-10-16, 16:39
  5. I cannot install application on my device.
    By ask_expert in forum Mobile Java General
    Replies: 1
    Last Post: 2002-06-18, 01:31

Posting Permissions

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