Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Using GPS Receiver Within Code  RSS feed

 
Ranch Hand
Posts: 58
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wondering if anyone can point me in the direction of how I would allow users to use a 3rd party GPS receiving to report their location to my app?

I read on SO that it might involve parsing NMEA?  Can anyone give me a few more pointers of where I should look?

Thanks!
 
Sheriff
Posts: 23714
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a hardware connection along with documentation about how the GPS transfers data across that connection? That would have to be the first step.
 
Master Rancher
Posts: 3276
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Different GPS devices can have their own formats for the positions that they report.  As Paul said, you need to read the documentation for the device and software.
 
Andy Crowther
Ranch Hand
Posts: 58
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah,ok.  No, it's not even for me.  I was hoping to add the option to my app was all.  Is there not a most commonly used one then?
 
Norm Radder
Master Rancher
Posts: 3276
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of GPS devices are you trying to connect to?
 
Andy Crowther
Ranch Hand
Posts: 58
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I've thought about buying something this one for example.
 
Norm Radder
Master Rancher
Posts: 3276
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you download its manual to see how it reports its positions?
 
Bartender
Posts: 2041
273
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Andy Crowther wrote:I wondering if anyone can point me in the direction of how I would allow users to use a 3rd party GPS receiving to report their location to my app?

I read on SO that it might involve parsing NMEA?  Can anyone give me a few more pointers of where I should look?

Thanks!


Most GPS receivers support NMEA 0183.  There is a LGPL Java parser library called Java Marine API on GitHub - it may do which you are looking for.
 
Paul Clapham
Sheriff
Posts: 23714
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay... the hardware connection is Bluetooth then. Next step is to research how to connect to Bluetooth devices via Java, that's not built into the standard API. It's not impossible, though, there is Bluetooth code available as open-source.

Your "app" is a Java app, right? Not Android, for example?
 
Ron McLeod
Bartender
Posts: 2041
273
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Andy Crowther wrote:Well I've thought about buying something this one for example.


FYI .. it appears like that receiver does support NMEA 0183 running at high speed.

Manual here.
 
Andy Crowther
Ranch Hand
Posts: 58
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:Your "app" is a Java app, right? Not Android, for example?



No, it's an Android app.  Almost certainly I posted in the Android forum?  Would someone have moved it?

Thanks for the links and help guys.
 
Author and ninkuma
Marshal
Posts: 66810
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it was posted in Java in General. I've moved it to the Android forum, and added it to Open Source Projects as well.
 
Norm Radder
Master Rancher
Posts: 3276
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of Android device do you have?  All my devices have native GPS.
 
Andy Crowther
Ranch Hand
Posts: 58
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, most do, most poll around once  a second.  For some things you want more accuracy though.
 
Norm Radder
Master Rancher
Posts: 3276
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the fastest possible fix rate for your tablet?  I did a Google and couldn't find any specifics.
Note to self:  Time to write a test program.
 
Andy Crowther
Ranch Hand
Posts: 58
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm writing a fairly simple lap timer app and it was pointed out it will only be as accurate as how often the phone checks GPS.  A quick google tells me it's around 1.5Hz for a phone but the external can do 10Hz (10 times a second) which will obviously give more accurate results.
 
Norm Radder
Master Rancher
Posts: 3276
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the parameters for the app you are trying to write?  How fast and how far are the objects moving that you want to measure?
How accurate do you think the GPS device will be?  Will it be better than 10 meters?

An interesting article: http://www.andygup.net/how-accurate-is-android-gps-part-2-consuming-real-time-locations/
 
Andy Crowther
Ranch Hand
Posts: 58
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a lap timer app, which could be used (possibly by me) for track days, so speeds up to 150mph.  A separate GPS unit is quite a lot more accurate than a phone GPS to the point you can see your line through bends and such.

Unfortunately, me being still a beginner (maybe 4 months in?) it still takes me a very long time to understand new things like this...  and this is just added to my list of things to learn   Hopefully by next March or so, as people start doing track days again, I'll have figured it out
 
Norm Radder
Master Rancher
Posts: 3276
33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Taking fixes while standing still will show you a circle of fixes that would give you an idea of what kind of accuracy you can get.
Modern GPS devices with smoothing software can probably show points on a reasonable track when moving at speed.
 
Andy Crowther
Ranch Hand
Posts: 58
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, phones generally do a good job, and for most will be just fine.
 
Paul Clapham
Sheriff
Posts: 23714
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Norm Radder wrote:Taking fixes while standing still will show you a circle of fixes that would give you an idea of what kind of accuracy you can get.
Modern GPS devices with smoothing software can probably show points on a reasonable track when moving at speed.



That could be so, but I wouldn't just assume that. Here's my experience with GPS devices moving at speed:

I'm a birder, and sometimes I see a bird while riding on a bus and I want to record its species and location for eBird. The location part isn't easy, especially if you're far from landmarks, so my idea was to use my camera, which has built-in GPS. I can set it to record the location in the metadata of the photographs, so I did that. It's not straightforward to get the location out of the metadata, you have to get software which can do that, but it's certainly not difficult either. So what I expected was a photo of blurry roadside vegetation with the GPS location stamped into the metadata.

But when I got home and looked at the photos, none of the ones from the moving bus had the location in the metadata. All of the photos I took when standing still did have the location in the metadata. So I'm assuming that the camera's GPS doesn't function when it's moving at speed.

So clearly my camera's GPS doesn't have the smoothing software which Norm mentioned. Not really surprising, it's an inexpensive point-and-shoot. My point is that you should evaluate your chosen GPS device to see if it does work accurately at the speeds you're expecting.
 
Norm Radder
Master Rancher
Posts: 3276
33
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

  ones from the moving bus


I'm often surprised that my current GPS can get a fix inside a vehicle.  Some of my previous GPS devices had problems if they did not have a full, open view of the sky.
I'm not sure how well the signals from the satellites penetrate the metal tops/sides of a vehicle. 
So I was wondering if the motion or being inside a bus was the problem.
 
Paul Clapham
Sheriff
Posts: 23714
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Norm Radder wrote:So I was wondering if the motion or being inside a bus was the problem.



That's a good question. I was assuming that being inside the bus wasn't the problem because the viewfinder screen was showing the icon which confirms that the camera has a good GPS connection. Clearly I should try the experiment where I sit on top of the bus as it travels along the freeway, or where I get towed behind the bus on a skateboard, or something like that...

Anyway I assume that even GPS devices in today's phones can function at highway speeds because many cyclists use Strava to record their ride and that (as far as I know) works fine even when they descend at high speed.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!