This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Volume.isSupported) | |
{ | |
Volume.service.addEventListener( VolumeEvent.CHANGED, volumeChangedHandler ); | |
Volume.service.register(); | |
} | |
... | |
private function volumeChangedHandler( event:VolumeEvent ):void | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static const BASE64_PUBLIC_KEY : String = "YOUR_LICENSING_PUBLIC_KEY"; | |
public static const SALT : Vector.<int> = Vector.<int>( [ 1, 43, -12, -1, 54, 98, -100, -12, 43, 2, -8, -4, 9, 5, -106, -108, -33, 45, -1, 84 ]); | |
... | |
ExpansionFiles.init( "APP_KEY" ); | |
trace( "ExpansionFiles Supported: " + ExpansionFiles.isSupported ); | |
trace( "ExpansionFiles Version: " + ExpansionFiles.service.version ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static const BASE64_PUBLIC_KEY : String = "YOUR_LICENSING_PUBLIC_KEY"; | |
public static const SALT : Vector.<int> = Vector.<int>( [ 1, 43, -12, -1, 54, 98, -100, -12, 43, 2, -8, -4, 9, 5, -106, -108, -33, 45, -1, 84 ]); | |
... | |
ExpansionFiles.init( "APP_KEY" ); | |
if (ExpansionFiles.isSupported) | |
{ | |
ExpansionFiles.service.setup( BASE64_PUBLIC_KEY, SALT ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<manifest android:installLocation="auto"> | |
<uses-sdk android:minSdkVersion="14" /> | |
<uses-permission android:name="com.android.vending.CHECK_LICENSE" /> | |
<uses-permission android:name="android.permission.INTERNET"/> | |
<uses-permission android:name="android.permission.WAKE_LOCK" /> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZipUtils.init( "APP_KEY" ); | |
if (ZipUtils.isSupported) | |
{ | |
ZipUtils.service.addEventListener( ZipUtilsEvent.UNZIP_COMPLETE, unzip_completeHandler ); | |
ZipUtils.service.addEventListener( ZipUtilsEvent.UNZIP_ERROR, unzip_errorHandler ); | |
ZipUtils.service.unzip( | |
File.applicationDirectory.resolvePath( "packaged.zip" ).nativePath, | |
File.applicationStorageDirectory.resolvePath( "unzip_dir" ).nativePath, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BluetoothLE.service.addEventListener( BluetoothLEEvent.STATE_CHANGED, stateChangedHandler ); | |
switch (BluetoothLE.service.state) | |
{ | |
case BluetoothLEState.STATE_ON: | |
// We can use the Bluetooth LE functions | |
break; | |
case BluetoothLEState.STATE_OFF: | |
case BluetoothLEState.STATE_RESETTING: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BluetoothLE.service.centralManager.addEventListener( PeripheralEvent.DISCOVERED, central_peripheralDiscoveredHandler ); | |
if (!BluetoothLE.service.centralManager.scanForPeripherals()) | |
{ | |
// There was an error starting to scan, check the state of the adapter! | |
} | |
... | |
private function central_peripheralDiscoveredHandler( event:PeripheralEvent ):void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var activePeripheral:Peripheral = null; | |
BluetoothLE.service.centralManager.addEventListener( PeripheralEvent.DISCOVERED, central_peripheralDiscoveredHandler ); | |
BluetoothLE.service.centralManager.addEventListener( PeripheralEvent.CONNECT, central_peripheralConnectHandler ); | |
BluetoothLE.service.centralManager.addEventListener( PeripheralEvent.CONNECT_FAIL, central_peripheralConnectFailHandler ); | |
BluetoothLE.service.centralManager.addEventListener( PeripheralEvent.DISCONNECT, central_peripheralDisconnectHandler ); | |
BluetoothLE.service.centralManager.scanForPeripherals(); | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var peripheral:Peripheral = ...; // This snippet assumes you have a connected 'peripheral' object. | |
var service:Service = null; | |
peripheral.addEventListener( PeripheralEvent.DISCOVER_SERVICES, peripheral_discoverServicesHandler ); | |
peripheral.addEventListener( PeripheralEvent.DISCOVER_CHARACTERISTICS, peripheral_discoverCharacteristicsHandler ); | |
peripheral.discoverServices(); | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var peripheral:Peripheral = ...; // Previously connected Peripheral | |
var characteristic:Characteristic = ...; // Discovered Characteristic of interest | |
peripheral.addEventListener( CharacteristicEvent.UPDATE, peripheral_characteristic_updatedHandler ); | |
peripheral.addEventListener( CharacteristicEvent.UPDATE_ERROR, peripheral_characteristic_errorHandler ); | |
peripheral.readValueForCharacteristic( characteristic ); | |
... |