Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

GPS Coarse location data
Started by ebookren Sep 23 2013 06:01 AM

4 replies to this topic
gps coarse location
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ebookren

[GLOBAL: userInfoPane.html]
ebookren
  • Enthusiast

  • 52 posts
  • Enterprise

(Android)

 

Runtime:addEventListener('location', locationHandler)

 

I can get locationHandler to fire if I have GPS turned on. When turned off  I never get Coarse location data even though i have it listed in my Build Settings.  ("android.permission.ACCESS_COARSE_LOCATION"). I have event tested the APP with only the coarse location data listed in buildsettings. Still does not work. 

 

I would like to know if there is a way to tell if the GPS is turned on so I can notify the user it needs to be turned on? 

Also if anyone has any ideas on how to get coarse location data I would love to hear it. Having the user turn on GPS is an extra step I'd rather they not have to take. I would like to be able to get coarse location data for users who do not have gps turned on. 

 

Chris

 

PS. I can get coarse data on my Nexus 7 . My trouble is with my EVO 4g LTE  phone. 


Edited by ebookren, 23 September 2013 - 07:26 AM.


[TOPIC: post.html]
#2

henrik5

[GLOBAL: userInfoPane.html]
henrik5
  • Contributor

  • 251 posts
  • Corona SDK

I have this problem, too. I have a Samsung tablet which has 3 settings under Location. With the standard Locationhandler in the official examples, it works fine as long as the GPS checkbox is ticked.

 

Am I correct in thinking I'll just have to add the permissions for the other two checkboxes in Settings? (I think it was location from Wifi and location from Google Places.)

 

A list or link to the permissions to enable would be appreciated, and maybe ebookren's problem will be solved too :)



[TOPIC: post.html]
#3

ebookren

[GLOBAL: userInfoPane.html]
ebookren
  • Enthusiast

  • 52 posts
  • Enterprise

I have both FINE and COARSE location permissions in my Build Settings. I have all check boxes checked on my phone's location screen to allow GPS or WIFI/Cell location data.  What I didn't realize was that after checking those boxes I needed to restart my phone. Once I did that I was able to get not only fine location data but coarse location data as well.  I do wish I had a way to send the user to the location screen in settings of their phone so they could turn on GPS or to have a way to check if it is turned on so I could throw an alert saying "Please turn your gps on and come back to the app. " 

 

Chris



[TOPIC: post.html]
#4

henrik5

[GLOBAL: userInfoPane.html]
henrik5
  • Contributor

  • 251 posts
  • Corona SDK

The behavior of mine in this regard is to time out the first time and not give a position, and the second time adding the location handler event, it will never time out. This is just from one test, so not very reliable information.

 

For me, the unchecked GPS box seems to be a problem with the specific device. On all other devices, I've been able to retrieve a position with GPS checkbox off. We will try an OS update tomorrow and see if that fixes it.



[TOPIC: post.html]
#5

Dev-Ze.rocks

[GLOBAL: userInfoPane.html]
Dev-Ze.rocks
  • Contributor

  • 213 posts
  • Corona SDK

I am using an galaxy 24 mini and I can not get any location informations if the gps is switched of. google maps can get my position. The same happens with a motorola razr.

Seems like its not possible to get the coarse location on android via corona, right?

 

And the error messages dont work with android, too. I read this in an other topic, but it would be great to be written in the docs.

 

 

Felix




[topic_controls]
[/topic_controls]