I want to create an Android application which uses an external device's GPS coordinates (because the mobile devices have a less accurate GPS).
The device I am trying to run with is Trimble GPS Receiver Pro 6T
Any suggestions how I can get the data from this GPS device and get this data to the mobile device? I've tried searching for some libraries and guides but found nothing.
The usual way for your case is to use the NMEA format.
Each GPS reciever can be set to output in NMEA format via serial COM.
You parse the socket, line by line.
Searching for Nmea Parser will give you some src code.
Related
For an automotive project, we have two ECUs. One where Android Auto runs, and the other one gets GPS data (as NMEA sentences). We can send the data over Ethernet.
What are the steps to get the NMEA/GPS data we receive over the Ethernet port into the Android system?
Hello I am wanting to connect an external GPS unit via I2C or serial to a raspberry pi 3 running android things to have this GPS unit provide location data.
So far using the Rasbarian OS I have a working python script with custom libraries. The script outputs raw NMEA data.
I am wondering how would I need to run this script to be able to have Android Location services use this data for location services? Would I need to create an app using the location services API? Or since this is a locally installed device would I need to write firmware or some kind? I am just wondering if someone could point me in the right direction of what kind of software I would need to write (an app or driver or firmware) in order to have this NMEA data accessible for location services.
Example of GPS driver connected via serial port you can find in Android Things user-space GPS driver and how to use it you can find in UART GPS sample for Android Things. Also take a look at Official Documentation and examples like this.
Is it possible to test new sensors like humidity or temperature using Android emulator? Official one or any alternative one.
There is so little information on this on official website, even on Stackoverlow. I guess it's not possible, but I rather asked to be absolutely sure.
It is possible to fake some data, but you'll have to do some command-line foo!
In the emulator you could fake some temperature & humidity values you just have to connect to your emulator via telnet.
Connect to emulator. Open a terminal and type (5554 is the number of the first emulator):
telnet localhost 5554
list status of all sensors and see if temperature is enabled:
sensor status
Set some fake values (set whatever you want. Don't worry your emulator won't melt if you set crazy values):
sensor set temperature 1:2:3
Check the values that have been set as temperature:
sensor get temperature
==> you can change those settings at the same time your app is running in the emulator! so just set different temperature values and see what happens in your app. I didn't develop a temperature sensor app yet, but I know that telnet works great for faking geolocation data during testing my location based apps. I don't see any reason why it should not work for temperatures as well.
BTW: if you are getting lost in telnet you can always type help or help <command> to get some additional infos
Has anyone used the new Garmin GLO GPS receiver? Has anyone successfully integrated it with their mobile application? I was interested in using it in order to get more accurate GPS coordinates in my Android application, but would like to get some feedback from others before I buy one.
The Garmin website does not mention if there is an API available to retreive the GPS coordinates, it simply states, "Using Bluetooth technology, GLO wirelessly pairs to your mobile device. Just set GLO within range of your mobile device and in moments you’ll be receiving GLO’s position data."
How can you retreive this position data? Will applications on the device, such as Goolgle Maps, just get this data automatically? Any info or feedback about the device would be greatly appreciated.
More info on the device can be found at the following link:
https://buy.garmin.com/shop/shop.do?pID=109827&ra=true
Todd
This question seems to get a decent amount of traffic and could use a more thorough answer.
Garmin probably feels justified in saying this:
Just set GLO within range of your mobile device and in moments you’ll be receiving GLO’s position data
because on iOS you can connect to the GLO and iOS uses the location information from the GLO to supply more accurate information to any device using the iOS location APIs. Android has no such facility. So, option one is to use an app that will read the NMEA data over BT and use that to set the mock location on your Android device (as Rodrigo said). Option two is what I do in my app: connect to the GLO or other BT GPS from directly in the app. Then I parse the NMEA lines myself and use that within the app. The downside of this is that each app which uses location must implement this themselves.
It's working for me with this app:
https://play.google.com/store/apps/details?id=googoo.android.btgps
It uses mock GPS location to inject the GLO's position.
I was having issues with the DDMS's ability to send GPS data to my emulator (i needed speed, accuracy, heading, etc all to change but couldn't get that to work with DDMS). Anyhow, I wrote a quick script to connect to the debug port and send nmea sentences following a track from a gpx file (nmea sentences modelled off an nexus s) but added the extra data i needed. I know there are other gps emulators out there, but for various reasons I ended up writing my own.
The question I have is, is there a way to do this to a real phone? I've trawled through the ddms info i can find and cant find much of use?
I've seen one emulator that can do this via bluetooth, but had trouble with it.
The same way you can send GPS data to a phone, which must have USB debugging and Mock locations allowed in settings.