×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Question NullPointerException while using JSR82

    Hello everybody,

    I am developing an application which uses JSR82. When I used a function Connector.open("btspp://00005CCC3DC3:1;name=PitchiServer;authorize=false"), its giving an exception like the below.

    java.lang.IllegalArgumentException: Malformed URL

    I searched from google that, this is because of having some spaces in the url. but there is no space in the url.

    can any one help me please

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    Why do you supply a name parameter? Where is that channel number 1 coming from? Are you sure your service is on channel 1? I guess you want to connect (from this mobile phone) to a remote service (on another device) called PitchiServer: Is that correct?

  3. #3
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Re: NullPointerException while using JSR82

    Hi traud,

    thankyou for replying quickly.

    actually, I just dont know url for bluetooth, what is the channel? I dont know them clearly.

    I just want to implement my own code.

    for that I did like that.

    can you please explain me clearly, so that I can able to execute it.

  4. #4
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: NullPointerException while using JSR82

    if u want to implement ur own code u might first try to figure out how to do it and most importantly : know what ur typing
    it actually has no use to randomly pick code from the net, insert it in ur own program without having a clue what ur doing and then wonder with amazement why it doesnt work...
    there are some very strange words in this world : research, documentation, google...
    try those out

  5. #5
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Re: NullPointerException while using JSR82

    Thanks for your reply Tiger79.

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    You should create your own personal UUID (on UNIX via uuidgen) rather than using a static reference to (RFComm) channel 1 (behind the colon). This channel number might change. If you want to start, try selectService and this UUID. In the next evolution of your MIDlet do a full service discovery. However, if you want to start just with a URL like above, make sure you know the correct (and current) channel number you want to connect to. I cannot be more precise here, as I do not know your remote device. Then you can use something like this: btspp://00005CCC3DC3:1

    By the way if you are new to J2ME, MIDlets and Bluetooth, I recommend to start with a book or tutorials rather than code examples as you will have to debug a lot on your own. There are a lot of bugs, tweaks and lessons to be learnt. Bluetooth is complicated. I do not have a good J2ME book at hand right now, however, start with the references of this one for JSR-82 (perhaps your library has its previous edition) or read at least the PDF coming with the specification. If you like to start with tutorials, continue here…

  7. #7
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Re: NullPointerException while using JSR82

    thank you very much traud for your valuable reply.

Similar Threads

  1. Using RecordStore.AUTHMODE_ANY throws NullPointerException
    By sgaber in forum Mobile Java General
    Replies: 10
    Last Post: 2007-12-18, 18:03
  2. recordcontrol.setStream(out) throws NullPointerException
    By bharatdevada in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2006-11-10, 01:16
  3. JSR82 missing for S40 SDK?
    By moamoa in forum Mobile Java General
    Replies: 1
    Last Post: 2006-06-28, 17:22
  4. bluetooth communication without jsr82 api
    By trakadasp in forum Symbian
    Replies: 0
    Last Post: 2006-01-30, 08:21
  5. Weird NullPointerException
    By baegsi in forum Mobile Java General
    Replies: 8
    Last Post: 2003-12-19, 11:12

Posting Permissions

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