Optimization of Android Applications [closed]
I want to do optimization of my android application.
Can anyone 开发者_如何学Goplease tell what are different ways to optimize code and performance in android?
I gone through one tool i.e. Zipalign: an Easy Optimization.
Any other tools avaliable?
Thank you.
There's no easy tool that just magically makes your app faster (zipalign just improves loading times). You'll need to learn how to write performant code. The SDK has some useful tips: http://developer.android.com/guide/practices/design/performance.html
If you have some CPU-intensive heavy lifting, you can rewrite that with the NDK.
Keep in mind that optimizing code will take time and can introduce bugs. Be sure to profile your code, find bottlenecks, and focus on getting those fast.
Best practices are typically kinda obvious. Your application is most likely going to have specific unique bottlenecks. Check the android logs while your phone checks (Set a filter up) as the application runs. Check when the operating system is calling the garbage collector and how much information its removing.
If you are loading any files into memory be aware that android places (At least used to) a limit on the max size a file is (4mb) that can be loaded into memory.
What type of sensors are you using, if any... and if so in what way and is there a better way you can be using said sensors.
Are you storing to much / to little state in the application lifecycle steps.
Don't forget to remove all logging in the market version. Logging is expensive and the market only returns exceptions. Logging is mostly unnecessary and should only be used while developing...
Although this is an old topic, thought I would post for future visitors about the ARO tool that can help optimize app performance http://developer.att.com/developer/legalAgreementPage.jsp?passedItemId=9700312
精彩评论