dpdearing / android-gps-emulator

A Google Maps-based tool for simulating the GPS location of the Android emulator
Apache License 2.0
214 stars 50 forks source link

Add support for geo fix with altitude #5

Open dpdearing opened 10 years ago

dpdearing commented 10 years ago

From dpdearing@gmail.com on December 29, 2011 14:18:35

Or is it broken? http://stackoverflow.com/questions/3292788/geo-fix-command-does-not-pass-altitude

Original issue: http://code.google.com/p/android-gps-emulator/issues/detail?id=5

sytolk commented 8 years ago

Altitude works with this PR https://github.com/dpdearing/android-gps-emulator/pull/10

dpdearing commented 8 years ago

I'm not sure I understand the code in the pull request. How do you specify the altitude and where is it using that information?

I see a bunch of date collection. Is the pull request doing speed and not altitude?

sytolk commented 8 years ago

Altitude is hardcoded (you can search for the 20 in PR). My initial idea was to set speed in Location object but I have success with altitude only.. code in this PR is experimental I just want to share it and looking for comments where is the problem for the speed

dpdearing commented 8 years ago

I don't think that hard-coding to 20 is really any more helpful than not having altitude at all. Maybe there is an easy way to use the Google Maps Elevation API?

sytolk commented 8 years ago

Yes you can easy get the real altitude for the point but this is testing tools and more important is altitude to have some value you can set Random(0,4000) for altitude and I'm sure that nobody will open issue that altitude value is wrong ;) The real problem is how to set some hard-coded value to the speed ? if you know this I will provide PR with the real speed calculated and altitude too :)

dpdearing commented 8 years ago

Adding speed is part of issue #4, and the idea was to let the user manually enter a speed. So at a minimum there would need to be a field to manually enter the speed.

Setting a random point doesn't fix this issue (altitude), which is separate from speed.

sytolk commented 8 years ago

Manually to set speed why? You can calculate distance and speed from previous point

dpdearing commented 8 years ago

If you do it that way you still need to know the time it takes to travel between the points to calculate the speed. And then it's way more complicated to emulate the actual speed you want.

sytolk commented 8 years ago

Yes I think that its not problem to attach one timestamp to every point clicked on the map.

dpdearing commented 8 years ago

Sure you could do that, but I think you would end up with really high speeds (if you click a long distance apart and don't wait, what, an hour between clicks?). That seems way harder and less useful than just typing in the speed you want to emulate for your next click.

But feel free to try it your way and create a pull request if it works well. Please post it on #4 for speed, though