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 )
Also, another very irritating problem I'm having with the latest build of AIR for Android is that whenever I publish a new application to the phone while testing, AIR asks me for an IP or Hostname. Presumably this is a security feature but I cannot seem to disable it (I have enabled installing from unknown publishers on the phone obviously) and as you can imagine it is incredibly annoying to have to enter this while developing an app.....
Sorry for the double post btw ![]()
Hey,
1.When you are compiling in the settings there is three options in render mode:
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!
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.
North America
Europe, Middle East and Africa
Asia Pacific