Difference between revisions of "Mojo Identify Device"

From WebOS Internals
Jump to navigation Jump to search
(create)
 
(Added list of documented fields.)
Line 21: Line 21:
 
"wifiAvailable": true,  
 
"wifiAvailable": true,  
 
"bluetoothAvailable": true }
 
"bluetoothAvailable": true }
 +
</pre>
 +
 +
The documented values (as of 2009/12/10) are
 +
<pre>{"screenWidth": INT (px),
 +
    "screenHeight": INT (px),
 +
    "minimumCardWidth": INT (px),
 +
    "minimumCardHeight": INT (px),
 +
    "maximumCardWidth": INT (px),
 +
    "maximumCardHeight": INT (px),
 +
    "keyboardType": STRING,
 +
    "touchableRows": INT}
 +
</pre>
 +
I would guess that the other fields probably won't go away or change in weird ways, but one can't be certain.

Revision as of 19:05, 10 December 2009

To tell if you are running on a Pre or a Pixie or some other future WebOS device use this call:


Mojo.Environment.DeviceInfo

It should give you back an object something along the lines of this:

{ "modelName": "Pr?", 
"platformVersion": "1.0.2", 
"carrierName": "Sprint", 
"serialNumber": "Unknown", 
"screenWidth": 320, 
"screenHeight": 480, 
"minimumCardWidth": 320, 
"minimumCardHeight": 188, 
"maximumCardWidth": 320, 
"maximumCardHeight": 424, 
"keyboardAvailable": true, 
"keyboardSlider": true, 
"keyboardType": "QWERTY", 
"wifiAvailable": true, 
"bluetoothAvailable": true }

The documented values (as of 2009/12/10) are

{"screenWidth": INT (px), 
    "screenHeight": INT (px), 
    "minimumCardWidth": INT (px), 
    "minimumCardHeight": INT (px), 
    "maximumCardWidth": INT (px), 
    "maximumCardHeight": INT (px), 
    "keyboardType": STRING, 
    "touchableRows": INT} 

I would guess that the other fields probably won't go away or change in weird ways, but one can't be certain.