You Are Here:

Community: Developer Discussion Boards

#1 Old 6230 and JSR 82 problem - 2004-11-02, 11:31

Join Date: Aug 2003
Posts: 37
Robert111
Offline
Registered User
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???
Reply With Quote

#2 Old 2004-11-03, 10:28

Join Date: Nov 2004
Posts: 2
ajithsr
Offline
Registered User
Hello,

Nokia 6230 does not have JSR-82 support.

Whereas Nokia 6600 does have the support.

Hence the case.


regards,
Ajith
Reply With Quote

#3 Old 2004-11-04, 12:17

Join Date: Mar 2003
Posts: 1,200
seppo_fn's Avatar
seppo_fn
Offline
Forum Nokia Expert
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
Reply With Quote

#4 Old 2004-11-05, 13:03

Join Date: Aug 2003
Posts: 37
Robert111
Offline
Registered User
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...
Reply With Quote

#5 Old 2004-11-06, 12:16

Join Date: Nov 2004
Posts: 1
deyan
Offline
Registered User
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.
Reply With Quote

#6 Old 2004-11-09, 10:08

Join Date: Aug 2003
Posts: 37
Robert111
Offline
Registered User
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.)
Reply With Quote

#7 Old 2004-11-15, 17:08

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

Do this and then run your Midlet.


Andy
Reply With Quote

#8 Old Re: 6230 and JSR 82 problem - 2006-04-20, 17:50

Join Date: Feb 2006
Posts: 1
b0mBaS^666^
Offline
Registered User
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
Reply With Quote

#9 Old Re: 6230 and JSR 82 problem - 2006-04-28, 21:32

Join Date: Dec 2005
Posts: 1,159
Location: England,UK
jimgilmour1's Avatar
jimgilmour1
Offline
Forum Nokia Champion
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
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia