I'm working on app, which uses GPS data. I have an external bluetooth GPS device, but I can't find how to use the external GPS Bluetooth module. I added the bluetooth permission into my AndroidManifest file, but I dont know how to continue...
Please help.
You should create a connection to the device as described in tutorial Peter pointed.
BluetoothDevice device
variable set to your device.Connect as client:
Retrieve information. You can now open an
InputStream
, from which NMEA messages come in plain text. So you can useBufferedReader
for convenience and read messages line by line. Something like this:REMEMBER: this code is very simplified. In real application every connection to network, device or filesystem resource should be closed when not needed, errors (Exceptions) properly handled and displayed to user in a readable and understandable format.
Android only supports Bluetooth RFCOMM (serial emulation) protocol. Make sure your GPS supports this protocol.
Then start with the provided bluetooth tutorial.