×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    2

    Unhappy J2ME Bluetooth Application doesn't work on N95

    Hello

    I'm new in this forum, because my english is not very good.
    But nobody could help me, and so i hope you have a solution for my problem.

    I develop a J2SDK Applcation that's a bluetooth Server (Running on PC),
    and a J2ME Application that's a bluetooth client (Running on Mobile Phone).

    It works on the Sun WTK Emulator and on W800i (Sony Erricson).
    But when i try it on "Nokia N95 8GB" it doesn't work.

    Here is my coding
    Server
    Code:
          try { 
             
             LocalDevice dev = LocalDevice.getLocalDevice(); 
             dev.setDiscoverable(DiscoveryAgent.GIAC); 
    
             StreamConnectionNotifier scn = (StreamConnectionNotifier) Connector 
                   .open("btspp://localhost:86b4b249fb8844d6a756ec265dd1f6a3;authorize=false;master=true"); 
             
             
             ServiceRecord rec = dev.getRecord(scn); 
             DataElement fullyAvailable = new DataElement(DataElement.U_INT_1, 
                   0xFF); 
             
             rec.setAttributeValue(0X0008, fullyAvailable); 
             
             dev.updateRecord(rec); 
             
             StreamConnection con = scn.acceptAndOpen(); 
    
          } catch (BluetoothStateException e) { 
             // TODO Auto-generated catch block 
             e.printStackTrace(); 
          } catch (IOException e) { 
             // TODO Auto-generated catch block 
             e.printStackTrace(); 
          }

    Client (That should run on N95)
    Code:
          try{ 
             LocalDevice local = LocalDevice.getLocalDevice(); 
             DiscoveryAgent agent = local.getDiscoveryAgent(); 
                      
             String connString = agent.selectService(new UUID("86b4b249fb8844d6a756ec265dd1f6a3",false), ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false); 
             
              
             StreamConnection con = (StreamConnection)Connector.open(connString); 
             if (connString != null) 
                list.addItem("OK"); 
             else 
                list.addItem("Not Okay"); 
           
          }catch (Exception e){ 
             e.printStackTrace(); 
             box.setText(e.toString()); 
             list.addItem(e.toString()); 
             list.addItem("Fehler"); 
              
          }
    I can start the J2ME Application on N95 but when the code for bluetooth is running, i got an
    "java.lang.IllegalArgumentException: Null URL


    I don't understand on the Emulator and W800i too, it come's a security dialog, that says, that the application want to open a bluetooth client connection, and i can say "Yes".

    But on Nokia N95 this "Security Dialog" doesn't come. it only comes the exception after some seconds...

    Do i have to sign the *.jar file?

    Regards and Thank you very much!!
    Stefan

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

Similar Threads

  1. N95 and N80 can't call when a J2ME application is in background
    By manupeco in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2007-06-21, 08:31
  2. How can the WAP browser communicate to J2ME application?
    By hbfornies in forum Mobile Java General
    Replies: 20
    Last Post: 2007-03-02, 16:32
  3. Need a J2ME Bluetooth sample application
    By mpls2000 in forum Mobile Java General
    Replies: 3
    Last Post: 2006-04-25, 18:00
  4. The Truth About The 6310i and Bluetooth
    By seppo_fn in forum Bluetooth Technology
    Replies: 6
    Last Post: 2004-02-28, 17:31
  5. Replies: 5
    Last Post: 2003-02-07, 11:25

Posting Permissions

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