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
var path:String = File.applicationDirectory.nativePath + File.separator + "example.mp4"; | |
MediaPlayer.init( APP_KEY ); | |
if (MediaPlayer.isSupported) | |
{ | |
MediaPlayer.service.createPlayer( path, 0, 0, 640, 480, false, MediaPlayer.CONTROLS_EMBEDDED ); | |
MediaPlayer.service.play(); | |
} | |
// com.distriqt.MediaPlayer |
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
// Here we assume you have previously initialised the extension | |
var webView:WebView = NativeWebView.service.createWebView( new Rectangle( 0, 0, 400, 600 ) ) ; | |
webView.addEventListener( NativeWebViewEvent.LOCATION_CHANGING, webView_locationChangingHandler ); | |
webView.addEventListener( NativeWebViewEvent.LOCATION_CHANGE, webView_locationChangeHandler ); | |
webView.loadURL( "http://airnativeextensions.com" ); | |
... |
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
Application.init( APP_KEY ); | |
if (Application.isSupported) | |
{ | |
// | |
// PRINT DEVICE INFORMATION | |
trace( "DEVICE INFO ============================" ); | |
trace( " name: " + Application.service.device.name ); | |
trace( " brand: " + Application.service.device.brand ); | |
trace( " manufacturer: " + Application.service.device.manufacturer ); |
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
Application.init( APPLICATION_KEY ); | |
if (Application.isSupported) | |
{ | |
Application.service.setStatusBarStyle( IOSStatusBarStyles.IOS_STATUS_BAR_LIGHT ); | |
Application.service.setStatusBarHidden( false ); | |
} | |
// com.distriqt.Application |
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 (Adverts.isSupported) | |
{ | |
Adverts.service.initialisePlatform( AdvertPlatform.PLATFORM_ADMOB ); | |
var adView:AdView = Adverts.service.createAdView(); | |
adView.setAdSize( AdSize.SMART_BANNER ); | |
adView.setAdUnitId( AD_UNIT_ID ); | |
adView.setViewParams( new AdViewParamsBuilder() | |
.setVerticalAlign( AdViewParams.ALIGN_BOTTOM ) | |
.setHorizontalAlign( AdViewParams.ALIGN_CENTER ) |
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
NetworkInfo.init( "" ); | |
NetworkInfo.networkInfo.addEventListener( | |
NetworkInfoEvent.CHANGE, | |
networkChangeHandler | |
); | |
... | |
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
try | |
{ | |
Notifications.init( APP_KEY ); | |
if (Notifications.isSupported) | |
{ | |
Notifications.service.addEventListener( NotificationEvent.NOTIFICATION_SELECTED, notifications_notificationSelectedHandler, false, 0, true ); | |
// | |
// This will trigger the start up notification if the application was started from a delayed notification | |
// Also this will perform the required registration for notifications permission on iOS 8+ |