GPS not working on Samsung Galaxy Tab/Grand 2

The GPS for some android device doesn’t seem to be working. I am trying to get the long/lat of my current location but it doesn’t return any value at all. I tried using the app to my Galaxy S2 and it was working ok. I enabled

 

“android.permission.ACCESS_FINE_LOCATION”,

“android.permission.ACCESS_COARSE_LOCATION”,

 

Inside the build.settings. Here is my sample code. What’s causing this problem?

 

local locationHandler = function( event )      if event.errorCode then         native.showAlert( "GPS Location Error", event.errorMessage, {"OK"} )         print( "Location error: " .. tostring( event.errorMessage ) )     else         local location = "\nLocation latitude: " .. event.latitude ..         "\nLocation longitude: " .. event.longitude;         native.showAlert("Your location", location, {"Close"})     end end Runtime:addEventListener( "location", locationHandler )

Are you getting any errors in the console log?

Do you have locations services on for the device?

I’ve discovered that the cause was a magnet interfering with the device. My tab and Galaxy Grand 2 has a case that contains some kind of magnet or metal object so I remove the case for now…

So far it’s working properly now. Please add to your documentation regarding this issue if you have not done it yet to help others who has similar problems.

Thank you. :slight_smile:

Are you getting any errors in the console log?

Do you have locations services on for the device?

I’ve discovered that the cause was a magnet interfering with the device. My tab and Galaxy Grand 2 has a case that contains some kind of magnet or metal object so I remove the case for now…

So far it’s working properly now. Please add to your documentation regarding this issue if you have not done it yet to help others who has similar problems.

Thank you. :slight_smile: