How to Add Custom Quick Settings Tile in Android App

There are still a lot of ways to enhance your Android app’s seamless experience.

One interesting way to do it in Android is by using Quick Settings tiles.

What is Quick Settings Tile?

Quick Settings tiles are tiles that are displayed in the Quick Settings panel shown below.

Quick Settings panel containing tiles that can be clicked by users. The VPN tile can be turned on (left image) and off (right image). (Source: Android documentation).

Each Quick Setting tile represents an action that you expect users to access often and/or need fast access to. This is just perfect for our quest to enhance user’s seamless experience!!

You can read several Quick Settings tiles’ best practices to follow on the Android documentation. In this article, we’re only going to show you how you can start adding Quick Settings tile to your app.

How to Add Quick Settings Tile?

Let’s use Bobobox app as our example once more.

If you’re staying in Bobobox, when you’ve checked in to your hotel/cabin, you would be able to control your room with your app like shown below:

In Bobobox, you can control your cabin directly in your app!

As you can see, you can turn on and turn off your room’s door lock, windows blur, and lights. Let’s replicate these functionalities with Quick Settings tile!

1. Create a new class that extends TileService. As shown in the code snippet below, we’re creating a class that will control a cabin’s door lock state. The most important thing to notice here is the usage of onClick method to determine the behavior when user clicks on the tile.

2. The next thing you need to do is to register your TileService class to your app’s AndroidManifest.xml file like shown below:

3. That’s it! Now you can run your app and see the Quick Settings tile in action:

Turning on/off your cabin’s door lock via Quick Settings tile. (Disclaimer: This is just a demonstration for this article and might not be representative of the real Bobobox app).

That’s the basic of adding Quick Settings tile! You can tweak and improve upon this concept according to your own app’s needs.

Happy coding!

Do you Like this Article?

Leave us some claps 👏 and follow our Medium publication for more articles like this.

And don’t forget to download our app on your Android or iOS and book your first room in Bobobox! 😀

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store