0

I have an HTC One X which I like and carry everywhere, but the GPS is atrocious. It takes tens of minutes to get a position, loses it easily and it's not even very accurate when it has a signal. However, I also have a Garmin GPS which is fantastic at gaining and holding a steady and accurate GPS location. I'd like to use the Garmin as an external GPS in combination with android's mock-location feature, in my car.

It is definitely possible to drive gpsd on a pc with the garmin - but I don't know how to use that to provide location data to android. The phone is already rooted and I'm not averse to hacking it a bit more, but of course simpler solutions are preferred. Initially I would be happy plugging the Garmin and HTC into a laptop but I'll move to a Raspberry Pi as soon as I know it works. Not really bothered about using USB OTG to connect as this is for in-car use.

So: Can I use gpsd running on a PC to control a mock-location on Android? If so, how?

  • 1
    Does your Garmin support Bluetooth, so you could use it as BT GPS mouse? If so, there are easier methods than fiddling with cables and a PC, plus running around with a big rucksack to carry it all. – Izzy Nov 27 '13 at 23:05
  • No - it's a ForeRunner 205. buy.garmin.com/en-GB/GB/sports/discontinued/forerunner-205/… Very basic but extremely lightweight, good accuracy and battery life. BT GPS mice cost, and seeing as I carry the Garmin all the time anyway, seem a bit pointless. – Matthew Gilliard Nov 27 '13 at 23:16
  • Besides, I'm really talking about in-car use and I already use the phone's BT to connect to the stereo :) Not sure if the phone could connect to both stereo and GPS mouse. To be honest it's pretty flakey with just the stereo. – Matthew Gilliard Nov 27 '13 at 23:17
1

I don't know if you can do this with your PC. Likely the easiest way would be to hack up a custom script on your PC to respond to new positions coming from gpsd, and use the following command to mock those locations on the phone:

adb shell setLatLon latitude longitude

You need to have previously turned on USB debugging and mock locations in the phone's settings.

However, this seems unnecessarily complicated. If you search for external gps on Google Play, you'll see a zillion apps that allow you to connect your Android device directly to an external GPS receiver. There's no need to involve your PC at all. Try a few and report back which one works best for you.

  • Sounds good. To keep them charged up I usually have the Garmin and phone plugged into a laptop when I'm driving anyway. So a simple script to scrape GPS data from the Garmin and send it to the phone would really suit my needs perfectly. I'll see what I can hack up... – Matthew Gilliard Nov 27 '13 at 23:28
  • If I search for external GPS on google play, I don't really see anything helpful. Can you suggest a specific app to check out? – Matthew Gilliard Nov 27 '13 at 23:38
  • 1
    A tenner will buy you a USB charger that plugs into a lighter socket. If you're looking for an excuse to buy yourself a raspi, find a better one! – Dan Hulme Nov 27 '13 at 23:39
  • Thanks for your update and indulging me :) setLatLon: not found though :( This person had the same idea though: stackoverflow.com/questions/11729767/… – Matthew Gilliard Nov 27 '13 at 23:47
  • 1
    While most "external GPS" apps seem to be specifically for BT mice, I've just found RtkGPS: high rated, and the desc says USB is supported as well. A second candidate would be You are here. – Izzy Nov 28 '13 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.