Reputation: 3368
I am developing a full-Flash site (Player 10.2).
I need to know at runtime if code is running on a desktop/mouse computer or a mobile/touch device, so that I can differentiate the input mechanism.
Is this by any means possible?
Upvotes: 1
Views: 4793
Reputation: 125
You could check to see if the device has accelerometer support. If so, you know it's a mobile device. I dont know exactly what it is you would like to do so I dont know if this will work well for your project. It will distinguish mobile from desktop, though.
if(Accelerometer.isSupported){
//mobile device
//os still unknown
else{
//desktop or laptop
//os still unknown
}
Upvotes: 1
Reputation: 79
For AIR 3.9: Capabilities.manufacturer returns "Adobe iOS" on ipad2, "Android Linux" on Galaxy s4. Capabilities.version returns "IOS 11,9,900,117" on ipad2 and "AND 11,9,900,117" on Galaxy s4.
Upvotes: 1