Android Location

The Android Location Sensor calls routines when there is a change in location or heading, but not for speed.
At a walking pace, it can take 20 seconds before you get a location change, read the sensor.speed, and find that you actually have stopped! This is hopeless. Does anyone know of either an OnSpeedChange, or is there some way of getting 1-second NMEA strings out of the Android GPS?

1 Like

Hi Chester,

I don’t know how to, but it’s certainly possible.

I have a Samsung Galaxy S9+ and a Samsung Gear S3 watch. The included app counts steps accurately on the watch, and the Runkeeper app (free, but they want you to be able to save the data, and/or engage with other users - for money) provides more data, also accurate, when I’m running. Or even walking.

Those “accurate” comments are by mental observation, not sophisticated measuring equipment.

Regards,
Frank Malcolm

I am sure there is and please let me know when you find out how.

I think the Delphi Android location sensor implementation compares the current and previous readings for some values and then generates an on change event. If non of these values has changed sufficiently it just goes away.

I have managed to step into the android platform implementation on occasions to see where this happens but do not have the Java skills to change it.

I am sharing my efforts and code via
https://delphinotes.innovasolutions.com.au/posts/mobile-navigation-app-on-android/#more-253
and

But at this stage it reflects mostly frustration.

1 Like

If you’re specifically after NMEA strings, you could use code in this unit as a guide:

Specifically, the TNmeaMessageListener class at line 44 and 178, and how it is added to a LocationManager, from lines 204-206.

If, like Frank has suggested, you’re after tracking steps etc you might be interested in the code here:

Particularly the units: DW.Sensor and DW.Sensor.Android, which implement various sensors including TYPE_STEP_COUNTER and TYPE_STEP_DETECTOR.

I sent the units to Omar for him to try and am yet to include them in Kastri. This has prompted me that I should :slight_smile:

1 Like

Some years ago there was a video - I think from google employees - talking about positioning more fine-grained than GPS. They talked about using several layers of information … gps, (4G) provider beacons, local wifi, etc to put together finer positioning information for indoor use. But I have failed to dig it up. It could have been a ‘Talks at Google’ … (?)

[edit] thanks to @davidn link name, searching “android fusion sensors location” got me to this video
… not what I was looking for, but maybe about the same age.

and:

and finally:
"Indoor Positioning using Sensor-fusion in Android Devices"
http://hkr.diva-portal.org/smash/get/diva2:475619/FULLTEXT02

2 Likes

Thanks for putting that up - it was great!

1 Like