classes in referenced libraries taking forever to load

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

classes in referenced libraries taking forever to load

Postby junglemason » Tue Jul 13, 2010 9:05 pm

Hi all,

I'm referencing and using Ostermiller Utils and Joda Time in my project. After my app gets built and installed in the running emulator, it starts up, and as soon as I hit a class which I am using from a referenced library (this happens in the first activity), there is a 10-second pause while it tries to load that class. Every time after that, it loads quickly (until I reinstall again). Is this normal? Even though it's only the first time the app loads, I can't have the 10-second black screen (end users are anything but patient).

Cheers,
Rich
junglemason
Freshman
Freshman
 
Posts: 6
Joined: Tue Jul 13, 2010 8:44 pm

Top

Re: classes in referenced libraries taking forever to load

Postby Chrystian » Wed Jul 14, 2010 4:39 am

Do you get the same 10 second delay in a handset or only in the emulator? I ask this question, because as you probably know the emulator can be somewhat slow even on relatively powerful computers.
--
Chrystian Vieyra
Chrystian
Junior Developer
Junior Developer
 
Posts: 18
Joined: Mon Jul 12, 2010 2:58 am

Re: classes in referenced libraries taking forever to load

Postby nicholas.hauschild » Sat Jul 17, 2010 10:02 pm

Yes, try to run it on an actual device. You will notice a much, much smaller delay! :)
nicholas.hauschild
Master Developer
Master Developer
 
Posts: 310
Joined: Fri Dec 04, 2009 4:50 am

Re: classes in referenced libraries taking forever to load

Postby junglemason » Fri Jul 23, 2010 10:49 pm

Thanks for the replies.

On the ADP2 I still get a 1-2 second delay. Not nearly as bad as the simulator. Still a little troubling, but if that is common in Android apps, then I can live with it for now.
junglemason
Freshman
Freshman
 
Posts: 6
Joined: Tue Jul 13, 2010 8:44 pm

Re: classes in referenced libraries taking forever to load

Postby junglemason » Sun Jul 25, 2010 11:02 pm

I think maybe the referenced libs was not my only problem (as you may have sensed). I was also doing a few other things in the UI thread which I should have been doing in a worker thread.

I have a pretty smooth loading app now, thanks primarily to three things:

1. Using a custom style/theme to set the background image of every activity so that the screen is not completely black while it's loading.
http://android-developers.blogspot.com/ ... speed.html

2. Do a few first-time heavy tasks (access referenced libs, copy a sqlite database into place, etc) in a worker thread using AsyncTask
http://www.screaming-penguin.com/node/7746

3. Showing a progress dialog while referenced libraries and database copying was happening only the first time you run the app. Hitting the referenced libraries for the first time still does take a few seconds, but now there is a "First Time Loading" dialog to let the user know there is not a problem.
junglemason
Freshman
Freshman
 
Posts: 6
Joined: Tue Jul 13, 2010 8:44 pm

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 4 guests