How can I speed up loading time on Android?
Copy link to clipboard
Copied
Hello!
I'm creating an AIR app for Android and I've run into an issue with the loading time: when the user first clicks on the icon, there's 10 seconds of black screen before the first screen of my app appears. At least this happens on older Android devices. The delay is only a second or two on newer devices. I know this question has been asked before:
http://forums.adobe.com/thread/764981
http://forums.adobe.com/message/4035208#4035208
http://zehfernando.com/2011/a-mobile-air-application-post-mortem/
But I haven't been able to find an answer that's worked for me. I've tried a a preloader and I've found that even loading the tiniest app takes around 10 seconds. This is how long it took me to load an app that was just a single frame with a simple rectangle image in it. From what I've read, the issue is that the Android device is loading the AIR runtime, and this takes time - no matter how small the actual app is. I should add that I'm using captive runtime.
I'm OK with the performance on new Android devices but, as far as I can tell, Android is so fragmented that many people are still running older devices and OS versions. So, I'd like to provide a good user experience on older devices. I think a ten second wait is just too long and will kill the entire experience for many people.
Is there any update on this? Does anyone have a solution?
If I can't improve the loading time, I think I'll try to only make the app available for newer devices.
I've heard people taking about creating 'native wrapper' and somehow embedding their swf file in native code that has a loading screen. Has anyone got something like this work? I'm currently reading up on Android splash screens in native code. They seem relatively simple to create. I hope I can somehow embed my swf in a native program with a splash screen. Any help is appreciated!
Thanks!
Damian
Copy link to clipboard
Copied
Do you embedding all app resources to app im swf or load it separately using urlloader or file?
Copy link to clipboard
Copied
Anton,
Thanks! I've tried both ways - embedding assets & using a URL loader/preloader. I get the same 10-second delay on older Android devices with both approaches.
Damian
Copy link to clipboard
Copied
Ok. Do you tried to lanuch simple empty project where just one textfield "Hello world" appear? Just to determinate it's realy slow decoding or somthing with your project?
Btw, do you use Air 4 from beta? from jan 28th
Copy link to clipboard
Copied
Hi Anton,
Yes, I tried launching an empty project with just one frame and a simple rectange image embedded in it. This also took 10 seconds to load. Yes, I'm using AIR 4.0 as well. As far as I can tell, the issue is AIR itself is taking time to load onto the device - and this is independent of what I put in my program. I think I have three options:
1. learn to live with the delay
2. decide it's too long and not support older Android devices with my app
3. figure out if I can embed my swf in a "native wrapper" as suggested in one of my original three links.
I'm hoping to do 3, but I don't know if it's possible.
Damian
Copy link to clipboard
Copied
Also there can be step 4 but I don't have any device to test. I think apk embed compressed swf. And all this 10 sec Adobe Air is decompressing swf or similar. Maybe there some to decompress it before pack to apk? ) With IOS this don't happened because ABC code excluded from SWF and putted to the binary
Don't know what there with android.
but seems to long load it's old cpu that decode binary before load it to the memory
Copy link to clipboard
Copied
Anton,
Thanks again! This helps. I'll try to give it a go and report back on this forum what I learnt. Cheers, Damian.
Copy link to clipboard
Copied
Not sure if this will make difference, but you might want to try zipaligning your apk, as well:
http://developer.android.com/tools/help/zipalign.html
Also, if you absolutely need to guarantee a particular level of performance, you can always set a filter in the app manifest to exclude devices that are underpowered:
Copy link to clipboard
Copied
AsterLUXman,
Thanks! I'll give it a try.
