Skip to content

Instantly share code, notes, and snippets.

@danielwanja
Created April 10, 2011 22:06
Show Gist options
  • Save danielwanja/912777 to your computer and use it in GitHub Desktop.
Save danielwanja/912777 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.DeviceCapabilitiesHomeView"]>
</s:ViewNavigatorApplication>
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="Device Capabilities"
creationComplete="view1_creationCompleteHandler(event)"]>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import flash.sensors.Accelerometer;
import flash.sensors.Geolocation;
protectedfunction view1_creationCompleteHandler(event:FlexEvent):void
{
var deviceString:String =
"hasAudio: " + Capabilities.hasAudio + "\n" +
"hasMP3: " + Capabilities.hasMP3 + "\n" +
"language: " + Capabilities.language + "\n" +
"manufacturer: " + Capabilities.manufacturer + "\n" +
"os: " + Capabilities.os + "\n" +
"screenDPI: " + Capabilities.screenDPI + "\n" +
"screenResolutionX: " + Capabilities.screenResolutionX + "\n" +
"screenResolutionY: " + Capabilities.screenResolutionY + "\n" +
"touchscreenType: " + Capabilities.touchscreenType + "\n" +
"version: " + Capabilities.version;
device.text = deviceString;
accel.text = String(Accelerometer.isSupported);
camera.text = String(Camera.isSupported);
geo.text = String(Geolocation.isSupported);
var multitouchString:String =
"maxTouchPoints: " + Multitouch.maxTouchPoints + "\n" +
"supportedGestures: " + Multitouch.supportedGestures + "\n" +
"supportsGestureEvents: " + Multitouch.supportsGestureEvents + "\n" +
"supportsTouchEvents: " + Multitouch.supportsTouchEvents;
multitouch.text = multitouchString;
}
]]>
</fx:Script>
<s:Scroller width="100%" height="100%">
<s:Group>
<s:Label x="10" y="10" text="Device Capabilities"/>
<s:TextArea id="device" left="2" right="2" top="35" height="231"/>
<s:Label x="10" y="286" text="Accelerometer"/>
<s:Label x="10" y="317" text="Camera"/>
<s:Label x="10" y="348" text="Geo Location"/>
<s:Label x="10" y="379" text="Mutlitouch Support:"/>
<s:TextArea id="accel" x="190" y="276" width="280" height="32"/>
<s:TextArea id="camera" x="190" y="308" width="280" height="32"/>
<s:TextArea id="geo" x="190" y="339" width="280" height="32"/>
<s:TextArea id="multitouch" left="2" right="2" top="402" height="173"/>
</s:Group>
</s:Scroller>
</s:View>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment