×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    37

    6230 and JSR 82 problem

    Hello, I have big problem with my JAVA code on real 6230 phone. My code looks:

    LocalDevice localdevice = LocalDevice.getLocalDevice();
    discoveryAgent = localdevice.getDiscoveryAgent();

    Here I am getting NullPointerException and I can't use JSR 82 on this mobile.

    I have also real N6600 and on this mobile, everything is working perfectly.

    Can someone help me???

  2. #2
    Registered User
    Join Date
    Nov 2004
    Posts
    2
    Hello,

    Nokia 6230 does not have JSR-82 support.

    Whereas Nokia 6600 does have the support.

    Hence the case.


    regards,
    Ajith

  3. #3
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Posts
    1,212
    Nokia 6230 DOES support JSR-82. Have you looked at the existing Bluetooth examples?

    The following two documents both include a Java MIDP example:
    -Introduction to Developing Networked MIDlets using Bluetooth
    -Games over Bluetooth: Recommendations to Games Developers

    You can download these pakcages from the Bluetooth -> Documents section at Forum Nokia:
    http://www.forum.nokia.com/main/1,65...3_40,00.html#2

    Seppo
    Forum Nokia

  4. #4
    Registered User
    Join Date
    Aug 2003
    Posts
    37
    I looked there, I try to install the sample application - bluetooth chat on 6230, but it's the same as in my program - NullPointerException, on 6600 it's working well. I don't understand why...

  5. #5
    Registered User
    Join Date
    Nov 2004
    Posts
    1
    Nokia 6230 DOES support JSR-82
    (http://www.forum.nokia.com/main/0,,0...tml?model=6230)
    Maybe you have an old frimware version on your phone. I had similar problem with
    the bluetooth implemenrtation on old friware version.

  6. #6
    Registered User
    Join Date
    Aug 2003
    Posts
    37
    That's interesting, so I need to update firmware? I was looking to Nokia Website, but I didn't found any information, where to download the new firmware. On internet I found something, but I think, it's quite risky to install not official firmware, can you post, how to download and install the new firmware?
    (Maybe my question is stupid, but on Nokia site, I really found nothing.)

  7. #7
    Registered User
    Join Date
    Aug 2004
    Posts
    2
    I had this problem too. Easily solved by turning on Bluetooth (Menu->settings->connectivity->bluetooth).

    Do this and then run your Midlet.


    Andy

  8. #8
    Registered User
    Join Date
    Feb 2006
    Posts
    1

    Re: 6230 and JSR 82 problem

    I have the same problem, but i didn't test it with a 6600 because I haven't one. If you know what's the solution, please: bombas666@gmail.com

  9. #9
    Super Contributor
    Join Date
    Dec 2005
    Location
    England,UK
    Posts
    1,600

    Re: 6230 and JSR 82 problem

    This is my code and it works on a 6230i bought in 2005.

    -------------------------------------------------------
    // jsr082 API
    import javax.bluetooth.BluetoothStateException;
    import javax.bluetooth.DataElement;
    import javax.bluetooth.DeviceClass;
    import javax.bluetooth.DiscoveryAgent;
    import javax.bluetooth.DiscoveryListener;
    import javax.bluetooth.LocalDevice;
    import javax.bluetooth.RemoteDevice;
    import javax.bluetooth.ServiceRecord;
    import javax.bluetooth.UUID;

    LocalDevice local=null;
    DiscoveryAgent agent=null;
    Vector deviceVector = null;


    try {
    local = LocalDevice.getLocalDevice();

    }catch(BluetoothStateException bse) {

    a = new Alert("Bluetooth error","Bluetooth must be turned on");
    a.setTimeout(Alert.FOREVER);
    a.addCommand(exitCommand);
    a.setCommandListener(this);
    }
    try {

    agent = local.getDiscoveryAgent();
    }
    catch (Exception e) {
    a = new Alert(("Can't initialize bluetooth: " + e);
    a.setTimeout(Alert.FOREVER);
    a.addCommand(exitCommand);
    a.setCommandListener(this);

    }
    deviceVector = new Vector();

    RemoteDevice[] devices = agent.retrieveDevices(DiscoveryAgent.PREKNOWN);
    if (devices == null) {
    devices = agent.retrieveDevices(DiscoveryAgent.CACHED);

    }
    -----------------------------------------------------------

    The code to Display Alert is off topic.

    My main addition I found is exception trapping. Which seems to work.

    Are you 6230 with the 'i' in which case early bluetooth device need a firmware upgrade.
    Jim

Posting Permissions

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