Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,770,247 Members 50,101 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE]For Flash Developers

Tip us?
 
neumedia
Old
(Last edited by neumedia; 15th April 2013 at 07:44 AM.)
#1  
Member - OP
Thanks Meter 55
Posts: 40
Join Date: Mar 2013
Smile [GUIDE]For Flash Developers

Though most of the Android Development forums advocate native applications, for those who are more fluent with flash, don't give up hope just yet. Android's support for flash environment ain't too shabby and it's far better than those running on Apple (trust us, we tried). Flash provides some useful tools to do a quick mock up of concepts and/or visuals.

To get you started, check out Adobe's Guide to Android Air on Android.

But of course, nothing runs better or faster than a native app.

Happy Coding!
Calculus can be FUN!
The Following 2 Users Say Thank You to neumedia For This Useful Post: [ Click to Expand ]
 
neumedia
Old
#2  
Member - OP
Thanks Meter 55
Posts: 40
Join Date: Mar 2013
Default How do you intercept device sleep and wake events on adobe air

If you are developing your app on adobe air then you will definitely come across the need to decide what to do with your app when the user closes the app and how will it resume.

The following short guide will show you how to do this easily.

Add the following lines to attach the function calls to the respective events:

import flash.desktop.NativeApplication;

NativeApplication.nativeApplication.addEventListen er(Event.DEACTIVATE , handleDeactivate, false, 0, true);
NativeApplication.nativeApplication.addEventListen er(Event.ACTIVATE, handleActivate, false, 0, true);

function handleDeactivate(event:Event):void {
//Function called on app sleeps
}

function handleActivate(event:Event):void {
//Function called when app resumes.
}
Calculus can be FUN!
The Following 2 Users Say Thank You to neumedia For This Useful Post: [ Click to Expand ]
 
neumedia
Old
#3  
Member - OP
Thanks Meter 55
Posts: 40
Join Date: Mar 2013
Default How to handle back button key press

To control the behavior of the app when the back button is pressed, simply attach an event listener as shown below:

import flash.desktop.NativeApplication;

NativeApplication.nativeApplication.addEventListen er(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true);

protected function onKeyDown(event:KeyboardEvent):void{
if( event.keyCode == Keyboard.BACK ) {
event.preventDefault();
event.stopImmediatePropagation();
//handle the button press here.

}
}
Calculus can be FUN!
The Following 2 Users Say Thank You to neumedia For This Useful Post: [ Click to Expand ]
 
neumedia
Old
#4  
Member - OP
Thanks Meter 55
Posts: 40
Join Date: Mar 2013
Default How to enable your Adobe Air app to be transferrable to the external SDcard

By default, the setting in Adobe Air is set such that apps cannot be moved to external storage. Some users prefer this due to limited storage space on their phones or because some apps take up alot of space.

To allow this behavior, you need to manually change the setting in the application.xml file under the android settings. Simply add the line in bold and wallah, your android will now allow your app to be moved between local and external storage.

<android>
<manifestAdditions>

<![CDATA[<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
</manifest>]]>
</manifestAdditions>
</android>
Calculus can be FUN!
The Following 2 Users Say Thank You to neumedia For This Useful Post: [ Click to Expand ]
 
ScatteredHell
Old
#5  
ScatteredHell's Avatar
Senior Member
Thanks Meter 530
Posts: 1,872
Join Date: Jul 2012
Location: Colombo
I appreciate you work man
"An EXPERT is someone who has made all the mistakes which can be made, in a very narrow field" - Niels Bohr

--------------------------------------------------------------------------
----------------------------------------------------------------------------------------------Thanks to UKICAR@XDA

 
Are you a COD MW3 Player? Tired With play with Hackers on TG & 4D1?
Join with us, No Cheaters can Compete Project Tiger Killer
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes