views:

387

answers:

1

I'm developing a j2me application for my mobile phone (a Nokia). I'm using WTK (Wireless Toolkit) to test my code. Because I'm using a GPS device via a Bluetooth connection, I would like to be able to extend the emulator with bluetooth possibilities. Has anyone experience with BT & WTK?

according to this article there is no way to do it by default. Any other ideas?

+1  A: 

The emulators "emulate" bluetooth, by allowing you to make a connection between running emulators using the bluetooth API.

I've never tried to convince an emulator to use actual bluetooth on a PC (however I suspect it may be just possible on the Sony Ericsson emulator using some hacking of where the Bluetooth API points to, would be a lot of work though).

Easier approach: if you're emulating a bluetooth GPS, write a MIDlet which acts as a Bluetooth serial server, and preload it with a bunch of NMEA data from your GPS unit. Get the MIDlet spitting that out continuously on a loop.

Run that MIDlet, then get your real app to connect to that MIDlet (using emulated bluetooth) and consume the NMEA data as if it were coming from a real GPS -- bingo!

HTH

funkybro