Roy Oxlade

Mar 19, 2020
Hi all

The device is running Android Lolipop and my question regards accessing device hardware data from an application, this should be straightforward but initial information suggest otherwise. If the devices Bluetooth receiver is paired with a bluetooth transmitter then why would you not use this data directly in an application and instead use another program to " spoof your location" just to provide location services with mock locations so it can use the Bluetooth data provided?

This seems a long winded way of handling data and you risk the data being altered or some loss as it is passed through these other programs. In my case I have a Ublox GPS receiver that transmits location data as an NMEA stream using Bluetooth, now we have two approaches. Application A allows the user to select the data source, one being Bluetooth and this works with location services turned off which greatly helps battery life. Now Application B can only use Location services which means either using the devices internal GPS or going down the so called spoofing route to basically fool it as a get around.

My question is why would anyone develope an application and not use the bluetooth receiver directly? I have thought about this and can only conclude that it must be something to do with the Android OS but it can and has been done so why take the less efficient method? Is it such a complicated task that some developers just use location services to keep it simple.

When I used to program control systems in C we could include different libraries into our code and these provided added functionality, so if I needed a CAN interface or SPI the functionality was there but I don't believe Java uses because it is not processor specific.

thanks Roy