Check the performance of the application?
Hey, I finished my code and everything works as it should but I'm wondering since smartphones have limite开发者_开发问答d battery, CPU .. How can I check if my application will run good on older phones? and how can I check if my app consumes the phones battery? Thanks
The only way to really know it to test the app in the phones.
That said, you can profile it and make educated guesses based on how CPU-intensive is your app, for how long is it running, if you have services using cpu continuously, etc.
There are a few things to consider:
- The main battery drain is the screen. If you keep any kind of screen lock (even dim), it will destroy the battery.
- Any other lock (wifi, etc.), will induce battery drain. Do you use them? Do you need them? Do you release them as soon as they're not needed?
- Do you have hardware listeners (e.g., location, accelerometer), unregister them as soon as they're not needed
Take a look at this video: http://www.google.com/events/io/2009/sessions/CodingLifeBatteryLife.html
Also take a look on http://developer.android.com/guide/developing/debugging/debugging-tracing.html
精彩评论