Log in

View Full Version : iPAQ - bluetooth very simple app - what's wrong?


steensh
06-22-2006, 08:42 PM
Hello,

I'm a beginner in developing midp2.0 apps. I want to make very simple midp2.0 application for iPAQ. I'm using CrEme VM + Avetana. What I've already done?

1. Install CrEme 4.1 on my iPAQ hx4700 (path: \Windows\CrEme).
2. Place avetanaBluetooth.jar in \Windows\CrEme\lib
3. Download BtSdkCE30.dll and BtCoreIf.dll (Avetana site) and place them in the \Windows directory (on iPAQ of course).
4. Make BluetoothMidlet.jar in NetBeans and copy it to \gps.
5. Make lnk file: 255#\Windows\CrEme\bin\CrEme.exe -Of -mv -classpath '\gps\BluetoothMidlet.jar' BluetoothMidlet

6. When run midlet CrEme returns:

NSIcom Ltd., CrEme(tm) Evaluation Version
CrE-ME J2ME(tm)
CrE-ME V4.10 B097.100206 10-February-2006
MemoryLimit=11034Kb
EBCI(TM) Interpreter V1.00,
Copyright 1998-2002 by Bytecodes, Inc.
trying to load JAD data from: /META-INF/MANIFEST.MF
No MIDlet specified, trying property
avetanaBluetooth version 1.3.9
UnsatisfiedLinkError:hciOpenDevice
java.lang.UnsatisfiedLinkError: hciOpenDevice
at de.avetana.bluetooth.stack.AvetanaBTStack.<init>()
at de.avetana.bluetooth.stack.AvetanaBTStack.<init>()
at de.avetana.bluetooth.stack.BluetoothStack.getBluetoothStack()
at javax.bluetooth.LocalDevice.<init>()
at javax.bluetooth.LocalDevice.getLocalDevice()
at BluetoothMidlet.startApp()
at javax.microedition.midlet.ApplicationManager.start()
at org.me4se.MIDletRunner.main()



And where is the error? What I'm doing wrong?
Please help me with this, it's very important. Thanks.

PS.
How run the same app in J9 VM? How lnk files looks like? I've tried in different ways, but no succes.




MIDLET LISTING:

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.bluetooth.*;

public class BluetoothMidlet extends MIDlet implements CommandListener {

private Display display;
private Command exit;
LocalDevice local;
Alert a;

public BluetoothMidlet() {

display = Display.getDisplay(this);
exit = new Command("Exit",Command.EXIT, 0);
a = new Alert("Local Device");
a.addCommand(exit);
a.setCommandListener(this);
}

public void startApp() {

try {
// Retrieve the local Bluetooth device object
local = LocalDevice.getLocalDevice();

// Retrieve the Bluetooth address of the local device
String address = local.getBluetoothAddress();

// Retrieve the name of the local Bluetooth device
String name = local.getFriendlyName();
System.out.println(address + name);

a.setString("Address is"+address+" Name is "+name);
display.setCurrent(a);

} catch(Exception e) {
e.printStackTrace();
}
}

public void pauseApp() {}

public void destroyApp(boolean unconditional) {}

public void commandAction(Command c,Displayable d) {

if(c == exit) {
notifyDestroyed();
destroyApp(true);
}

}
}

Menneisyys
06-24-2006, 01:18 PM
How run the same app in J9 VM? How lnk files looks like? I've tried in different ways, but no succes.


Read my J9-related articles (use the forum search engine). For example, the one at http://www.pocketpcthoughts.com/forums/viewtopic.php?t=48558