Understanding Settings Panels in Android Q

Understanding Settings Panels in Android Q

With Google launching Android Q, Lot of exciting features has also popped up. One amazing feature is Location Service usage and few more.

In this blog, we will talk about 3 Settings options specifically.

  • Internet Connectivity(also Wifi specifically) : It shows the setting screens including Mobile data, Wifi, Airplane mode etc
  • NFC Connectivity : It shows setting screen of NFC
  • Volume Adjustment Settings : It shows the setting screen of Volume adjustment including Call, Music and rest all audio settings.
All these 3 above mentioned setitngs are part of Settings panel package. It allows the user to navigate within settings in the app. This was much needed feature to prevent the user from leaving the app and navigate to the settings screen to perform some action

Let's start by configuring the project with following config in build.gradle targetting Andorid Q,

android {
    compileSdkVersion 'android-Q'
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 'Q'
    }
}

Now, let's talk about them one by one,

Internet Connectivity :

To launch the Setting Panel for any specific setting requires very less line of code.

To launch the Setting Panel of Internet Connectivity,

startActivity(Intent(Settings.Panel.ACTION_INTERNET_CONNECTIVITY))

It will show a popup like the following,

Understanding Settings Panels in Android Q

From the above screen,

  • You can select from Wifi/Mobile data
  • By clicking See More you can goto Network and Internet Setting Page

Few Use Cases to have a setting like this :

  1. While the user is using some feature in your app where you need internet connectivity, instead of showing No Internet Screen now we can show them the above screen to check the connection

NFC Connectivity :

If you want to enable NFC in your phone and provided Your device supports NFC, we can launch the popup of NFC using,

startActivity(Intent(Settings.Panel.ACTION_NFC, REQUEST_CODE_NFC))
Understanding Settings Panels in Android Q

Currently my emulator has no NFC Feature but a toggle will be available if your device supports NFC.

From the above screen,

  • If the user clicks See More they will navigate to Connection and Preference Screen in Settings

Few Use Case of the above Setting,

  • If the user wants to transfer the data using NFC, they can directly work around with it without leaving the app.

Volume Adjustment Setting :

If you want to control either of Media, Alarm, Call and Ring volumes you might want to use the new volume settings of Android Q.

startActivity(Intent(Settings.Panel.ACTION_VOLUME))

This will launch the below popup,

Understanding Settings Panels in Android Q

and if the user clicks the See More option, user can move to Sound Screen.

A Typical use case of the above-mentioned feature can be, handling the volume of any media file(eg: Listening to an audio file).

This is how we can play with the Settings Panel of Android Q.

You can learn more about it here .

Happy Learning :)

Team Mindorks