Handling data from external Bluetooth device with GPS NMEA strings

Solata

We have external Bluetooth device, that delivers different type of data to android device. Among others it delivers also GPS NMEA string. GPS NMEA data should be used to update android system GPS module. And other data will be parsed in our application.

How is this possible to achieve?

ATM: I parse all data from external device, but android GPS module does not receive NMEA strings. GPS must be handled by android system GPS module to update navigation software. This software uses just android GPS data, it does not support functions to pump in data from other applications.

Solata

Solution: I used mock locations. At the moment it is not possible to avoid GPS NMEA string parsing.

Code:

String mocLocationProvider = LocationManager.GPS_PROVIDER;
mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
mLocationManager.addTestProvider(mocLocationProvider, false, false, false, false, true, true, false, Criteria.POWER_LOW, Criteria.ACCURACY_HIGH);
mLocationManager.setTestProviderEnabled(mocLocationProvider, true);
mLocationManager.setTestProviderStatus(mocLocationProvider, LocationProvider.AVAILABLE, null, System.currentTimeMillis());

//update location
Location mCurrentLocation = new Location(mocLocationProvider);
                           mCurrentLocation.setLatitude(mGPSCurrLat);
                           mCurrentLocation.setLongitude(mGPSCurrLon);
                           mCurrentLocation.setAccuracy(1);
                           mCurrentLocation.setTime(mGPSCurrTimeUTC); //long getTime() from UTC string
                           mCurrentLocation.setElapsedRealtimeNanos(SystemClock.elapsedRealtimeNanos());

mLocationManager.setTestProviderLocation(mocLocationProvider, mCurrentLocation);

Note: Enable "Allow mock locations" in android settings!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

RFduino not pulling NMEA strings from GPS

From Dev

External NMEA GPS to Apple's CLLocation manager

From Dev

How to get gps nmea data from Teltonika FM1100 after receiving imei code in C#

From Dev

Android External GPS device receiver

From Dev

Get Data from Bluetooth device in C#

From Dev

Process the data received from bluetooth on android device

From Dev

How to calculate gps accuracy in meters from nmea sentence information

From Dev

gps device data receiving and interpreting it

From Dev

How to receive data from bluetooth device using VB.NET

From Dev

How to receive data from bluetooth device using VB.NET

From Dev

Data receiving from Bluetooth Low Energy device in android is very slow

From Dev

Writing >20 bytes to an external Bluetooth device in iOS

From Dev

Android GPS : How can I get satellites number in use from NMEA?

From Dev

Emulate a Bluetooth Device from PC

From Dev

Decode GPS NMEA code using arduino

From Dev

How do I get the data from a serial GPS connected to my android device?

From Dev

Using binary data (strings in utf-8) from external file

From Dev

Handling redirection from an external server

From Dev

How to build Android Bluetooth server app handling data sent from Raspberry Pi using pybluez

From Dev

Sending data from ios device to windows pc over an Bluetooth HID dongle

From Dev

Is it possible to send data from iPhone App to BT 2.0 & non MFI compliant device via Bluetooth?

From Dev

Bluetooth LE Device scan in background from iOS

From Dev

bluetooth - UUID from peripheral device is a normal String

From Dev

How to unpair bluetooth device from the command line

From Dev

Is it possible to remote android phone from a Bluetooth device?

From Dev

Extract GPS data from photo

From Dev

Read data from GPS Uart

From Dev

Catching all inputs from external (bluetooth) keyboard

From Dev

Read from an external bluetooth keyboard without UITextField

Related Related

  1. 1

    RFduino not pulling NMEA strings from GPS

  2. 2

    External NMEA GPS to Apple's CLLocation manager

  3. 3

    How to get gps nmea data from Teltonika FM1100 after receiving imei code in C#

  4. 4

    Android External GPS device receiver

  5. 5

    Get Data from Bluetooth device in C#

  6. 6

    Process the data received from bluetooth on android device

  7. 7

    How to calculate gps accuracy in meters from nmea sentence information

  8. 8

    gps device data receiving and interpreting it

  9. 9

    How to receive data from bluetooth device using VB.NET

  10. 10

    How to receive data from bluetooth device using VB.NET

  11. 11

    Data receiving from Bluetooth Low Energy device in android is very slow

  12. 12

    Writing >20 bytes to an external Bluetooth device in iOS

  13. 13

    Android GPS : How can I get satellites number in use from NMEA?

  14. 14

    Emulate a Bluetooth Device from PC

  15. 15

    Decode GPS NMEA code using arduino

  16. 16

    How do I get the data from a serial GPS connected to my android device?

  17. 17

    Using binary data (strings in utf-8) from external file

  18. 18

    Handling redirection from an external server

  19. 19

    How to build Android Bluetooth server app handling data sent from Raspberry Pi using pybluez

  20. 20

    Sending data from ios device to windows pc over an Bluetooth HID dongle

  21. 21

    Is it possible to send data from iPhone App to BT 2.0 & non MFI compliant device via Bluetooth?

  22. 22

    Bluetooth LE Device scan in background from iOS

  23. 23

    bluetooth - UUID from peripheral device is a normal String

  24. 24

    How to unpair bluetooth device from the command line

  25. 25

    Is it possible to remote android phone from a Bluetooth device?

  26. 26

    Extract GPS data from photo

  27. 27

    Read data from GPS Uart

  28. 28

    Catching all inputs from external (bluetooth) keyboard

  29. 29

    Read from an external bluetooth keyboard without UITextField

HotTag

Archive