troubleshoot Android Application
After I launch my app, I see my startup activity with the title bar and a blank screen. After a long delay (about 8 seconds), I finally see my splash screen.
This behavior is inconsistent....it can be a delay from 2 seconds (the time I specified in the code) to 8 seconds.
Can someone suggest a plan to diagnose the issue? What tools are available to use and what resources 开发者_开发技巧should I be looking at?
Thanks!
This is often the case if you are loading a lot of resources into memory, if you could show some of your code it would be useful.
I have found that some people that have used soundpool to load all the sounds in their app in the oncreate, however this is slow and takes up lots of memory (Should use create a mediaplayer instance and give it sounds while your app is running)
look into the logfile. Open a command line console and go to the tools directory of the Android SDK and type
adb shell logcat
Or if you develop with Eclipse, there's also a logfile output there, switch to the DDMS perspective, there you see a 'logcat' tab.
精彩评论