×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    2

    Bluetooth + GPS

    Hi All,

    I’m working on an application that works as follows:
    From a Nokia 6670 I connect using bluetooth to a GPS Receiver, I get the data and then I send it across the Internet to a server.

    The problem I’m having is that the phone connects once to the GPS Receiver, and the second time it throws an exception like:

    Exception: java.io.IOException
    SymbianOS error = -11:
    General: System Error


    My Connection funciton looks like this:

    Code:
    public void myFunct()
        {
            StreamConnection conn = null;
            InputStream is = null;
            
            try{
                conn = (StreamConnection)Connector.open(url);
                is = conn.openInputStream();
    
                int i = 0;
                char c;
                String s = "";
                
    
                // Start reading the data from the GPS
                
                do{
                    i = is.read(); // read one byte at the time.
                    c = (char)i;
                    s += c;
    
                }while(i != -1);         
    
                this.GPS.append(s, null);
                
                //  closing the connection
                conn.close();
                
            }catch(Exception e)
            {
                Alert alert = new Alert("Error");
                alert.setType(AlertType.ERROR);
                //soundAlert.setTimeout(20);
                alert.setString(e.toString());
                display.setCurrent(alert);
            }
        }
    Does anybody know how to solve this problem?
    Last edited by israel.martinez; 2005-10-25 at 16:49.

  2. #2
    Registered User
    Join Date
    Mar 2009
    Posts
    4

    Smile Re: java.io.IOException SymbianOS error = -11

    as you can see in here, -11 means "An object already exists. An object of some name/type is to be created, but an object of that name/type already exists." Haven't you create the same stream multiple time?
    I'm thinking This error is exists just in Symbian phones. I guess you can run this app on some other phones like SE-W810

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    4

    Talking Re: java.io.IOException SymbianOS error = -11

    The reason is this line:
    conn = (StreamConnection)Connector.open(url);
    don't open the same url twice. and also don't close conn. just close the stream. use the same conn for another stream. You can use a boolean value to open connector just one time

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Smile Re: java.io.IOException SymbianOS error = -11

    Hello,
    As you are aware that the above error code stand for this,
    An object already exists.
    An object of some name/type is to be created, but an object of that name/type already exists.
    That means your previously opened connection is still open and you are again trying to open the same connection.
    Better you make a method which disconnect the connection and make a call to this method just before you gonna create/open the new connection. Kindly try to implement this and have a look over if the underlined issues get resolved.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Re: java.io.IOException SymbianOS error = -11

    Always close the streams first before closing the connection.. Just check out and revert
    thanks,
    jitu_goldie..

    KEEP TRYING..

Similar Threads

  1. J2ME HTTP error trying to post from 7610-- SymbianOS error -18
    By louiethenose in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2007-12-04, 21:00
  2. The strange tale of the Bluetooth Game and the SymbianOS Error = -36
    By Phoenix_Dfire in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2005-06-27, 18:41
  3. java.io.IOException: SymbianOS error = -28 : System error
    By raghuraman in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2004-10-21, 09:33
  4. java.io.IOException in emulator
    By remonvv in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2004-08-03, 13:59
  5. SymbianOS Error = -36 on the 6600 version 4.09.1
    By ragochen in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2004-05-03, 16:17

Posting Permissions

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