These libraries provides different AIR 3 Native Extension adapters for the Android platform.
powered byPowerflasher GmbH
Use cases:
Extending the AIR API with additional hardware features of Android device
Using services which can't be accessed via the AIR API itself
Available Native Extensions
Sensors
AmbientLight Sensor (Android)
Barometer Sensor (Android)
Gravity Sensor (Android)
Gyroscope Sensor (Android)
Magnetometer Sensor (Android)
Orientation Sensor (Android)
Proximity Sensor (Android)
OS Features
Battery Status (Android)
Toast Messages (Android)
Vibrator Hardware (Android / iOS)
Notifications (Android)
Dependencies
compiled against Android 2.2 (API Level 8), some need Android 2.3.3 (API Level 9)
compiled against iOS 4.2 SDK
AIR 3.0 SDK
Usage
Download
Download the prefered Extension from the Extension_Android _*_Interface directory of the extension. I've also added the source files from native code in case you want to change the implementation for yourself.
Installation
Copy the '.swc' file from the /extension folder into your library folder and add it to your project classpath.
Copy the '.ane' file from the /extension folder into your project folder
Add the content of the 'descriptor_extensions.xml' into your application-descriptor.xml file
Add all necessary permissions into your application-descriptor.xml file
API Usage
After adding the.swc file to your project path you've access to the containing classes. The implementation of the different services is straight forwarded and orients oneself by the Adobe AIR API of the Geolocation and Accelerometer class.
In case you want to check whether a service is available or not you should use the static method isSupported() before initializing the instance.
E.g.
if (Vibrator.isSupported())
{
var vibrator : Vibrator = new Vibrator();
vibrator.vibrate(200);
}
if (Proximity.isSupported())
{
proximity = new Proximity();
proximity.setRequestedUpdateInterval(1000);
proximity.addEventListener(ProximityEvent.UPDATE, handleProximityUpdate);
}