|
|
| How to develop Bluetooth App using SUN WTK and Nokia SDK |
|
Update: March 8, 2003
Author: Ben Hui
If you are planning to develop Java Bluetooth applications using freely available tools, this tutorial is for you. All you need is SUN J2ME Wireless Toolkit, Nokia Series60 MIDP SDK, and our BlueChat example applications (full source code available). After reading this tutorial, you are able to setup your system to compile Java bluetooth application and run it under emulator. Let's get some Bluetooth actions going...
Requirements
You need install SUN J2ME Wireless ToolKit 2.1 and Nokia Series 60 MIDP Concept SDK Beta 0.3.1.
The following tutorial is tested under Windows XP. It should work on other platforms as well.
Downloads
You need to download a specially compiled version of MIDP API that includes Java Bluetooth API (JSR-82).
- midpapi20.jsr82.jar : Download this file if you are developing Bluetooth applications for MIDP 2.0 phones.
- midpapi10.jar82.jar: Download this file if you are developing Bluetooth application for MIDP 1.0 phones.
- BlueChat.zip: You also need to download our BlueChat example applications. [read more]
Tutorial
- Install SUN WTK 2.1 and Nokia Series 60 MIDP SDK that you downloaded from above links. It is recommended to install them on default location (i.e. C:\WTK2.1 and C:\Nokia).
- Go to C:\WTK21\lib, backup the original midp jar files by renaming the file extension and replace them with the one you downloaded above.
- For MIDP 1.0, rename midpapi10.jar to midpapi10.jar.no.bluetooth. Then copy midpapi10.jar82.jar to C:\WTK21\lib and rename it to midpapi10.jar
- For MIDP 2.0, rename midpapi20.jar to midpapi20.jar.no.bluetooth. Then copy midpapi20.jar82.jar to C:\WTK21\lib and rename it to midpapi20.jar
- Extract BlueChat.zip to C:\WTK21\apps directory. This will create a BlueChat application project under WTK.
- Lunch WTK KToolbar application and load BlueChat project. Click [Open Project]. Select BlueChat project.
- Build the project by clicking [Build] button. It should compile without any errors. Do not try to Run the project in KToolbar. It will not run because WTK doesn't have Bluetooth implementation.
- Package the jar file by select Project menu -> Package -> Create Package.
- Now Run the project using Nokia MIDP SDK. Lunch a command prompt. Enter the following command (in 1 line) and hit Enter key.
C:\Nokia\Devices\Series_60_MIDP_Concept_SDK_Beta_0_3_Nokia_edition\bin\emulator.exe
-Xdevice:Series_60_MIDP_Concept_SDK_Beta_0_3_Nokia_edition
-Xdescriptor:"C:\WTK21\apps\BlueChat\bin\BlueChat.jad"
- You should able to run BlueChat under the Nokia Emulator. For usage information about BlueChat, please read our BlueChat page here.
- You can also deploy the compiled BlueChat JAR file to a read Nokia 6600 phone (Or Sony Ericsson P900). The packaged JAR file is located at C:\WTK21\apps\BlueChat\bin\BlueChat.jar
-
Feedback
We welcome your feedback that helps us to provide better tutorial. Or need support on this tool? Email us here.
|
|
|
|
|
|
Benhui.net news
|
| Feb 14, 2004 - New downloads from our Bluetooth section. BlueChat example application with full source code. Learn more! Bluetooth more! [more] |
| Feb 14, 2004 - Found out what SonyEricsson P900 has to offer for J2ME developers. Review our P900 developer review. [more] |
| Feb 14, 2004 - Check out Ben's latest Java Bluetooth development article at JDJ Feb issue. Get it off the shelf while it last. [more] |
| Dec 15, 2003 - Our Bluetooth section open! Check out our Bluetooth Browser, Code gallery, and tons of links. [more] |
| Nov 08, 2003 - Join us to chat with Michael Yuan. Learn more about Enterprise J2ME. [more] |
| Nov 08, 2003 - 35 more links added to our popular J2ME Master Links [more] |
| Nov 08, 2003 - MIDP 2.0 phone list is updated to include the latest and greatest phones. And with links, too! Check it out. [more] |
| Sept 21, 2003 - Add MIDP 2.0 phone list section. [more] |
| Aug 28, 2003 - Spy your mobile device even more with our Mobile Speed tool. [more] |
| Aug 22, 2003 - Spy your mobile device with our new Mobile Echo tool. [more] |
| Aug 22, 2003 - A new forum section is added to our links database. Questions? Dunno where to start? Start from here! |
| Aug 22, 2003 - Another 20 links added to our database. You have links to suggest? email us! |
|
Aug 01, 2003 - the new benhui.net goes live! Fully updated with lots of J2ME links, UML diagrams, and special features.
|
| Aug 01, 2003 - check out our latest featured phone - Nokia 3650 [more] |
|