×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    3

    USB with Symbian 5th Edition

    Hello!

    I'm trying to use USB with J2ME on my Nokia 5230 phone. I tried to run this example on my phone, but it gives me following error message: "FAILED withclass java.io.IOException:SymbianOS error = -46 : General: Unable to execute file for security reasons.". The Connectivity-property of the application's settings is set to Always allowed. What's wrong?

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: USB with Symbian 5th Edition

    Hi,

    -46 means in Symbian you don't have enough capabilities to use the API, Have you tried to check related issues with your midlet?

  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    3

    Re: USB with Symbian 5th Edition

    Quote Originally Posted by mahbub_s60 View Post
    Hi,

    -46 means in Symbian you don't have enough capabilities to use the API, Have you tried to check related issues with your midlet?
    Sorry, I'm not very good with speaking English, can you explain what you mean by checking related issues? However, thanks for answering

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: USB with Symbian 5th Edition

    Hi bdusz,

    The issue here is that the COM port that the application writes to and reads from is hard coded. You get this error because your device is connected to a different port than the one the application expects. The application listens always to COM0, while the virtual COM number assigned to the device when you connect it with your PC changes dynamically by the OS. On top of that, the virtual COM number is used by the HyperTerminal, while the midlet should use the name of the physical port, i.e. "USB1" or "USB2" etc depending on how many USB ports your PC has.

    I could make it work on Windows 7 when I followed these steps:

    1. I found the virtual COM number assigned to the Device by clicking start>right click Computer>Properties>Device Manager>expand the "Ports (COM & LPT)" option.

    2. In HyperTerminal, I created a new connection and selected "Connect using:" and the virtual COM number I found in the previous step.

    3. I found this line in the midlet:

    Code:
    comm = (CommConnection)Connector.open("comm:com0");
    and changed it with this one:

    Code:
    comm = (CommConnection)Connector.open("comm:USB1");
    In you case, try also USB2, USB3 etc. (depends on how many USB ports you have)

    4. Compiled again and run.

    It would be wise not to hard code the port number and let the user of the midlet define the port by using some UI element.
    Last edited by skalogir; 2011-11-23 at 09:32.

  5. #5
    Registered User
    Join Date
    Nov 2011
    Posts
    3

    Re: USB with Symbian 5th Edition

    Hi skalogir!

    Thanks very much for testing and answering! I will test that when I have time

Similar Threads

  1. does a nokia symbian 5th edition and symbian^3 support .sis files??
    By batousai15 in forum General Development Questions
    Replies: 3
    Last Post: 2011-04-12, 15:52
  2. Replies: 0
    Last Post: 2009-10-03, 19:32
  3. Replies: 2
    Last Post: 2009-07-07, 09:13
  4. Replies: 8
    Last Post: 2009-01-07, 05:11
  5. Replies: 1
    Last Post: 2007-09-21, 07:58

Posting Permissions

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