
This video gives an overview of the entire course.
Unnecessary allocations are often made inside the loops. We will discuss how to overcome that.
• Discuss how a typical for-loop works
• Discuss how for-loops are usually used by developers
• Mention that allocations should be kept out of loops if possible
Developers often see StackOverFlowException but they don’t know what it is.
• Look at what this Exception does and why it exists
• See how to invoke this Exception
• Understand how to avoid this Exception
Images consume a lot of memory. If not handled with care, they can cause OutOfMemoryErrors.
• Look at how an OutOfMemoryError can happen
• Show a code that helps load images more efficiently
• See how to load libraries more easily with libraries such as Glide
Memory analysis is something every developer should know how to do.
• Show how to launch the Memory Profiler
• Learn the various components of the Memory Profiler
• Track the memory of our app
Tracking allocations can help find memory leaks and errors in execution.
• Look at how to create a heap dump
• Understand how to analyze the heap dump
• Give an example of our app’s heap dump
Memory leaks are an oft-forgotten aspect of software development. Here, we discuss them in detail.
• Start by defining how memory is allocated
• Discuss the garbage collector
• Look at how a memory leak can occur
Finding memory leaks is very tedious. Here, we show how to find them easily using LeakCanary.
• Understand how tedious finding memory leaks is
• Talk about the LeakCanary library
• Find a few memory leaks using LeakCanary to show how easy it is
Static references are a common source of memory leaks. Here, we discuss how to fix it.
• Define what a static reference is
• Look at how it can cause a memory leak
• Mention how to fix this sort of a memory leak
Anonymous inner-classes are a common source of memory leaks. Here, we discuss how to fix it.
• Define what an anonymous inner-class is
• See how it can cause a memory leak
• Mention how to fix this sort of a memory leak
Non-static inner-classes are a common source of memory leaks. Here, we discuss how to fix it.
• Define what a non-static inner-class is
• Look at how it can cause a memory leak
• Mention how to fix this sort of a memory leak
This video is about the importance of keeping non-UI tasks (such as a network request) on a background thread.
• Talk about threads and the dedicated UI thread
• Look at how to run a task in the background using AsyncTask
• Explore how to run a task in the background using the Thread class
This video shows how to analyze network request results using the Network Profiler.
• Show how the user can launch the Network Profiler
• See some of the components of the Network Profiler
• Analyze some of the images we download in our app
This video talks about the importance of keeping your app responsive while making a network request.
• Understand that keeping your user waiting is a bad idea
• Mention that keeping your app responsive at all times is the best
• See how to accomplish this using AsyncTask’s methods
In this video, we will discuss some details about the UI thread that helps in developing a performant app.
• Begin showing how we can invoke code on different threads
• See how to check which thread you’re on when debugging
• Understand how to check which thread you’re on in your code
In this video, we talk about flat vs nested view hierarchies. We end with a discussion on ConstraintLayout.
• Define what flat and nested view hierarchies are
• Mention some drawbacks with classical layouts such as LinearLayout and RelativeLayout
• See the ContraintLayout and how to use it in Android Studio
In this video, we discuss the Layout Inspector, how to launch it, and some of its features.
• Begin by showing how to launch the Layout Inspector
• Learn about some of its features
• Inspect our UI
In this video, we talk about Developer Options and how they can help debug your app.
• Show how to enable developer options
• Explore different features available in Developer Options
• See how to add some of the options in the notification system bar
Doze mode and App Stand-By are new concepts that need to be learned.
• Define Doze mode and App Stand-By
• Explore some ways for the developers’ app to accommodate working with these modes
• Give recommendations to allow their apps from draining much battery
Battery management is a difficult topic to tackle. Here, we discuss the method of Lazy First to help manage the battery.
• Define the 3 tenants of Lazy First
• Go into a bit more detail into managing the battery drain by using Android’s APIs
• Discuss Battery Historian a bit and give a link for more information
Developers often forget that they are working within an ecosystem, and they forget to keep the user’s happiness in mind.
• Begin with some nuisances that apps can establish that would turn the users away
• Give some advice on how they can build apps that fit with the other apps
• Learn about having less notifications to not annoy users
Have you started developing an Android application only to find the app is slower than you expected? Or that certain tasks are not working as you expected? Dealing with performance issues on Android is a common experience many developers face. Performance is a key requirement in any good app that user's don't necessarily look for, but experience every time they open an app.
If the earlier questions apply to you, look no further! This course will help you overcome common performance issues on Android. In this course, we go over the important and common areas that can affect performance such as memory, network, UI, and battery. We delve into issues such as memory management, where we will look at memory leaks and tracking allocations. We also look at optimizing your user experience when working with data on the cloud. We also go into some common pitfalls when working with your UI and how to debug it. Finally, we look at ways to optimize and debug your app's battery usage to ensure that it doesn't annoy users when they've installed your app.
When you're completed with this course, you will be developing applications more efficiently, without having to worry about your code affecting the performance that your users experience.
About the Author
Yusuf Saber is an Android developer with over 5 years' professional experience. Yusuf earned his Master's degree in Computer Engineering from Ryerson University in 2011 and started his career as a .NET developer before quickly turning to Android. He has worked on a large range of Android apps, from social to multimedia to B2B—and more! You can see some of his public apps on Google Play too