From the course: Writing Secure Code for Android by Infosec

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Android IPC, part 8: Threads

Android IPC, part 8: Threads

- Android IPC. Part 8: Threads. Let's talk a little bit about threads, because some people get them confused with services, and they're not the same thing. Regardless of the application, a thread is the smallest unit of executable code. The heart of the operating system, the kernel, schedules threads to run on the CPU. Now, your app could have one thread, the main thread, or it could have multiple threads, and I want to talk about multiple threads in a bit. A service, on the other hand, is an app component that runs, usually, in the background. I mean, some services can be in the foreground, but typically the user does not interact with the service, it runs in the background, doing whatever it's doing. The kicker is that, by default, services run on the app's main thread, which provides an opportunity for Denial of Service, and what we call blocking. Blocking is, okay, so I trigger this service to download something, okay? And if it runs on the main thread, I'm sitting around…

Contents