Android — Shortcut Manager
I have prepared a coffee application to explain the Shortcut. In this application, user will be able to order coffee with using shortcuts.
1-What’s App Shortcut ?
Nowadays, users have become very lazy, they want to do the same or more work with less “clicks”. To handle this, there is a widget that Android offers. Shortcuts that allow us to perform certain actions in our application. It is used to open messages or create new posts in popular applications such as Twitter and Instagram.
2-Requirements
The App Shortcuts feature was included in Android 7.1.1. We can use API 25+.
3-Shortcut Types
Shortcut is used in three different ways.
- Static Shortcut
- Dynamic Shortcut
- Pinned Shortcut
In this article, I will talk about static and dynamic shortcuts.
3.1- Static Shortcut
we need to create a xml resource file that contains the shortcuts. Sample shortcuts as follows. You can add more shortcuts by increasing <shortcut/> tags. The maximum number of shortcuts is five, but the ideal use is four.
We need to add the xml file we created to the manifest. The important point in this step is that we add it to the activity, which is the launcher.
Ratata! Cappuccino shortcut is ready to use.
3.2- Dynamic Shortcut
We use the dynamic shortcut when we want to create a changing shortcut within the application. For example; the level of the game or the last person we messaged.
Voila! you can order mocha with dynamic shortcut.
Bonus
If you drag and drop the shortcut, you can put it anywhere on the screen like a separate application.
You can visit github to review the whole project.
Get Göktürk Bilgetürk’s stories in your inbox
Join Medium for free to get updates from this writer.
If there is a place you think is missing or you want to contribute, please do feel free to contact me.
Thanks for reading. If you like my article, please don’t forget to click 👏👏👏 to recommend it to others 👏👏👏.








