Author
Hello, I’m Asami Hussain and I work in WXIT as Senior web & mobile application Developer. All my all team members are very trained & experts of mobile application development. We handle both type of projects startup businesses and enterprise companies and build them custom web development solutions for their client. Archives
February 2021
Categories
All
|
Back to Blog
From Android 7.1 nougat, you can characterize shortcuts to definite actions in your Android Application Development. Application shortcut menu will show up on long press on launcher symbol of application. By utilizing application easy route customers can instantly begin basic task in the app. Generally Android App Shortcuts Used to Immediately Perform Following Task:
{ Read : Securely Update Your Application to Android Nougat } You can publish 2 types of Android Application Shortcuts as like here:-
1. Static Shortcuts: Static easy routes are characterized in resource (.xml) documents. So it stay reliable over the lifetime of application's present version. In this shortcut type, you should wait until update of whole application to change the details of static shortcuts. To make static shortcut apply these steps: (a) In application's manifest file or document (AndroidManifest.xml), set expectation filters to android.intent.action. Major action and class to android.intent.category.LAUNCHER of any of the activity. (b) Just set <meta-data> with android:name=android.app.shortcuts to same action that references the resource document where the application's shortcuts are defined. <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.testapplication"> <application ... > <activity android:name="Test"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </purpose filter> <meta-information android:name="android.app.shortcuts" android:resource="@xml/app_shortcuts"/> </activity> </application> </manifest> (c) Make another resource file as (res/xml/app_shortcuts.xml) where the application's manifest alternate ways are defined. (d) In this .xml have <shortcuts> as root element.Bellow that root component you can set list of alternate route things by utilizing <shortcut> elements.In <shortcut> components, We can give its symbol, its description labels or marks, and the expectations that it dispatches within the application. 2. Dynamic Shortcuts Dynamic alternate routes are defined in class (.java) documents. So it can change at runtime in the app. To make a powerful or dynamic shortcut, ShortcutManager API is utilized. There are various techniques accessible as here:
To update shortcut, just use updateShortcuts(List) technique. To remove a lot of dynamic shortcuts, Use remove Dynamic Shortcuts, and to delete all dynamic shortcuts,Use delete All Dynamic Shortcuts(). For Example:
Turn Off The Shortcuts In case if you don't need the users to choose dynamic shortcuts. At that point, use disableShortcuts(List), which deletes the specified powerful or dynamic easy routes and disables any pinned duplicates of these dynamic shortcuts. If you need to give a bug message that shows up when customers try to launch a turned off dynamic shortcut, Utilize disable Shortcuts (List, CharSequence). For more tips and suggestions about Android app shortcuts, call on Best Android App Development Company experts anytime. READ ALSO :
0 Comments
read more
Leave a Reply. |