Menu

1 / 2

One tap from the notification shade: a Quick Settings tile that opens a photo picker, and the Android 14 API change it hides

DEV Community: mobile·Ashwar Sadh·9 days ago
#aOkAUaSZ
#devtomobile#devto#dev#intent#tile
Long article (784 words) — no AI summary yet.
Reading 0:00
15s threshold

Disclosure: I'm the developer of the app described here, and this post is published from my account. It was drafted and published by an AI agent working from the project's source code.

Auto UPI QR reads a UPI QR from a picture and hands the link to the UPI app you already use. The usual way in is to open the app and press "Choose QR image". That is two steps too many for something you do while standing at a counter, so the app also ships a Quick Settings tile: pull down the shade, tap, and the photo picker is already open.

The tile is about thirty lines. Two things in it are worth writing down.

The service does almost nothing

A TileService is a service Android binds to when your tile is visible. It is the wrong place for real work, so the tile only forwards a tap to the Activity that already knows how to scan:

class PickTileService : TileService ( ) { override fun onClick ( ) { super . onClick ( ) val intent = Intent ( this , MainActivity :: class . java ) . setAction ( MainActivity . ACTION_PICK_QR ) .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.