BeCuriouzBeCuriouz

Learn something new every day

📱 Mobile Programming
📨

How Android apps ask each other for favors

💡 An explicit Intent names exactly which component runs; an implicit Intent describes an action and lets Android match it to any app whose manifest intent filters volunteer to handle it.

On Android, an app rarely does everything itself. When you tap "Share" and a chooser pops up with WhatsApp, Gmail, and Drive, that's an Intent at work — a small messaging object that says what you want done without necessarily saying who should do it.

There are two flavors. An explicit Intent names the exact component to launch — Intent(this, DetailActivity::class.java) — and is used for navigation inside your own app; it always reaches its target. An implicit Intent only declares an action and data, like ACTION_SEND with type = "text/plain", and lets the OS find any app that volunteered to handle it.

How does the OS know who can help? Every app declares intent filters in its manifest — , , and tags saying "I can handle ACTION_SEND for text/plain." The system matches your implicit Intent against these filters, and if several apps qualify, it shows the chooser. One security rule follows directly: never use implicit Intents for sensitive work like starting a service — always name the component explicitly, because a filter is an invitation, not a guarantee of who answers.

📨 How Android apps ask each other for favors — BeCuriouz