Quick Settings tiles sit at the top of the notification shade and give you one‑tap access to frequently used actions—Wi‑Fi, Bluetooth, flashlight, and more. Android’s TileService API (available from Android 7.0 Nougat, API 24) lets any app expose a custom tile. This can be handy for:
If you prefer not to write code, the guide also points to a ready‑made open‑source sample you can install directly.
Before you can install a custom app, you need to allow USB debugging:
Connect the phone to your computer with a USB cable and verify the connection:
adb devices
You should see your device’s serial number listed as “device”. If it shows “unauthorized”, confirm the prompt on the phone.
Below is a minimal example written in Kotlin. The same logic works in Java with only syntactic differences.
package com.example.customtile
import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
class MyTileService : TileService() {
override fun onStartListening() {
super.onStartListening()
// Update the tile appearance each time the shade opens
qsTile?.state = Tile.STATE_INACTIVE
qsTile?.label = "My Tile"
qsTile?.updateTile()
}
override fun onClick() {
super.onClick()
// Toggle the tile state and perform an action
if (qsTile?.state == Tile.STATE_ACTIVE) {
qsTile?.state = Tile.STATE_INACTIVE
// Example action: launch a website
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://example.com"))
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
startActivityAndCollapse(intent)
} else {
qsTile?.state = Tile.STATE_ACTIVE
}
qsTile?.updateTile()
}
}
Key points:
TileService is a foreground service that Android treats specially; it does not need a separate permission.onStartListening() to set the tile’s initial label, icon, and state.onClick() to define what happens when the user taps the tile.Next, declare the service in AndroidManifest.xml:
<service
android:name=".MyTileService"
android:label="My Tile"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
Optionally, you can provide a custom icon by adding a drawable resource and referencing it with the android:icon attribute.
If you are using Android Studio:
MainActivity with the MyTileService code above (you can delete the activity entirely if you don’t need a UI).AndroidManifest.xml as shown.minSdkVersion to 24 (or higher) in build.gradle.
android {
compileSdkVersion 34
defaultConfig {
applicationId "com.example.customtile"
minSdkVersion 24
targetSdkVersion 34
versionCode 1
versionName "1.0"
}
}
./gradlew assembleDebug to generate an .apk file.adb install -r app/build/outputs/apk/debug/app-debug.apk
If you prefer not to compile anything, you can download a pre‑built sample (e.g., the “SimpleTile” project on GitHub) and install it directly with the same adb install command.
After the app is installed, Android does not automatically place the tile in the Quick Settings panel. You need to add it manually:
The tile is now ready. Tapping it will execute the code in onClick(). In the example above, the first tap opens a web page; subsequent taps toggle the visual state.
Common issues and how to resolve them:
BIND_QUICK_SETTINGS_TILE permission and that the app’s targetSdkVersion is 24 or higher.adb logcat and filter for MyTileService to view stack traces.SharedPreferences and restore it in onStartListening().Use the following ADB command to force‑stop the app if it gets stuck:
adb shell am force-stop com.example.customtile
Because a TileService runs in the context of its host app, it inherits all of that app’s permissions. Keep the following in mind:
If writing a full app feels heavyweight, consider these options:
These methods are quicker but offer less control over the tile’s appearance and state.
Creating a custom Quick Settings tile gives you a powerful shortcut right at your fingertips. By following the steps above you can:
TileService app.Once you’re comfortable with the basics, you can extend the tile to control smart‑home devices, toggle VPNs, or even display live information like battery level or weather. The only limit is your imagination and the permissions you responsibly request.









