Hello,
I have an issue with the event listener “location” on my Android devices (Galaxy Note (N7000, first model) and Galaxy Note 8.0). What I need to do is get the users distance to a previously saved location, e.g. you save your position via GPS data (latitude/longitude), move on and then want to know how far away you are away from that initially saved location.
My build.settings is complete and provides for all the relevant settings (including android.permission.ACCESS_FINE_LOCATION and android.permission.ACCESS_COURSE_LOCATION). I also added the relevant event listener:
[lua]
Runtime:addEventListener( “location”, locationHandler )
[/lua]
Basically, whenever the app is running and the user is moving, the event listener should be triggered at some point in time and I should be able to retrieve updated latitude/longitude information via the locationHandler function. However, the event listener seems to get only triggered once at startup with no further updates/events triggered thereafter.
My app runs perfectly fine on iOS (iPhone 5) and continously delivers GPS data (latitude/longitude) and I cannot see why it fails on Android. All GPS settings on my Android device are enabled, everyhing relevant is switched on but still no further location events are triggered. I am using build CoronaSDK 2014.2373.
To be sure that this had nothing to do with my app, I compiled another one which just waits for and reads the latitude/longitude values via the location listener, outputs them to the screen and vibrates the phone. All fine on iOS with constant data being delivered / event being triggered but no luck with my Android devices. The event listener is fired upon start of the app but no further updates thereafter.
I installed some apps from Google’s Store which display GPS data (latitude, longitude, satellite fix, etc.) and these are all doing fine, so my Android devices are working properly, however not with my Corona compiled apps.
Did anyone else encounter the same issue and could help me out? I have been trying to solve this for days now but I am stuck. My app is actually done but I cannot publish for Android with this issue being in place. I have no clue how to fix this.
Thanks.
Jens