Sitemap
D3v!lXØr

D3v!lXØr

Junior Penetration Tester || Bug Bounty

Android Components

4 min readApr 20, 2026

Not long ago, I started Android Development, and I wanted to study from the very beginning to better understand things before getting into Android Pentesting.

In this post, I’ll write a quick overview of the Four Android Components — what each one is, a brief about it, and how it works.

━━━━━━━━━━━━━━━━━━━━━

🧩 First: Activities

Activities are the main interface that the user interacts with — whether it’s apps, actions, or anything else. Almost anything the user sees on the Android screen is considered an Activity. (From an external perspective for now, since we’ll get into what’s behind the Activity and how it works later.)

The Activity has something called a Life-Cycle, which means its life cycle — basically how the Activity works from the moment it starts until it ends.

We have several definitions within the Life-Cycle:

▪️ onCreate() — Called when the Activity is created. In simple terms: the first time we create an Activity, what happens based on that.

▪️ onStart() — Called when the Activity starts. Example: when you open a specific app and a notification pops up — that’s a reaction to the onStart() function in the code, meaning “as soon as the app starts, do this.”

▪️ onResume() ▪️ onPause() ▪️ onStop() ▪️ onDestroy()

Each one explains itself by its name. I’ll leave a resource below to explain each one in detail if something isn’t clear, just to keep this short.

━━━━━━━━━━━━━━━━━━━━━

⚙️ Second: Services

This one is the back-end code that runs in the background — it executes processes without using the UI, and the running priority is determined based on its type.

Simply put: the Activity is the Front-end, and the Service is its Back-end.

It’s basically code that runs without a UI, and it comes in 3 types:

▪️ Background Service — Runs completely in the background with no connection to the UI.

▪️ Foreground Service — Runs in the background but has something tying it to the UI. For example, when a voice recorder is running, its notification appears in the UI and lets you control it.

▪️ Bound Service — Bound to a currently running Activity in the UI.

These types are prioritized in this order:

  1. Bound Service
  2. Foreground Service
  3. Background Service

Why? Because the first two send a signal to the system that “this notification is important to me” — even if you close the app, the recording keeps going. Unlike a Background Service, which stops as soon as you close the app.

Get D3v!lXØr’s stories in your inbox

Join Medium for free to get updates from this writer.

━━━━━━━━━━━━━━━━━━━━━

📡 Third: Broadcast Receiver

It’s basically a broadcast to the System.

You might think I’m joking — but I’m not, that’s literally what it is, just in a slightly technical sense.

It’s a broadcast that happens as a result of a certain action, and it’s received by apps that have a Broadcast Receiver.

Example: When you plug headphones into your phone, don’t you get a notification that they’ve been connected? Right — and based on that, other apps also know the headphones were plugged in. Apps like SoundCloud, WhatsApp, Messenger, and others — because naturally, you’re going to listen and talk through them.

How did those apps know? Because the System sent a message to all apps on the device that headphones were connected, and every app with a Broadcast Receiver picked up that message and reacted accordingly. Of course, some apps don’t have a Broadcast Receiver because they simply don’t need it — like the Calendar, for example.

That’s the idea behind Broadcast Receiver in simple terms.

━━━━━━━━━━━━━━━━━━━━━

🗄️ Fourth: Content Provider

Simply put, it’s an API used to transfer data from one app to another.

Its main purpose revolves around accessing one app’s data and passing it to another app that needs it.

A couple of questions here:

❓ Why doesn’t the app that needs the data just get it directly from the device’s database instead of going through another app?

❓ And how does the app sharing the data share it in the first place?

For the first question: Say you have a database of names and contacts on your phone, and obviously the Phone app has permission to access it. When you install Truecaller, it needs that data — and to get it, there are two ways:

▪️ Directly from the device’s local database. ▪️ From the Phone app itself.

So why get it from the Phone app and not directly from the database? To keep the device and its data safe — because allowing an external app direct access to the local database could be a security risk. So as the Phone app, I’ll give Truecaller exactly the data it needs through a Content Provider, and any updates to that data will be passed along too.

So the Content Provider is basically a link between apps to share specific data with a specific app — because you don’t need to give it full access to all your data when you can just give it exactly what it needs through a Content Provider.

━━━━━━━━━━━━━━━━━━━━━

That was a brief explanation of the Four Android Components based on my own understanding Of course, there’s a chance I got something wrong — I’m only human.

If I’m wrong, it’s from me and from the devil. If I’m right, it’s from God, and God is the one we seek help from.

Please keep me in your prayers 🌹

#AndroidDevelopment #AndroidPentest #MobileSecurity #CyberSecurity

--

--

D3v!lXØr
D3v!lXØr

Written by D3v!lXØr

Junior Penetration Tester || Bug Bounty