Skip navigation
Currently Being Moderated

Air for Android Extremely Slow...

Jun 4, 2010 8:14 AM

Hey everybody,

 

Hopefully some of you have been trying the prerelease of Air for Android like myself. Its all great and easy peasy to export the apps to my phone but it seems to be ridiculously slow even for seemingly simple scripts.

 

This is what i'm trying to run at the moment and the app times out before it gets running (All the apps do get running eventually but only after the time out timer could have run over multiple times).

import flash.display.Shape; 
import flash.events.Event; 
import flash.sensors.Accelerometer; 
import flash.events.AccelerometerEvent; 
 
 
var vx:Number = 0; 
var vy:Number = 0; 
 
var s:Shape = new Shape; 
s.x = stage.stageWidth/2; 
s.y = stage.stageHeight/2; 
 
with (s.graphics) 
{ 
    lineStyle(3,0); 
    drawCircle(0,0,5); 
} 
addChild(s); 
 
var accel:Accelerometer = new Accelerometer(); 
 
addEventListener(Event.ENTER_FRAME, onFrameLoop); 
accel.addEventListener(AccelerometerEvent.UPDATE, onAccelEvent); 
 
function onAccelEvent (evt:AccelerometerEvent):void 
{ 
    vx += evt.accelerationX; 
    vy += evt.accelerationY; 
} 
function onFrameLoop (evt:Event):void 
{ 
    s.x = Math.round(s.x + vx); 
    s.y = Math.round(s.y + vy); 
}  

 

From what I can see theres nothing actually wrong with the code from what I can see but it just takes so frickin' long to load. If I make an app with some equally simple animations it loads almost instantly. I am aware that this is only a prerelease version of the software and the documentation does say that hardware acceleration has not been added yet but whenever I watch the videos up on youtube of the Adobe team making amazing apps with obviously buckets of script running smoothly on their phone I get annoyed

 

P.S The processor on my phone isn't the problem either (Nexus One Eclair )

 
Replies
  • Currently Being Moderated
    Jan 10, 2011 1:15 PM   in reply to Marky.d

    Have you already tried using Flash Builder Burrito?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 3, 2011 1:29 PM   in reply to Marky.d

    are you developing on windows?

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 23, 2011 9:19 PM   in reply to Marky.d

    Noone answered the speed question,... I have this same issue. What do i do to fix this?

     
    |
    Mark as:
  • McbainGames11
    287 posts
    Jun 17, 2011
    Currently Being Moderated
    Sep 24, 2011 2:28 AM   in reply to RIsoldier

    Hey,

     

    1.When you are compiling in the settings there is three options in render mode:

    • Auto
    • CPU
    • GPU

     

    2.Select GPU, and make all your symbols cached bitmaps by typing this simple line of code for each object to optomize:

     

    object_name.cacheAsBitmapMatrix = object_name.transform.concatenatedMatrix;
    object_name.cacheAsBitmap = true;

     

    Nothing to do with you code just the rendering and graphic performance!

     

    Goodluck!

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 24, 2011 9:39 AM   in reply to McbainGames11

    I cant find this setting, where exectly is it?

     
    |
    Mark as:
  • McbainGames11
    287 posts
    Jun 17, 2011
    Currently Being Moderated
    Sep 25, 2011 12:57 AM   in reply to RIsoldier

    If you are deploying for iPhone it is on the 'general' settings(First setting page opened).

    Just noticed you are making android app but i still added iphone deployment settings for further future

     

    But if you are using it for flash/android you have to add code into your fla descriptor with XML language(dont worry it is 1 line of code)

     

    Watch the video on this page about GPU rendering:

    http://blogs.adobe.com/cantrell/archives/2010/10/gpu-rendering-in-adob e-air-for-android.html

     

    Your app shouldn't lag after these steps but if you have a project that gets bigger and has lots of code it MIGHT lag so that is when external files should help.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points