the other problem i’ve its direction…because in a road you can have 2 spots on each side…it needs to detect if you go one direction of another…i think heading will help in that but i didnt read much about it…the phone needs to pointed parallel to that road? ou it work grabing the phone on any direction?
No, heading should work like a normal compass. Try it out yourself by building and installing the Compass sample app on your phone:
Corona > SampleCode > Hardware > Compass
brent, i tried that system …it’s on my first post…it didnt work…i tried 3s, 5s, 10s, 11s. noone worked like when i doesnt remove the runtime.
if i leave the runtime…first 5s or so…it will not update the gps every second…maybe it’s getting gps postion…after that i will get constant data…every second…if i remove and create…it will have that weird effect…for a few sec it will not work…but when its about to start…it will remove…still even if it will work with more test…i don’t know if it will not consume more battery because removing and creating…makes a new connection consuming more? i can be wrong ofc…it would be a lot easier if i could just object:updateGpsRate(2000) or something…
so heading will not work because in that street if the phone can be picked backwords and it will give me wrong information. “location” runtime, returns direction, but will only works if i’m moving…that i checked today while walking…and i can turn around the phone that doesnt mather…it will give me the correct direction…the problem…is if the app is used on a bus…and the person only opens the app when it’s stoped on that place…it will not know where whats the direction…because hes stopped…
There’s nothing Corona can do to dictate how fast it takes the device/OS to start checking for GPS response. The hardware itself has to be initiated and detection has to start occurring. I’m also not entirely sure Corona is controlling the 1-second check once the hardware is polling… very likely that’s a system/OS thing as well. Have you searched online for any details on GPS frequency of mobile devices in general?
You’re saying that if I run the Compass sample and flip the phone over, “west” becomes “east” or something? That doesn’t sound right… I guess I need to try that and see what happens. 
if it was for me…i would present the 2 places…and the person choses the one he wants it to learn more about…but the client wants the app to detect the direction he his going or is.
no, what i’m saying in compass…if you turn your device W, the degrees are different than if you turn yor device E…so if they are different i cant just make a rule that there is an object at 200º for example (with 30º ± error) because the phone can be pointing to any direction. he assumes you going where your pointing. but ofc in real life…a client can be pointing to any direction the phone…and moving to another…that i can’t control
*edit* i can do that with the “location” runtime variable direction. but the person needs to be moving to work…if he opens the app on the place it will fail to detect the direction. (direction is 0 stopped)
on android there are variables that can be changed to change GPS work easy:
https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest
here is a post regarding updating gps:
reading from google:
https://developer.android.com/guide/topics/location/strategies.html
it will point to here (if i want to change the interval gps updates):
i just learned that i can reduce gps usage in corona using this:
system.setLocationThreshold()
this will help.
i wish some like this could be done for GPS changing the Hz,
system.setGyroscopeInterval()
event.direction on Runtime:addEventListener( “location”, locationHandler ) is giving me different results than compass (smartphone is in the same direction i’m movin. they point to the same north? they should have same values when i’m moving with smartphone pointing to the direction i’m moving (straight ahead), right?