How can we tell if the GPS is turned on or off

How can we tell if the GPS is turned on or off [import]uid: 11860 topic_id: 5098 reply_id: 305098[/import]

What nobody knows? - Anyone at Corona Know how to determine this?

bueller? bueller? anyone? [import]uid: 11860 topic_id: 5098 reply_id: 16905[/import]

Did you find a solution ? My App is closing when I’m calling the Map API and the GPS is off.
I like to bring a message to open GPS when it’s closed.

Michael [import]uid: 12632 topic_id: 5098 reply_id: 27220[/import]

Well what you could do ( and what i did ) is set a variable to false and only set it to true when the locationHandler event handler fires.

check the variable every now and then in a timer event and check to see if it has ever been set to true. If it has not well then the GPS may be turned off.

Example code

[code]
local isGPSActive = false

local function listener( event )
–print( “listener called” )
if isGPSActive then
msg = display.newText( “GPS is active aquiring sat data”, 0, 230, “Verdana-Bold”, 13 )
msg.x = display.contentWidth/2 – center title
msg:setTextColor( 255,255,255 )
else
msg = display.newText( “GPS is not active!”, 0, 230, “Verdana-Bold”, 13 )
msg.x = display.contentWidth/2 – center title
msg:setTextColor( 255,255,255 )
end
end

timer.performWithDelay(10000, listener )
[/code] [import]uid: 11860 topic_id: 5098 reply_id: 27339[/import]

This was my idea too, but I thought there is something like an API call to
get this information. So we have to use this workaround…

Thanks a lot

Michael [import]uid: 12632 topic_id: 5098 reply_id: 27370[/import]