I want to do optimization of my android application.
Can anyone please 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With