<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>#Nougat Archives - anteelo</title>
	<atom:link href="https://anteelo.com/tag/nougat/feed/" rel="self" type="application/rss+xml" />
	<link>https://anteelo.com/tag/nougat/</link>
	<description>Leading Digital Solution Firm</description>
	<lastBuildDate>Mon, 17 May 2021 12:43:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://anteelo.com/wp-content/uploads/2020/01/cantlogo.png</url>
	<title>#Nougat Archives - anteelo</title>
	<link>https://anteelo.com/tag/nougat/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Implement App Shortcuts in Android 7.1 Nougat?</title>
		<link>https://anteelo.com/how-to-implement-app-shortcuts-in-android-7-1-nougat/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-implement-app-shortcuts-in-android-7-1-nougat</link>
		
		<dc:creator><![CDATA[Anteelo Master]]></dc:creator>
		<pubDate>Wed, 14 Apr 2021 12:45:25 +0000</pubDate>
				<category><![CDATA[App Development]]></category>
		<category><![CDATA[#android]]></category>
		<category><![CDATA[#Android 7.1]]></category>
		<category><![CDATA[#app]]></category>
		<category><![CDATA[#Application]]></category>
		<category><![CDATA[#Nougat]]></category>
		<guid isPermaLink="false">https://anteelo.com/?p=3600</guid>

					<description><![CDATA[<p>Google has released a major update of the 7.1 version (API 25) with some pretty cool features. One of the extra features is App Shortcuts. What is an App Shortcut? App Shortcuts uncover common tasks or activities of your application to the launcher screen. Users can use the App Shortcuts feature by long-press on the app icon.  [&#8230;]</p>
<p>The post <a href="https://anteelo.com/how-to-implement-app-shortcuts-in-android-7-1-nougat/">How to Implement App Shortcuts in Android 7.1 Nougat?</a> appeared first on <a href="https://anteelo.com">anteelo</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Google has released a major update of the 7.1 version (API 25) with some pretty cool features. One of the extra features is<a href="https://anteelo.com"> </a><strong>App Shortcuts</strong>.</p>
<h3>What is an App Shortcut?</h3>
<p><img fetchpriority="high" decoding="async" class="aligncenter" src="https://www.imore.com/sites/imore.com/files/styles/xlarge/public/field/image/2021/02/ios14-shortcuts-add-action.jpg" alt="How to customize your app icons with the Shortcuts app | iMore" width="484" height="327" /></p>
<p>App Shortcuts uncover common tasks or activities of your application to the launcher screen. Users can use the App Shortcuts feature by long-press on the app icon.<strong> </strong></p>
<ul>
<li>App Shortcuts are great for making common actions of your app visible and bring back users into the flow in your application.</li>
<li>App Shortcuts can be <em>static</em> or <em>dynamic.</em>
<ul>
<li><em>Static</em> remain same after you define them, you have to redeploy app if you want to make any changes in it.</li>
<li><em>Dynamic</em> one can be changed any time or on the fly.</li>
</ul>
</li>
<li>You can create/manage the stack of activities once you open one through a shortcut. Here you can set the flow of all the activities using intents.</li>
<li>You can reorder the shortcuts in their respective. Static shortcuts will come always at the bottom as they’re added first (there’s no <code class=" prettyprinted"><span class="pln">rank</span></code> property to be defined on them)</li>
<li>The labels are char sequence<em>.</em> So you can play with the span in order to change anything in the text of the labels.</li>
</ul>
<h3>App shortcuts can be of two types-</h3>
<p><em>Static Shortcuts</em>– They are defined statically in a resource file; you can’t change without redeploying the build.</p>
<p><em>Dynamic Shortcuts</em>– The one that can be defined at runtime or on the fly; you can change without redeploying the build.</p>
<p><strong>Note:</strong> App must have a minimum SDK version set to API 25.</p>
<p>Let’s start with creating <em>Static Shortcut</em> first.</p>
<h3>Static Shortcuts<strong> </strong></h3>
<p><img decoding="async" class="aligncenter" src="https://i.ytimg.com/vi/IpS9p7rsy-w/maxresdefault.jpg" alt="Android Tutorial: App Shortcut Static - YouTube" width="453" height="255" /></p>
<p>Open your <strong>AndroidManifest.xml</strong> and add the following <strong>meta-data</strong> tag to your parent or main activity which you want to open as soon as <a href="http://instagram.com/anteelodesign">your app</a> starts playing the role.</p>
<p>You can add multiple shortcuts in the root tag <strong>&lt;shortcuts&gt;. </strong>Let’s understand the properties one by one.</p>
<ul>
<li><code class=" prettyprinted"><span class="pln">enabled</span></code>: It indicates that the shortcut is enabled or not. If you want to disable this shortcut, just set the parameter value as false.</li>
<li><code class=" prettyprinted"><span class="pln">icon</span></code>: It will set the icon to your shortcut menu on the left side.</li>
<li><code class=" prettyprinted"><span class="pln">shortcutDisabledMessage</span></code>: This will show the message if someone will click on the disabled shortcut. However if you have set the “enabled” feature as false, the option will not be shown when you will do long-press but the user can pin a shortcut to the launcher. So pinned shortcut will be disabled at that time and click on it will show a toast message to the user.</li>
<li><code class=" prettyprinted"><span class="pln">shortcutLongLabel</span></code>: The longer text that will be shown as a label but it will only be shown if there is enough room.</li>
<li><code class=" prettyprinted"><span class="pln">shortcutShortLabel</span></code>: A short description of the shortcut. <strong>This field is mandatory</strong>.</li>
<li><code class=" prettyprinted"><span class="pln">intent</span></code>: The intent will be invoked when the user will click the shortcut icon.</li>
</ul>
<p>Multiple intents in shortcuts tags will maintain the stack of the activity as you can see in the above example. When you will press the shortcut icon, then “MainActivity” followed by “MyStaticShortcutActivity” will be opened, and when you press the back button it will take you to the “MainActivity”.</p>
<h3>Dynamic Shortcuts</h3>
<p><img decoding="async" class="aligncenter" src="https://9to5mac.com/wp-content/uploads/sites/6/2021/01/Dynamic-Wallpaper-Shortcuts-app.jpg?quality=82&amp;strip=all" alt="Create dynamic wallpaper on iOS without banner notifications - 9to5Mac" width="437" height="235" /></p>
<p>The dynamic shortcuts can be modified on the fly without the need of redeploying your app. They are created in java code.</p>
<p>I will show you how you can add dynamic shortcuts. We will use the ShortcutManager and ShortcutBuilder.Info in order to create dynamic shortcuts.</p>
<p>Here we have built the shortcut info using <code class=" prettyprinted"><span class="pln">shortcutManager</span><span class="pun">.</span></code> We can set the properties for the shortcut using it. The properties are the same except id and set rank. So I will explain these two only in case of dynamic shortcuts and other properties have same behavior as static shortcuts.</p>
<p>Here in the above example, we have defined the id <strong>shortcut_dynamic</strong> as the second parameter of ShortcutInfo.Builder and <strong>setRank()</strong> are used to set the order of the shortcut which is not present in the case of static shortcuts. Here the first static shortcut will appear followed by rank 0 and then rank 1 shortcut.</p>
<p>As you can see in above image that static shortcut always takes place at the bottom of the list. You cannot change the rank of static shortcuts. They will always be shown in the order they’re defined in the file <code class=" prettyprinted"><span class="pln">shortcuts</span><span class="pun">.</span><span class="pln">xml</span></code></p>
<p>If we see the method <code class=" prettyprinted"><span class="pln">setShortLabel</span><span class="pun">(</span><span class="typ">CharSequence</span><span class="pun">)</span></code>of <code class=" prettyprinted"><span class="typ">ShortcutInfo</span><span class="pun">.</span><span class="typ">Builder</span></code> we can see that it takes <code class=" prettyprinted"><span class="typ">CharSequence</span></code> as a parameter. Which means that we can play around with it. We can change its color on the fly. We can create a <a href="https://developer.android.com/reference/android/text/SpannableStringBuilder.html"><code class=" prettyprinted"><span class="typ">SpannableStringBuilder</span></code></a> and set to it a <a href="https://developer.android.com/reference/android/text/style/ForegroundColorSpan.html"><code class=" prettyprinted"><span class="typ">ForegroundColorSpan</span></code></a> with the color, we want to apply and then pass the <code class=" prettyprinted"><span class="pln">spannableStringBuilder</span></code> as a <code class=" prettyprinted"><span class="pln">shortLabel</span></code> (as the <code class=" prettyprinted"><span class="typ">SpannableStringBuilder</span></code> is a <code class=" prettyprinted"><span class="typ">CharSequence</span></code>):</p>
<p>&nbsp;</p>
<p>The post <a href="https://anteelo.com/how-to-implement-app-shortcuts-in-android-7-1-nougat/">How to Implement App Shortcuts in Android 7.1 Nougat?</a> appeared first on <a href="https://anteelo.com">anteelo</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
