Compass magnetic without a smartphone that supports it

I am implementing a compass in my app. I use it on my Nexus 4 and it works perfectly.

But I want to detect if a smartphone has a compass or not. Can anyone tell me how I should do that?

http://docs.coronalabs.com/api/library/system/hasEventSource.html

Use “heading”

Sorry, but this doesn’t give any answer on my question :frowning:

local has\_compass = system.hasEventSource( "heading" ) if has\_compass then print( "The device has a compass." ) end

This doesn’t give you what your asking

:slight_smile: Thank you Jstrahan, I read your previous post too quickly, Sorry!

No problem
I could’ve miss understood that’s why I doubled checked

When responding from mobile device I tend to not explain myself as good as I should. Guess I need to correct that

Or even better… build an app for that :wink: Just kidding.

There may be one. Lol

if your app uses a compass as part of it, isn’t another possible solution to your problem adding the “usesFeatures” and make the thing required?

No it is not, I like your idea tho, because I have thought about it myself aswell.

I am using GPS in my app, but if you do not have GPS i just disable some features in the app. That way a lot of people can still use the app, even if they do not have GPS.

Ah, alright. Makes sense. Just wanted to give you an alternative, but didn’t know enough about your program :stuck_out_tongue:

http://docs.coronalabs.com/api/library/system/hasEventSource.html

Use “heading”

Sorry, but this doesn’t give any answer on my question :frowning:

local has\_compass = system.hasEventSource( "heading" ) if has\_compass then print( "The device has a compass." ) end

This doesn’t give you what your asking

:slight_smile: Thank you Jstrahan, I read your previous post too quickly, Sorry!

No problem
I could’ve miss understood that’s why I doubled checked

When responding from mobile device I tend to not explain myself as good as I should. Guess I need to correct that

Or even better… build an app for that :wink: Just kidding.

There may be one. Lol