There are many practices you can follow to improve an Android app's performance and memory usage. These techniques are sometimes called "micro-optimization", since each change might only result in a very small amount of improvement. Before optimizing your app you should measure its current performance, so you can find out after optimization what benefits you've achieved.
- [Voiceover] Java developers are used to…optimizing their code for particular platforms.…The coding techniques that work for one platform…might not be the best for another platform.…Optimizing your code can help improve…the performance and memory usage of your app.…Now you might not need to optimize,…and in fact, many developers feel…that you should only do these optimizations…if you detect that there are problems with your app.…These are sometimes called micro-optimiziations.…
In some environments making the kinds of code changes…I'm going to describe here…might not result in observable improvement,…but if your app is having performance issues,…these are some of the things you can look at…to improve the situation.…All of the suggestions I'm going to make…can be summarized in a couple of recommendations.…Don't do work that you don't need to do…and don't allocate memory if you can avoid it.…All of these optimization suggestions…are driven by the reality that a mobile device doesn't have…the same amount of memory or processing power that,…
Watch these Java tutorials to learn smarter, more efficient methods for Android app development.
- Preparing the development environment
- Packaging and running Android apps
- Optimizing Java code for Android
- Implementing event handler interfaces
- Defining custom callback methods
- Working with the Android SDK's Java packages
- Storing data
- Reading text files
- Parsing JSON and XML data
- Managing device sensors
- Playing audio