Implementing Pinned App Shortcuts in Android
Previously, we talked about the first two types of App Shortcuts: static shortcuts and dynamic shortcuts. Now, we’re ready to talk about the last type of App Shortcut: Pinned App Shortcuts.
What is a Pinned App Shortcut?
A Pinned App Shortcut is an App Shortcut that is pinned to the launcher.
Take Google Chrome app below for example. By clicking Add to Home Screen menu while opening a website, we can create a new shortcut and place it in the launcher. When the shortcut is clicked, Chrome will open the website directly.
See how convenient it is? Depending on your app’s use case, this feature could help your user to navigate your app faster.
How to Implement Pinned App Shortcuts?
These are the steps needed to implement pinned app shortcuts in your app.
1. As always, we are going to use the Bobobox app as our use case app. In the previous article, we have made a dynamic shortcut for displaying user’s reservation detail. Let’s make the same shortcut, but as a pinned shortcut!
Take a look at the code snippet below to see how you can create the pinned shortcut.
Note that not all device supports pinned app shortcuts, so it’s important to check it first by calling
2. And finally, you can use the above utility object like this on your app:
3. And that’s it! Now, your app will be able to request for pinned shortcuts like shown in the image below. Notice the appearance of a dialog asking the user, whether they want to place the shortcut manually or automatically.
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! 😀