An Android launcher is a home screen app that manages the layout, icons, and widgets of an Android device, providing users with …
TECH BLOG
Principal Software Architect @ PARADOX CAT GmbH. Android OS expert
Disclaimer. I have presented most of this material at DroidCon 2023 in Berlin. If you prefer a video, you can find it here: https://www.droidcon.com/2023/08/01/custom-launcher-why-and-how-do-i-build-one/
An Android launcher is a home screen app that manages the layout, icons, and widgets of an Android device, providing users with access to their apps and features. While every Android device comes with a pre-installed launcher, many users opt for custom launchers to improve performance, usability, and design. Custom launchers allow for greater personalization, including unique features that aren’t available in stock launchers. Developers looking to create their own launcher need to ensure it supports application listings and widgets while maintaining a focus on usability. When designing a launcher, it’s essential to prioritize speed, stability, and user-friendly features like app drawers and widgets. Creativity is key—don’t limit yourself to traditional grid layouts, and always consider how to improve the user experience. For more information on Android launcher development, explore tools like Jetpack Compose and the Glance library.
According to the source code of Android OS, a Launcher or a Home App is an application which “replaces the home screen and gives access to the contents and features of your device”. It is usually responsible for listing and starting other applications and for hosting widgets.
Here is an example of a launcher:
Guess what your phone screen would look like without a launcher? You would only see what is called System UI:
A home app is essential for any Android system. Try to start your applications without it!
Every Android device comes with a pre-installed launcher. Device manufacturers may create their own home app, or simply reuse the vanilla launcher that comes with AOSP (Android Open Source Project). Since it is Open Source, you can actually inspect the original launcher source code. For instance, Launcher 3 for Android phones can be found here: https://cs.android.com/android/platform/superproject/main/+/main:packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
User can choose default home app: Settings — Apps — Default Apps — Home app:
There are multiple possible reasons:
These are the reasons behind every custom launcher you see in the Google Play Store. In fact, most of today’s stock launchers features today were once only available in custom launchers.
If you check Wikipedia, you will find a table with more than 60 launchers for phones/tablets only. Obviously, not all of them can keep up with Android development and some became obsolete when their features were integrated into stock launchers.
Another reason to create a new home app is the plethora of Android devices out there: phones, foldables, tablets, TVs, cars, wearables. They all need a launcher.
There are many possible applications for Android OS. Here are just a few of them.
Of course, not all of them run Android (yet), but if they do, they all need a launcher.
First of all, make your application a launcher. Add this category to your intent filter in AndroidManifest.xml:
<category android:name=“android.intent.category.HOME” />
Actual meaning of this category and other related ones can be found in Intents.java, here are the example definitions extracted from this file:
android.intent.category.HOME
This is the home activity, that is the first activity that is displayed when the device boots.android.intent.category.HOME_MAIN (hidden API, only for platform)
This is the home activity that is displayed when the device is finished setting up and ready for use.android.intent.category.SECONDARY_HOME
The home activity shown on secondary displays that support showing home activities.android.intent.category.SETUP_WIZARD (hidden API, only for platform)
This is the setup wizard activity, that is the first activity that is displayed when the user sets up the device for the first time.android.intent.category.LAUNCHER_APP (hidden API, only for platform)
This is the home activity, that is the activity that serves as the launcher app from there the user can start other apps. Often components with lower/higher priority intent filters handle the home intent, for example SetupWizard, to setup the device and we need to be able to distinguish the home app from these setup helpers.
Next step in becoming a launcher is to list the apps. To get a list of apps, use Package Manager’s queryIntentActivities() API:
val intent = Intent(Intent.ACTION_MAIN)
intent.addCategory(Intent.CATEGORY_LAUNCHER)
val flags = PackageManager.ResolveInfoFlags.of(
PackageManager.MATCH_ALL.toLong())
val activities: List<ResolveInfo> =
context.packageManager.queryIntentActivities(intent, flags)
For ease of use, map this list to your app objects:
data class App(
val name: String,
val packageName: String,
val icon: Drawable?
)
val installedApps = activities.map { resolveInfo ->
App(
name = resolveInfo.loadLabel(packageManager).toString(),
packageName = resolveInfo.activityInfo.packageName,
icon = resolveInfo.loadIcon(packageManager)
)
}
Start an app via such object:
fun App.launch(context: Context) {
val intent = context.packageManager.getLaunchIntentForPackage(packageName) ?: return
context.startActivity(intent)
}
Let us start by looking at the existing user interface modalities. It seems that the world has settled on multi-screen navigation with a configurable grid of icons grouped with the app names.
However, grid is not the only option. Experiment with simple flat lists, embedded search or filtering using text or speech, fast scrolling using first letters, etc.
Take a look at Niagara Launcher’s approach:
Or it could be as simple as OLauncher:
Also, remember to give users a way to see all of their installed apps in one place. For example using an App Drawer which one could “draw” from the bottom of the screen with a swipe-up gesture:
That said, do not limit yourself to application icons and app widgets only. Get creative and build the user interface around what your users actually need. For example, a SpaceX rocket launcher (pun intended) might look something like this:
A story about launchers would be incomplete without talking about App Widgets.
This is an example of a standard clock widget:
I will not bother you with details on implementation or widget types, you can find great official documentation here. If you use Jetpack Compose, check out the Glance library, it is truly great!
Instead, let us discuss the uses and limitations of App Widgets.
It is clear that widgets are quite useful for applications like calendar, clock, and weather. However, if you want to have something like a fully interactive map on your home screen all the time, App Widgets unfortunately are not going to cut it.
And why is that?
But wait a minute, isn’t that what the default launcher of Android Automotive OS does? Showing a giant interactive map in a launcher?
Yes, it does:
If it is not an App Widget, what is it?
In the source code, Google calls these widgets “Cards”. Cards are implemented in terms of lower-level window management facilities. This facility used to be an ActivityView, which was deprecated and eventually removed in Android 12. Now it is a TaskView, which is rightfully a hidden platform API.
What does “hidden platform API” mean for application developers? Simply put:
Yes, there are ways to expose this API to applications, but if you want your application to survive Android updates, I urge you to consider a better design alternative.
Implement the element you want to “embed” directly in the launcher. As long as you have control over the providing app, you can extract the relevant code parts into common libraries and design proper communication between the “Widget” and the “App” yourself.
That said, your launcher should probably still support embedding App Widgets as well, some users depend on it.
We have covered a lot of ground in this story. To summarize, we have learned the following.
Be creative and focus on what your users need.
If you want to be up-to-date feel free to follow us on our social media channels like Instagram, LinkedIn and Medium!
An Android launcher is a home screen app that manages the layout, icons, and widgets of an Android device, providing users with …