Providing INFO for Android apps with no launcher
There are many types of Android app which don’t provide a regular user interface — live wallpapers, home and lock screen widgets, “pro” licences for apps which should really be using in-app purchases, to give a few examples. These apps tend not to provide a launcher icon as there’s no reason for to provide one; there’s no relevant Activity
to which the android.intent.category.LAUNCHER
category can be applied.
However, the lack of launch activity has the downside of making it harder for users to get started after installing your app from Google Play.
As you can see from a couple of examples on my phone, such apps only show the “Uninstall” button in Google Play — the lack of launch activity means that the usual “Open” button is missing, which isn’t the best experience for people who have just installed your app.
Ideally, users should be able to hit “Open” to get started with your app immediately, whether this means starting the system’s live wallpaper picker, opening the setting screens of your home screen widget, or showing a setup wizard or other introductory information. In the case of “licence” apps like Link Bubble Pro, pressing “Open” could just open the main app.
Providing INFO
Thankfully, it is possible to show the “Open” button to introduce users to your app, without having to add a launcher icon to the apps list.
If you use the category android.intent.category.INFO
instead of the usual LAUNCHER
category then Google Play will show an “Open” button leading to this activity.
While the intent filter with the INFO
category needs to be applied to an activity, this of course doesn’t mean that you have to show any user interface. For example, this is part of the manifest for a live wallpaper I wrote a few years ago:
<activity
android:name=".InfoActivity"
android:theme="@android:style/Theme.Translucent"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.INFO" />
</intent-filter>
</activity>
In the ideal case, the InfoActivity
would never appear; it would attempt to detect the correct intent for the system’s live wallpaper settings activity, open that activity, show a toast telling the user which wallpaper to select, then finish — meaning the InfoActivity
was never shown. If an appropriate activity could not be found, a dialog would be shown telling the user how to set a live wallpaper.
The use of Theme.Translucent
and requestWindowFeature(Window.FEATURE_NO_TITLE)
in the activity ensured users wouldn’t see a title bar momentarily while the app process started, only to disappear and be replaced by the live wallpaper picker, nor would they see any extraneous UI in case the dialog was shown.
Testing that it works
If using the INFO
category prevents a launcher icon from appearing, and we can only press “Open” once the app is live in Google Play, how can we test that this works?
Another seemingly not-so-well-known feature is the ActivityManager tool (am
) available on every Android device, in particular the am start
command, which lets you launch activities (or services, broadcast receivers etc.) via the command line.
To replicate the intent that Google Play uses to open your INFO
activity, you can use the command:
adb shell am start -a android.intent.action.MAIN -c android.intent.category.INFO -n com.example/.InfoActivity com.example
Or to give the shorter equivalent which will work in this case:
adb shell am start -n com.example/.InfoActivity
If this causes the desired action, then you know that once the app is installed, Google Play will show the “Open” button, and your users will be able to get started with your app immediately.