Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[GUIDE]For Flash Developers

OP neumedia

7th April 2013, 05:12 PM   |  #1  
OP Member
Thanks Meter: 55
 
40 posts
Join Date:Joined: Mar 2013
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!
Last edited by neumedia; 15th April 2013 at 08:44 AM.
The Following 2 Users Say Thank You to neumedia For This Useful Post: [ View ]
23rd April 2013, 10:51 AM   |  #2  
OP Member
Thanks Meter: 55
 
40 posts
Join Date:Joined: Mar 2013
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.
}
The Following 2 Users Say Thank You to neumedia For This Useful Post: [ View ]
30th April 2013, 05:55 AM   |  #3  
OP Member
Thanks Meter: 55
 
40 posts
Join Date:Joined: Mar 2013
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.

}
}
The Following 2 Users Say Thank You to neumedia For This Useful Post: [ View ]
11th May 2013, 05:45 AM   |  #4  
OP Member
Thanks Meter: 55
 
40 posts
Join Date:Joined: Mar 2013
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>
The Following 2 Users Say Thank You to neumedia For This Useful Post: [ View ]
11th May 2013, 01:55 PM   |  #5  
ScatteredHell's Avatar
Senior Member
Flag Colombo
Thanks Meter: 532
 
1,884 posts
Join Date:Joined: Jul 2012
More
I appreciate you work man
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes