Learn about Services in Android, which can perform long-running operations in the background like downloading a large file or playing music. We'll explore both of these in a simple music player app!
Overview
Syllabus
Threads in Android
Every piece of code in Android runs inside a Thread. In this stage we'll learn all about Threads and the supporting cast that makes them work.
Chevron 10 steps-
Threads in Android
7:46
-
Threads and Runnables
4:54
-
Creating a Thread
1 objective
-
Extending the Thread Class
6:10
-
Extending Thread
1 objective
-
Handlers and Loopers and Messages! O my!
4:15
-
Thread and Friends
5 questions
-
Upgrading Our Thread
8:06
-
Handle it!
3 objectives
-
The Problem with Threads
1:58
Introducing Services
In this stage we'll introduce Services and start using a Service in our app. We'll start with the basics, but at the end of this stage we'll be doing all our app's downloading in a Service!
Chevron 9 steps-
Service Basics
7:25
-
Service Basics
5 questions
-
Services Are Not Threads
7:39
-
Stopping Services
7:18
-
Creating a Service
3 objectives
-
Handling Being Killed
3:13
-
Restarting a Service
3 questions
-
IntentServices
5:40
-
IntentServices
1 question
Bound Services
In this stage we'll move on from started Services and start learning about bound Services. At the end of this stage our app will be able to play and pause music that's running in a bound Service!
Chevron 9 steps-
Creating the Service
6:11
-
Service Lifecycle
5 questions
-
Prepare for Binding
6:00
-
Binding Initiated
7:40
-
Binding to a Service
2 objectives
-
Making First Contact
8:31
-
Using a Bound Service
4 objectives
-
Bound and Started
7:08
-
Bound Services
3 questions
But Wait There's More!
In this stage we'll learn about Processes and foreground Services. At the end of this stage our music Service will be running in the foreground on a separate Process than our Activity!
Chevron 10 steps-
Processes
4:30
-
Proccesses
5 questions
-
Using a Separate Process
6:24
-
Separate Processes
5 questions
-
Messengers and Handlers: Service
5:32
-
Messengers and Handlers: Service
2 objectives
-
Messengers and Handlers: Activity
11:48
-
Messengers and Handlers: Activity
4 objectives
-
Foreground Services
4:21
-
Foreground Services
3 questions