Troubleshooting Android Performance
4.1 (3 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
20 students enrolled

Troubleshooting Android Performance

Smart and simple solutions to overcome common performance issues with Android
4.1 (3 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
20 students enrolled
Created by Packt Publishing
Last updated 4/2019
English
English [Auto]
Current price: $86.99 Original price: $124.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 2 hours on-demand video
  • 1 downloadable resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Detect memory leaks and fix them before they ruin your users’ experience.
  • Load images efficiently without using too much memory.
  • Work with the cloud in a way that will be seamless to your users.
  • How to work with the UI thread and how to run non-UI related tasks in the background for more pleasant user experience.
  • Debug your UI and manage the way you want it to look.
  • Ways to optimize your app for good battery usage.
Course content
Expand all 21 lectures 02:14:25
+ Understanding and Analyzing Memory Usage
6 lectures 41:36

This video gives an overview of the entire course.

Preview 03:07

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

Optimizing Your Loops
09:42

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

StackOverflowException
07:04

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

Loading Images
09:47

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

Analyzing Memory Using the Memory Profiler
07:47

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

Tracking Allocations
04:09
+ Avoiding Memory Leaks
5 lectures 21:42

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

Preview 03:44

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

Find Memory Leaks with LeakCanary
06:30

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

Common Memory Leak: Static References
04:27

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

Common Memory Leak: Anonymous Inner-Classes
03:44

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

Common Memory Leak: Non-Static Inner Classes
03:17
+ Managing Cloud Connectivity Issues
3 lectures 20:42

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

Making Requests Asynchronously on a Background Thread
12:30

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

Analyzing Results with the Network Profiler
04:14

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

Using Your App While a Request Is in Progress
03:58
+ UI Analysis and Optimization
4 lectures 34:10

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

Preview 06:32

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

View Hierarchies
09:08

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

Debug Your Layout with the Layout Inspector
08:10

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

Using Developer Options to Get More Information on Your UI
10:20
+ Battery Optimizations
3 lectures 16:15

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

Doze Mode and App Stand-By
06:29

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

Lazy First
05:22

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

Android: An Ecosystem
04:24
Requirements
  • Some basic knowledge of Android development and Android Studio is assumed.
Description

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

Who this course is for:
  • This course is specially designed for beginner Android developers who want to get rid of common errors and pitfalls in order to improve Android performance.