Affiliate links on Android Authority may earn us a commission.Learn more.

Update your apps for Oreo: Autosizing Text, Custom Fonts, Adaptive Icons & Notification Channels

June 18, 2025

In this tutorial, I’m going to show you how to implement a number of Android 8.0’s new features in your own Android projects. By the end of this tutorial, you’ll know how to:

Prepare your development environment

Before you can implementanyAndroid 8.0 features, you need to verify your development environment is up to date. For the best results, you should be using Android Studio 3.0 or higher, which currently means installing theAndroid Studio 3.0 Beta.

Next, open the Android SDK Manager and ensure you have the following installed:

Article image

To help keep things simple, I’m going to be adding Oreo features to a project that’s designed to support Android 8.0, so create a new project using the ‘Empty Activity’ template, and set the target SDK to Android O (API 26).

Before you can update an existing project with these features, you’ll need to open your build.gradle file, and then change its compileSdkVersion and targetSdkVersion to 26, and its buildToolsVersion to 26.0.0.

Article image

Autosizing TextViews

Android Oreo’s autosizing TextViews feature is designed to help you combat one of the biggest challenges of developing for Android: creating a single user interface (UI) that’s flexible enough to handle the wide range of screens your app may encounter.

Autosizing TextViews are capable of resizing their text to better suit the current layout; when the TextView has a small amount of text to display in a large area, it may scale your text up to avoid leaving awkward empty spaces in your layout, and when an autosizing TextView has a large amount of text to display it’ll scale that text down rather than cut it off mid-sentence.

Article image

When you select the ‘Empty Activity’ template, Android Studio generates a ‘Hello World’ TextView by default, so let’s look at the two different ways that we can add autosizing functionality to this TextView.

1. Granularity

Granularity is where you define the biggest your text can be (autoSizeMaxTextSize), the smallest it can be (autoSizeMinTextSize), and the scaling increment (android:autoSizeStepGranularity).

In the following code, the text can scale between 20 scale-independent pixels (sp) and 50sp, in increments of 5sp. We’re also adding the android:autoSizeTextType=”uniform” line, which is something you’ll need to add to every TextView where you want to use autosizing:

Article image

2. Preset sizes

If you want to be more specific then you can create an array of exact sp values; your TextView will then select the most appropriate text size from these available values.

If your project doesn’t already contain an arrays file, then you’ll need to create one:

Article image

Open your res/values/arrays file and define the values you want to use:

You then just need to reference this array using autoSizePresetSizes – and don’t forget to add that all-important android:autoSizeTextType line!

Downloadable custom fonts

In Android 8.0 custom fonts are now a fully-supported resource type, which is good news if you regularly use custom fonts to add extra personality to your app, or to emphasize important text.

There are two ways that you can add custom fonts to your applications: import the font’s .ttf file into your project, or add code that will request your chosen font from afont provider. If you opt for the latter, then once your app is installed on the user’s device it’ll request the custom font from the font provider, which will then fetch the necessary files and cache them locally. This means that you can use custom fontswithoutsignificantly increasing the size of your APK.

If you do want to use a font provider, thenGoogle Fontscurrently seems to be the best option, as the entire library is available via Google Play Services’ font provider.

Let’s look at how you’d apply one of the Google Fonts to our ‘Hello World’ TextView:

Pinned Shortcuts

Pinned shortcuts are a way of providing the user with easy access to your app’s most important content and functionality, via a shortcut that they can place on their homescreen.

If you want your app to offer one or more pinned shortcuts, then you need to start by verifying that the user’s default launcher actually supports pinned shortcuts:

If the ShortcutManager returns TRUE, then the next step is creating a ShortcutInfo object that defines the properties of the shortcut you want to create:

You pin your shortcut to the user’s homescreen, by implementing requestPinShortcut(). Here, I’m also ensuring that our app will receive a notification whenever this shortcut is pinned successfully, by creating a PendingIntent:

Once you’ve created a pin, you may update its content using updateShortcuts().

Adaptive Icons

Adaptive icons are Google’s latest attempt to bring a consistentshapeto application icons. In Android 8.0, Original Equipment Manufacturers (OEMs) such as Samsung and HTCcan provide amask, which is applied to all the application icons across their device – if an OEM provides a rounded mask, then all icons on this device will be round. If your app doesn’t support the adaptive icons feature and it winds up on a device that uses a mask, then your application is going to stand out – and not in the good way!

A rendered adaptive icon consists of three layers: a mask, which is provided by the OEM, and a background and foreground layer, which are provided by the developer.

If you created your project to target API 26, then it should already have a res/mipmap-anydpi-v26/ic_launcher.xml file, which contains all the code you need to specify which resources you want to use as your adaptive icon’s background and foreground layers:

If you’re working with a pre-Android 8.0 project, then you’ll need to create the res/mipmap-anydpi-v26 directory and ic_launcher.xml file manually, although you can still use the above block of code.

To create an adaptive icon, you just need to replace drawable/ic_launcher_background and  mipmap/ic_launcher_foreground, with your own resources.

Any drawables you use for these layers must be 108×108 dpi, although only the inner 72×72 dpi will appear inside the mask. The system also reserves the outer 18 dpi for animations that the device may display when the user interacts with application icons, such as parallax or pulsing, so bear this in mind when designing your layers!

Once you’ve created your drawable(s), you can use the Asset Studio to build your adaptive icon:

Notification Channels

Notification channels allow you to group related notifications into dedicated channels, and then define a different behavior for each of these channels. If your app targets API level 26, then notifications channels aremandatory. You cannot post a notification without specifying a valid notification channel ID, so you’ll need to create at least one notification channel for your app. However, for the best results you should create a channel for each distinct “type” of notification that your app creates, and then assign different characteristics to each channel, for example different vibration patterns, alert sounds, and levels of importance (in Oreo you can no longer set a priority level for individual notifications). However, the user can modify a channel’s characteristics, so there’s no guarantee that your channel will have these exact settings forever.

You create a notification channel, by completing the following steps:

When you’re creating a notification, you specify the channel this notification belongs to, using setChannelId():

Wrapping-Up

In this tutorial, we looked at how to implement autosizing TextViews, downloadable fonts, pinned shortcuts, adaptive icons and notification channels.

Have you started updating your apps to support Android Oreo yet? And if so, what’s your favourite feature from the 8.0 release? Let us know in the comments below!

Thank you for being part of our community. Read ourComment Policybefore posting.