Skip to content
Language: EN

Can an Android app react to a tag without showing a screen?

Not entirely. Android delivers a tag by starting an activity, so there is always one, and the phone looks for tags only while it is unlocked. The closest thing to silent is an activity that draws nothing and finishes itself before it is resumed, a case for which the platform provides a theme.

A tag always starts an activity

The Tag reference describes one destination for a discovered tag: a single activity, started with startActivity. No service, receiver or job appears in that path.

Reader mode and foreground dispatch do not change that. Both need an activity in the foreground, so they serve an app that is already open, not one reacting from the background.

An activity that draws nothing

Android ships a theme for this case. The R.style reference describes Theme.NoDisplay as the theme for activities that do not display a UI, because they finish themselves before being resumed.

That timing is the constraint. The work has to fit before the activity would be resumed, which rules out a long exchange with the tag and suits content that arrived with the intent.

Content usually does arrive with it. The NFC basics guide makes the EXTRA_NDEF_MESSAGES extra mandatory on ACTION_NDEF_DISCOVERED, so the parsed messages are there without a further read.

Anything longer belongs to a component made for background work: the activity reads the message, hands the work over, and finishes.

What still limits it

The phone has to be looking. The NFC basics guide says Android devices usually look for tags while the screen is unlocked, so a locked phone in a pocket reacts to nothing, however quiet the activity.

The user hears the tag even when nothing appears. The platform plays its discovery sound, and the flag that silences it belongs to reader mode, which needs a visible activity.

The app has to be eligible. From Android 17, the documentation says NFC intents are no longer dispatched to an app in a stopped state, never launched by the user or force stopped, and from Android 16 users can refuse tag intents app by app.

Web links are a separate case. From Android 16 a tag holding an http or https link goes to ACTION_VIEW, and from Android 17 it waits for the user to act on a notification, so a silent reaction to a web link is not on offer at all.

When a visible screen is better

A tap is a question, and silence is an ambiguous answer. The user cannot tell an action that ran from a tag that failed to read, and the next tap, meant as a retry, runs the action twice.

So confirm, even briefly, with a notification or a short message. A fully silent reaction suits actions whose effect shows elsewhere, such as a light that switches on.

Where the action already lives in a routine app, that app handles this for you, as the Android routines page describes.

Frequently asked questions

Can a service read tags in the background?

No documented path allows it. Dispatch starts an activity, and reader mode and foreground dispatch both require one in the foreground.

Does it work with the screen off?

Usually not. The documentation says devices look for tags while the screen is unlocked, and manufacturers can differ, so it has to be tested on each model.

Will the app receive tags if the user never opened it?

Not from Android 17. The documentation says NFC intents are not dispatched to an app in a stopped state, which includes one the user never launched.

Can the discovery sound be turned off?

Only in reader mode, with FLAG_READER_NO_PLATFORM_SOUNDS, and reader mode needs a visible activity. A silent activity is silent on screen, not to the ear.