I’m new to Android (and Java for that matter) development. I thought I was doing well – I have an app that reads in XML files, parses into a SQLite database, pulls from the database to populate different site sections (scrollable lists of news items)…etc. I’m using AsyncTasks for the importing process…etc.
BUT – my app takes FOREVER (15-25) seconds to load the first time, and ~10 seconds every time I switch sections (parses a single XML file into a SQLite database, and populates a listView).
Compared to the iPhone app, which takes 2-3 seconds to switch sections…
TLDR:
How do I determine what’s causing my app to run slow? Is there a thread monitor or something – some way to view what’s taking so long other than just putting Log.d()’s throughout?
I think traceView contains too much information, you can easily get lost.
My solution is just log the system time at three place in the code.
Before and after and center at the potiential slow code.
like binary search, next time, narrow it down step by step, then finally find the culprit code.