开发者

Optimization of Android Applications [closed]

开发者 https://www.devze.com 2023-01-13 03:54 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 9 years ago.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消