<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kamal Vaid on Medium]]></title>
        <description><![CDATA[Stories by Kamal Vaid on Medium]]></description>
        <link>https://medium.com/@kamalvaid?source=rss-ac8a5902947b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*f5qiuOXJEtufZTfKJZflQA.jpeg</url>
            <title>Stories by Kamal Vaid on Medium</title>
            <link>https://medium.com/@kamalvaid?source=rss-ac8a5902947b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 01:04:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kamalvaid/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Data Binding Using Objects In Android — Part II]]></title>
            <link>https://medium.com/@kamalvaid/data-binding-using-objects-in-android-part-ii-64b90a176432?source=rss-ac8a5902947b------2</link>
            <guid isPermaLink="false">https://medium.com/p/64b90a176432</guid>
            <category><![CDATA[data-binding]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-data-binding]]></category>
            <dc:creator><![CDATA[Kamal Vaid]]></dc:creator>
            <pubDate>Mon, 06 Apr 2020 08:36:16 GMT</pubDate>
            <atom:updated>2020-04-06T08:39:58.540Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Binding Using Objects In Android — Part II</h3><p>Data Binding as we know is a support library part of <strong>Android Architecture Components </strong>that allows to bind observable UI components in our layouts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eO_FfpYoi8YPfIoDA0i9RQ.png" /><figcaption>Image Credit to <a href="https://devblogs.microsoft.com/xamarin/introduction-to-data-binding/">https://devblogs.microsoft.com/xamarin/introduction-to-data-binding/</a></figcaption></figure><blockquote><strong>In last article we learned about:</strong></blockquote><ol><li>Benefits of Data Binding</li><li>How to enable Data Binding in build.gradle</li><li>How to set-up &lt;layout/&gt; tag in xml</li><li>How to access Data Binding Object and xml view in Kotlin file</li></ol><p>Now taking a step forward in this article we will cover how we can pass <strong>Simple</strong> <strong>objects</strong> in Xml file, <strong>Syntax</strong> and <strong>Benefits</strong> for same.</p><p>In order to use <strong>Simple Objects</strong> we need to do follow below mention steps:</p><ol><li>Create a Simple class with some entities</li><li>Set-up Data Binding as discussed in last article</li><li>After inflation pass the object to xml layout</li></ol><p>Consider below example to understand the <strong>implementation</strong> more:</p><p><strong>Employee.kt</strong></p><pre><strong>data class </strong>Employee(<strong>var name</strong>:String)</pre><p>In this class, <strong>name</strong> is value which will be referred using <strong>object</strong> within <strong>layout</strong> <strong>xml</strong> file.</p><p><strong>activity_main.xml</strong></p><pre><em>&lt;?</em><strong>xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;</strong><em>?&gt;<br></em>&lt;<strong>layout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;</strong>&gt;<br>    &lt;<strong>data</strong>&gt;<br>        &lt;<strong>variable<br>            name=&quot;employee&quot;<br>            type=&quot;com.kamal.databindingusingobjects.Employee&quot; </strong>/&gt;<br>    &lt;/<strong>data</strong>&gt;<br><br>    &lt;<strong>androidx.constraintlayout.widget.ConstraintLayout<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;match_parent&quot;<br>        tools:context=&quot;.MainActivity&quot;</strong>&gt;<br><br>        &lt;<strong>TextView<br>            android:id=&quot;@+id/empName&quot;<br>            android:layout_width=&quot;wrap_content&quot;<br>            android:layout_height=&quot;wrap_content&quot;<br>            android:text=&quot;@{employee.name}&quot;<br>            app:layout_constraintBottom_toBottomOf=&quot;parent&quot;<br>            app:layout_constraintLeft_toLeftOf=&quot;parent&quot;<br>            app:layout_constraintRight_toRightOf=&quot;parent&quot;<br>            app:layout_constraintTop_toTopOf=&quot;parent&quot; </strong>/&gt;<br><br>    &lt;/<strong>androidx.constraintlayout.widget.ConstraintLayout</strong>&gt;<br>&lt;/<strong>layout</strong>&gt;</pre><p>Here, <strong>data</strong> <strong>tag</strong> is used to add variables containing <strong>objects</strong> of classes which can be referred to set values in <strong>layout</strong> <strong>xml</strong> files.</p><pre>&lt;<strong>data</strong>&gt;<br>        &lt;<strong>variable<br>            name=&quot;employee&quot;<br>            type=&quot;com.kamal.databindingusingobjects.Employee&quot; </strong>/&gt;<br>&lt;/<strong>data</strong>&gt;</pre><p>In this example, employee is the <strong>data</strong> <strong>variable</strong> <strong>object</strong> which is being used in <strong>activity_main</strong>.<strong>xml</strong> file to set value of <strong>empName</strong> <strong>Textview</strong>.</p><blockquote><strong>Tags:</strong></blockquote><ol><li><strong>data: </strong>use to contain references of objects which we want to use within xml</li><li><strong>variable:</strong> This contains name and type of the variable</li></ol><p>Properties:</p><ol><li><strong>name:</strong> Name for the <strong>reference</strong> <strong>object</strong> which will be utilised in <strong>xml</strong> <strong>layout</strong></li><li><strong>type:</strong> Type of the <strong>reference</strong> <strong>object</strong>. This contains fully <strong>qualified</strong> path to the <strong>object</strong></li></ol><blockquote><strong>Example using objects in xml via Data Binding</strong></blockquote><p><strong>MainActivity.kt</strong></p><pre><strong>class </strong>MainActivity : AppCompatActivity() {<br>    <strong>lateinit var activityMainBinding</strong>: ActivityMainBinding<br><br>    <strong>override fun </strong>onCreate(savedInstanceState: Bundle?) {<br>        <strong>super</strong>.onCreate(savedInstanceState)<br>        <strong>activityMainBinding</strong>=DataBindingUtil.setContentView(<strong>this</strong>,R.layout.<em>activity_main</em>)<br>        <strong>activityMainBinding</strong>.<em>employee</em>=Employee(<strong>&quot;Kamal Vaid&quot;</strong>)<br>    }<br>}</pre><p>As we know <strong>DataBindingUtil</strong> is used to create <strong>DataBinding</strong> <strong>Object</strong> of respective layout which later on can be used to access values within layouts. Here in this example we are doing same using <strong>DataBindingUtil</strong>:</p><pre>DataBindingUtil.setContentView(<strong>this</strong>,R.layout.<em>activity_main</em>)</pre><p>Once <strong>Data</strong> <strong>Binding</strong> Object ready then we need to pass the object reference which we need to access in <strong>xml</strong> <strong>layout</strong> file, Which can be done as shown below:</p><pre><strong>activityMainBinding</strong>.<em>employee</em>=Employee(<strong>&quot;John Kumar&quot;</strong>)</pre><p>now this [Employee(<strong>“John Kumar”</strong>)] object will be contained in employee variable in <strong>xml</strong> <strong>file</strong>.</p><p>After doing all this we have our <strong>object</strong> passed in <strong>xml</strong> <strong>layout</strong> file. In order use this in setting or getting a value for a widget defined in <strong>xml</strong> <strong>layout</strong> file we need to follow a <strong>Syntax</strong> as mentioned below:</p><pre><strong>android:text=&quot;@{employee.name}&quot;</strong></pre><p>i.e. “@{yourvariablename.property}”</p><p>This full <strong>example</strong> can be found at : <a href="https://bit.ly/2JGl7Vl"><strong>https://bit.ly/2JGl7Vl</strong></a></p><blockquote><strong>Benefits of Using Objects:</strong></blockquote><p>This is useful when combined with <strong>Rest</strong> <strong>Api</strong> calls as xml views can be directly bind with <strong>response</strong> we are getting from <strong>server</strong>.</p><p>Hope this helps to better understand <strong>implementation</strong> of <strong>Data</strong> <strong>Binding</strong> using <strong>Objects</strong>.</p><p><strong>Cheers!!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64b90a176432" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Binding In Android]]></title>
            <link>https://medium.com/@kamalvaid/data-binding-in-android-880e567e996e?source=rss-ac8a5902947b------2</link>
            <guid isPermaLink="false">https://medium.com/p/880e567e996e</guid>
            <category><![CDATA[android-data-binding]]></category>
            <category><![CDATA[data-binding]]></category>
            <dc:creator><![CDATA[Kamal Vaid]]></dc:creator>
            <pubDate>Tue, 31 Mar 2020 08:53:11 GMT</pubDate>
            <atom:updated>2020-04-06T07:07:51.981Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Binding In Android — Part I</h3><blockquote><strong>Data Binding</strong></blockquote><p>It is a support library part of <strong>Android Architecture Components </strong>that allows to bind observable UI components in your layouts defined in layout folder under resources.</p><blockquote><strong>Traditional Approach</strong></blockquote><pre>val textview : Textview = findViewById&lt;TextView&gt;(R.id.textView)</pre><p><strong>findViewByID</strong> is used to find references within views defined in layouts.So whenever this statement is used within code android systems searches for the respective view in view <strong>hierarchy</strong> which can make view creation slow in case of large views.</p><p>Ultimately, it will reduce the <strong>performance</strong> of your large application and may lead to user dissatisfaction.</p><blockquote><strong>Why Data Binding?</strong></blockquote><p>In Data binding we deal with objects i.e.<strong> Data Binding Objects</strong>. These object contains references to all the views within a layout defined under layout folder under resources.</p><p>This Data Binding object can be used by other components anytime to use/modify values within views. With the use of Data Binding system does not traverse view <strong>hierarchy</strong> EveryTime rather it uses the data binding object directly to access views and relative <strong>performance</strong> compare to <strong>findViewByID</strong>.</p><blockquote><strong>Benefits:</strong></blockquote><ol><li>Improves Performance of the application.</li><li>Allow us to write clean and concise code with the removal of findViewByID.</li><li>Issues related with references are identified at compile time as compared to findViewByID which identifies at Runtime.</li></ol><blockquote><strong>How this works?</strong></blockquote><p>Firstly, enable data binding in module level <strong>build.gradle</strong> like below:</p><pre>dataBinding {<br>    enabled = <strong>true<br></strong>}</pre><p>After this, write your view code inside layout container like below:</p><p>Layout Xml file name: <strong>my_view.xml</strong></p><pre><em>&lt;?</em><strong>xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;</strong><em>?&gt;<br><br></em>&lt;<strong>layout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;</strong>&gt;<br><br>    &lt;<strong>TextView<br>        android:id=&quot;@+id/textView&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:adjustViewBounds=&quot;true&quot;</strong>/&gt;<br><br>&lt;/<strong>layout</strong>&gt;</pre><p>Now <strong>rebuild</strong> the code and binding class for above layout will be generated with binding text appended at the last. i.e <strong>MyViewBinding</strong> in this case.</p><pre>lateinit var viewBinding : MyViewBinding</pre><pre>viewBinding= DatabindingUtil.setContentView(this,R.id.my_view)    </pre><p>This will set the binding in our class. Now in order to modify any values using binding object now :</p><pre>viewBinding.<strong>textView.text= &quot;Hello world&quot;</strong></pre><p>Hope this small introduction helps you understand why and how to use Data Binding in android applications.</p><p>References: <a href="https://developer.android.com/topic/libraries/data-binding">https://developer.android.com/topic/libraries/data-binding</a></p><p>Cheers!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=880e567e996e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android Jetpack — Summary]]></title>
            <link>https://medium.com/@kamalvaid/android-jetpack-summary-d86785bf3c3d?source=rss-ac8a5902947b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d86785bf3c3d</guid>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Kamal Vaid]]></dc:creator>
            <pubDate>Mon, 18 Nov 2019 10:06:03 GMT</pubDate>
            <atom:updated>2019-11-18T10:27:31.220Z</atom:updated>
            <content:encoded><![CDATA[<h3>Android Jetpack For Developers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*bXN46bFuWKNB2w81ILIi4g.png" /><figcaption>Image Credit to Android Developers(<a href="https://developer.android.com/jetpack/">https://developer.android.com/jetpack/</a>)</figcaption></figure><blockquote><strong>What do we need to understand when thinking about/talking about android jetpack?</strong></blockquote><p>These are the <strong>components</strong>(set of <strong>Tools</strong>) aligned with <strong>Architecture</strong> <strong>Design</strong> <strong>Guidelines</strong> built to help us <strong>Accelerate</strong> our Android Development(speed up development process).</p><p>This provides various templates which can be used to quickly write production ready code and speed up multiple things.</p><p>These components are simple to use, which means we can involve new developers anytime within our team for new features.</p><p><strong>Apart from this Android Jetpack helps in :</strong></p><ol><li>Avoid Writing Boilerplate Code</li><li>Handling complex task’s easily</li><li>And more importantly help us in following best practices in Android Development</li></ol><p><strong>Android Jetpack :-</strong> Contains libraries that you can use individually too. In order to do the same just include the respective dependency in the <strong>app.gradle</strong> file.</p><p><strong>Android Jetpack Components are divided into four categories :</strong></p><ol><li>Foundation</li><li>Architecture</li><li>Behaviour</li><li>UI</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y2nAlyBmVXKfFg4r2q88tw.png" /><figcaption>Image Credit to Android Developers(<a href="https://developer.android.com/jetpack/">https://developer.android.com/jetpack/</a>)</figcaption></figure><p>You can use each component <strong>individually</strong> by making use of respective <strong>dependencies</strong> . Apart from this every component is <strong>Backward Compatible</strong>.</p><h3><strong>Major Benefits Of Using These Four Components:</strong></h3><ol><li>Improves Testability</li><li>Contains Lifecycle Aware components and Observers</li><li>Leads toward Robustness</li><li>Helps Developers writing unnecessary code(hacks)</li><li>Make use of Kotlin Features(Lamdas, Extension functions etc.)</li><li>Data persistence using Room</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d86785bf3c3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Carousel (Static and Dynamic): Action On Google]]></title>
            <link>https://medium.com/@kamalvaid/carousel-static-and-dynamic-action-on-google-3e580ff9b444?source=rss-ac8a5902947b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e580ff9b444</guid>
            <category><![CDATA[actions-on-google]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[carousel]]></category>
            <category><![CDATA[google-assistant]]></category>
            <dc:creator><![CDATA[Kamal Vaid]]></dc:creator>
            <pubDate>Wed, 24 Apr 2019 19:22:38 GMT</pubDate>
            <atom:updated>2019-04-24T19:22:38.701Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Carousel</strong> is part responses which are displayed to user while using <strong>Action</strong> on <strong>Google Assistant</strong>.</p><p><strong>Carousel</strong> is a rich response that allows users to :</p><ol><li>Scroll Horizontally</li><li>Select One Item</li><li>See Rich Content(Images and Text)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*3wH8ng5y25y0neHhIqLd1w.png" /><figcaption>Simple Carousel list image. Image reference from developers.google.com</figcaption></figure><p>Once user select’s one item from the <strong>Carousel</strong> list then that item title will be populated in the <strong>Chat Bubble</strong> as user new query and <strong>Action</strong> will start searching for the respective intent to fulfil the user query populated in the <strong>Chat Bubble</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*kmT7ea6B8MRN0Un75pl0mA.png" /><figcaption>Chat Bubble with option displayed once user selects Item from Carousel.</figcaption></figure><h3><strong>How to Create/Show/build Carousel</strong></h3><p>Carousel can we created either :</p><ol><li>Statically</li><li>Dynamically</li></ol><h3>Static Carousel</h3><p>When we know the items to be displayed will remain fix in terms of <strong>Count</strong> and <strong>Data</strong> then <strong>Carousel</strong> can be built statically using DialogFlow. When building <strong>Carousel</strong> we need to add min. of two options in it to make it work.</p><ol><li>Go to <strong>Responses</strong> tab in an intent</li><li>Select the Google Assistant option in the sliding tabs (i.e the 2nd option)</li><li>Click on Add <strong>Responses</strong> and choose <strong>Carousel</strong> Card.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P5chFyHJwn_ViP5rnqpLXA.png" /><figcaption>Choosing a Carousel card</figcaption></figure><p>Once we select the <strong>Carousel</strong> Card from the drop down of responses then <strong>Carousel</strong> with fields will be displayed in which we need to fill the information to be displayed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*aF-5urKaq8CqseSBYwh6qA.png" /><figcaption>Carousel Card with all the fields</figcaption></figure><p><strong>Note: All the fields are not mandatory to fill.</strong></p><p>We can add image for the item if required but incase you add image then image accessibility text also needs to be filled.Title and subtitle will be displayed at the top of item.</p><p><strong>Item Option key</strong> is mandatory and this should be unique for every option. Once all the required information is filled then we can add another Carousel in order add our next option with different Option key.</p><h3>Dynamic Carousel</h3><p>When we are not sure about the count of items to be displayed in the Carousel than we opt to create the Carousel dynamically. This is mostly the scenario when we are using Fulfilment section of DialogFlow and fetching the data from either Server or firebase (Firebase Functions).</p><ol><li>Go to Fulfilment in the left pane</li><li>Enable Inline Editor if using Cloud functions</li><li>Write the import statements as shown in image below for Carousel.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XT4o-IBtPOTo2K1vY82Wug.png" /><figcaption>Dependencies For Carousel in Inline Editor</figcaption></figure><blockquote><em>const {Carousel, DialogflowConversation, SimpleResponse} = require(‘actions-on-google’);</em></blockquote><p>Now refer below function to create Carousel dynamically. Below is the snippet for creating one item.</p><pre>items[temp] = {      <br>                optionInfo: {   <br>                           key: (temp + 1).toString(),                                                  </pre><pre>                           synonyms: childData.name,      <br>                            },      <br>                title: childData.name,<br>                url: childData.imageurl,    <br>                image: new Image({           <br>                url: childData.imageurl, <br>                alt: childData.venue  <br>              }),     <br>            }  <br></pre><pre>agent.add(new Carousel({ <br>   title: &#39;Search Results&#39;, <br>   items: items  <br>}));</pre><p>Refer below Github link for Full snippet.</p><p><a href="https://github.com/CammyKamal/Actions-On-Google/blob/master/Dynamic%20Carousel">CammyKamal/Actions-On-Google</a></p><p>so this was all about Carousel in Action On Google. Stay tune for more articles on Action On Google and some other cool stuff.</p><p>Cheers!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e580ff9b444" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s New in Android Studio 3.4]]></title>
            <link>https://medium.com/@kamalvaid/whats-new-in-android-studio-3-4-180a4caf2398?source=rss-ac8a5902947b------2</link>
            <guid isPermaLink="false">https://medium.com/p/180a4caf2398</guid>
            <category><![CDATA[android-studio-updates]]></category>
            <category><![CDATA[android-studio]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-studio-3]]></category>
            <dc:creator><![CDATA[Kamal Vaid]]></dc:creator>
            <pubDate>Mon, 22 Apr 2019 19:04:00 GMT</pubDate>
            <atom:updated>2019-04-22T19:04:00.497Z</atom:updated>
            <content:encoded><![CDATA[<p>Android studio 3.4 stable channel is launched this April with lots of cool features and improvements.</p><p>Below are some major updates in the release and how can we make use of them to make our life easy as Developer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*Ht1208XXc0MhIIE4e0PHvg.png" /><figcaption>New Android Studio Release 3.4</figcaption></figure><h3>New Project Structure Dialog</h3><p><strong>New Project Dialog</strong> is new project structure pop up dialog which makes it easy to configure and update different aspects of the projects like :</p><ol><li>Modules</li><li>Build variants</li><li>Signing configurations and</li><li>Build variables</li><li>Dependencies</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-eYD9jnhlGHN92lbNfiPVg.png" /><figcaption>New Project Structure Dialog</figcaption></figure><h3>Variables</h3><p>The new <strong>PSD</strong> provides a variables option in the left pane which you can utilise to create and manage build level variables for example Build versions, compile Sdk Versions and version numbers for dependencies consistent across your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zfi4le3tpOeyMQYMlWlI1Q.png" /><figcaption>Creating a compileSdk variable which can be use across project</figcaption></figure><p>Using variables option you can add Build Variables at both project and module level.</p><h3>Modules</h3><p>Using modules option, you can easily modify and add :</p><ol><li>Basic Module Properties</li><li>Default Config</li><li>Signing Configs</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OwcVWo-enPxPwqG0K_3vFw.png" /><figcaption>Changing Compile Sdk of app Module using PSD</figcaption></figure><h3>Dependencies</h3><p>Select the dependencies option in the left pane of <strong>PSD</strong> to see dependencies associated with respective modules. You can always add new, change/update dependencies versions directly from here.</p><p>After selecting dependencies, all the modules in the project will be displayed and you can select one to view the dependencies associated with it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_15SCh5uiP1JS0lPpe710g.png" /><figcaption>Dependencies option in PDF</figcaption></figure><h3>Build Variants</h3><p>Create and Configure build variants and flavours using this option. Apart from these two major features you can add below items as well :</p><ol><li>Signing Config</li><li>Proguard files</li><li>Manifest Placeholders</li><li>Minify Enabled (true/false)</li><li>Multi Dex Enabled</li><li>Application id suffix</li><li>Version name suffix</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-3AD1n19p8TrGGchoYKcMg.png" /><figcaption>Build type and Flavors under Build types</figcaption></figure><h3>Suggestions</h3><p>This section will be highlighted automatically if there are updates available related to dependencies or variables which are currently being used in the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j6aL3F-e-AYFWKGeCZCELA.png" /><figcaption>Suggestions showing all the updates in the used dependencies.</figcaption></figure><h3>Resource Manager</h3><p>I found this one the coolest feature in this release. In order to open click</p><ol><li>View -&gt; Tool windows -&gt; Resource Manager (Then you will see something like this )</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*EoSPjQchc4FlUw51iO6b2w.png" /><figcaption>Resource Manager View</figcaption></figure><p>Here all the resources used in the selected module will be displayed. You can always change the module to see resources related with them by choosing the name of the module from the dropdown at the top of resource manager window pop-up.</p><p>Resources related with module are :</p><ol><li>Drawable</li><li>Color</li><li>Layout</li></ol><p>This view will be stick to the left side your android studio window and you can always Drag &amp; Drop items from resource manager to Layout if opened at the right side in the android studio.</p><h3>R8 enabled by default</h3><p>R8 means proguard tool.</p><p>R8 integrates :</p><ol><li>Shrinking</li><li>desugaring</li><li>obfuscating</li><li>optimizing</li><li>dexing</li></ol><p>All in one step which improves build performance.</p><blockquote>Note : R8 was introduced in Android Gradle plugin 3.3.0 and is now enabled by default for both app and Android library projects using plugin 3.4.0 and higher.</blockquote><p>Since R8 is enabled by default, but if you do not want to use it you can always disable this by setting below properties as false in Gradle.Properties file.</p><pre># Disables R8 for Android Library modules only.<br>android.enableR8.libraries = false<br># Disables R8 for all modules.<br>android.enableR8 = false</pre><h3>Android Gradle plugin 3.4.0</h3><pre>buildscript {<br>    repositories {<br>        // Gradle 4.1 and higher include support for Google&#39;s Maven //repo using<br>        // the google() method. And you need to include this repo to //download<br>        // Android Gradle plugin 3.0.0 or higher.<br>        google()<br>        ...<br>    }<br>    dependencies {<br>        classpath &#39;com.android.tools.build:gradle:3.4.0&#39;<br>    }<br>}</pre><p>You can use new plugin version 3.4.0 in this latest update of Android Studio 3.4</p><p>These all are the major updates in the current release of android studio. For more android updates keep checking my medium stories ;)</p><p>Cheers!!</p><p>References : <a href="https://developer.android.com/studio/releases">Developer Android Studio Releases</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=180a4caf2398" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Branding Policies : Action On Google]]></title>
            <link>https://medium.com/@kamalvaid/branding-policies-action-on-google-dcc98ed96c6f?source=rss-ac8a5902947b------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcc98ed96c6f</guid>
            <category><![CDATA[google-assistant]]></category>
            <category><![CDATA[actions-on-google]]></category>
            <dc:creator><![CDATA[Kamal Vaid]]></dc:creator>
            <pubDate>Sun, 21 Apr 2019 09:47:31 GMT</pubDate>
            <atom:updated>2019-04-21T09:47:31.289Z</atom:updated>
            <content:encoded><![CDATA[<h3>Branding Policies : Action On Google</h3><p>While building our action one of the most important aspect that we need to take care of is “<strong>Branding</strong>”. We before dig into Branding policies lets get familiar with some terms first…</p><blockquote>Brand</blockquote><p>A brand is the idea or image of a specific product or service that consumers connect with, by identifying the name, logo, slogan, or design of the company who owns the idea or image.</p><blockquote>Branding</blockquote><p>Branding is when that idea or image is marketed so that it is recognisable by more and more people, and identified with a certain service or product when there are many other companies offering the same service or product.</p><p>Now as we are aware of brand and branding terminologies lets figure out the Branding policies which we need to keep in mind while building our Action.</p><h3>Using Google Logo’s and Trademark’s</h3><p>If you are using any of the Google logo or Trademark in your action then first you need written approved permission from Google in order to use these.</p><p>Do not modify Google trademarks in order to use them as the logo for your action without written permission from Google.</p><p>And if you have the permission then these are <a href="https://www.google.com/permissions/logos-trademarks/"><strong>Guidelines</strong></a> which you need to keep in mind before the implementation .</p><h3><strong>Using Developer Badge</strong></h3><p>When you’ve completed your Action then you can use this Developer Badge to let others know that your Action “<strong>Works with the Google Assistant</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w-ycrZaV1RuCAuC954icMw.png" /></figure><p>You do not need pre-approval to use this badge if your Action is :</p><ol><li>Compatible with the Google Assistant</li><li>Functional</li></ol><p>And Your Developer account is in good standing.</p><p>While using Developer Badge in marketing execution we need to follow these <a href="https://developers.google.com/actions/policies/branding-policies#badge_restrictions"><strong>Guidelines</strong></a>. And if planning to use this Badge for physical packaging then you require a written <a href="https://services.google.com/fb/forms/permissionsbrand/"><strong>permission</strong></a> from Google. Here you need to fill up some information asked in the permission form and submit. Google usually take’s 3–4 weeks to respond on the submitted request.</p><h3><strong>Using Voice UI</strong></h3><p>Avoid using a voice similar to that Google Assistant so that user’s can easily recognise with whom their are interacting either your Action and Google Assistant.</p><p>This is all about Branding Policies, which we need to keep in mind while building and completing our Action. If any of this policies is not met as expected then Action can be rejected.</p><p>References : <a href="https://developers.google.com/actions/policies/branding-policies"><strong>Action On Google Branding Policies</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcc98ed96c6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Dependency Injection In Android]]></title>
            <link>https://medium.com/@kamalvaid/what-is-dependency-injection-in-android-2721d4a2f46e?source=rss-ac8a5902947b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2721d4a2f46e</guid>
            <category><![CDATA[android-annotations]]></category>
            <category><![CDATA[dagger-2]]></category>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[dagger]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Kamal Vaid]]></dc:creator>
            <pubDate>Mon, 14 Jan 2019 10:23:07 GMT</pubDate>
            <atom:updated>2019-01-14T17:53:52.355Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Dependency Injection In Android — Part 1</h3><p>Before jumping into <strong>DI</strong> in android, lets recall some concepts like what is <strong>Dependency</strong>, <strong>Injection</strong> and <strong>DI</strong> in simple programming terminology.</p><blockquote><strong>What is Dependency?</strong></blockquote><p><strong>Dependency</strong> is a object which is to be used by a dependent i.e class.</p><p>Or</p><p><strong>Dependency</strong> is another object that a class needs to function.</p><blockquote><strong>What is Injection?</strong></blockquote><p>Injection is a technique which passes the dependency to dependent i.e Object to a class which wants to use it.</p><blockquote><strong>DI?</strong></blockquote><p>Combining both, <strong>DI</strong> (<strong>Dependency Injection</strong>) is a technique that makes dependent i.e class independent of its dependencies.</p><p>Or Instead of creating dependencies, dependent uses some third party framework to do.</p><p><strong>Example :</strong></p><p>public class A{</p><p>//Dependency</p><p>B obj=new B(“DI”);</p><p>}</p><p>Here A is dependent on B in order function properly as A depends upon the instance of B class.</p><p>In Another words, <strong>DI</strong> is <strong>Decoupling</strong> of classes from they dependent Or <strong>Inject</strong> dependencies i.e making your design to be <strong>Loosely Coupled</strong> and follow <strong>Dependency Inversion</strong> and <strong>Single Responsibilities Principles</strong>.</p><p>So we can say asking a <strong>framework</strong> or third party to create the object of dependency instead of dependent creating the object of dependency is referred as <strong>DI</strong>.</p><h3><strong>How to accomplish DI in Android?</strong></h3><p>In Android, we use third party libraries like</p><ol><li>Dagger</li><li>Android Annotations</li><li>Roboguice</li><li>ButterKnife</li></ol><p>to achieve Dependency injection depending upon our requirements.</p><p>Now lets get started with Dagger2…</p><blockquote>What is Dagger2?</blockquote><p>It is a dependency framework based on <strong>annotations</strong>. It uses code generation in order to access fields, methods.</p><p><strong>Note:</strong> No private fields are allowed for injection by Dagger.</p><p>To implement include below dependency:</p><pre>// App build.gradle<br>dependencies {<br>    compile &#39;com.google.dagger:dagger:+&#39;<br>    annotationProcessor &quot;com.google.dagger:dagger-compiler:2.4&quot;<br>}</pre><h3><strong>Major terms and various questions In Dagger to understand :</strong></h3><ol><li>What is component?</li><li>What is module and purpose?</li><li>What provides annotation does?</li><li>Scope Annotations?</li><li>what does Inject do?</li></ol><blockquote><strong>Component</strong></blockquote><p>Typically, <strong>Dagger2</strong> uses this to generate code which uses <strong>Modules</strong>.</p><p>Or</p><p>In Simple words, <strong>Component</strong> is a interface class which contains all the places i.e <strong>Activities</strong>,<strong>fragment</strong> where you want to inject/use a particular object.</p><p>Code Snippet :</p><pre><br>@Component(modules = { MyDemoModule.class})<br><strong>public</strong> <strong>interface</strong> <strong>MyDemoComponent</strong> {<br><br>    <strong>void</strong> inject(MyActivity myActivity); <br>}</pre><blockquote><strong>@Module Annotation</strong></blockquote><p>Classes with <strong>@Module</strong> annotations are used to provide objects which are to be <strong>Injected</strong> or to be used by <strong>Dependent</strong> classes. These classes contains methods defined with <strong>@Provides</strong> annotation which are used for dependency injection</p><p>In simple words, <strong>@Provides</strong> and .<strong>@Modules</strong> contains methods and classes which provide dependencies.</p><pre>@Module<br><strong>public</strong> <strong>class</strong> MyDemoModule {<br><br>    @Provides<br>    @Singleton<br>    User getUserObj() {<br>        <strong>return</strong> <strong>new</strong> User();<br>    }<br>}</pre><p><em>Below is the User class to handle various user specific values :</em></p><pre><strong>public</strong> <strong>class</strong> <strong>User</strong> {<br><br>    <strong>private</strong> String firstName;<br>    <strong>private</strong> String lastName;<br><br>    <strong>public</strong> User(String firstName, String lastName) {<br>        this.firstName = firstName;<br>        this.lastName = lastName;<br>    }</pre><pre>} </pre><blockquote><strong>Provides Annotation</strong></blockquote><p>This <strong>Annotations</strong> is used on methods which are defined in classes annotated with <strong>@Module</strong>.</p><p>Methods with <strong>@Provides</strong> annotation are used for dependency injection.</p><p>Example :</p><pre>@Provides<br>    @Singleton<br>    User getUserObj() {<br>        <strong>return</strong> <strong>new</strong> User();<br>    }</pre><blockquote><strong>Scope Annotations?</strong></blockquote><p>In order to define a scope of a method or class we use these <strong>Scope</strong> <strong>Annotations</strong>. These annotations come under <strong>javax.inject</strong> package.</p><p>By Default there is no scope annotation, a new instance is created whenever there is a injection.</p><p>Commonly used scope annotation is :</p><blockquote><strong>Singleton Scope Annotation</strong></blockquote><p>A <strong>Dependency</strong> using <strong>Singleton</strong> scope annotation gets instantiated just once throughout the app session.</p><p>Consider below example to understand more about scope annotations in Dagger.</p><pre>@Provides<br>@Singleton<br>    User getUserObj() {<br>        <strong>return</strong> <strong>new</strong> User();<br>    }</pre><p>Here, we have used <strong>@Singleton</strong> annotation to make sure that only a single object is created by getUserObj() for User class.</p><blockquote><strong>Inject Annotation</strong></blockquote><p>Using this annotations we inject dependency in dependent classes or request dependencies.</p><p>We can use this annotation on Method,Constructor or field.</p><p>Stay tuned to next article where we will use a Coding example to understand how to integrate Dagger2 in Android.</p><p>Cheers!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2721d4a2f46e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RecyclerView Orientation Types]]></title>
            <link>https://medium.com/@kamalvaid/recyclerview-orientation-types-9d15c3424d85?source=rss-ac8a5902947b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d15c3424d85</guid>
            <category><![CDATA[layoutmanager]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[recyclerview]]></category>
            <dc:creator><![CDATA[Kamal Vaid]]></dc:creator>
            <pubDate>Sat, 29 Dec 2018 19:30:17 GMT</pubDate>
            <atom:updated>2018-12-29T19:43:01.865Z</atom:updated>
            <content:encoded><![CDATA[<h3>RecyclerView LayoutManager Types</h3><blockquote><strong>RecyclerView?</strong></blockquote><p>As we know RecyclerView is more advanced and efficient version of ListView. Using RecyclerView, we can display and maintained large number of data using limited number of views.</p><blockquote><strong>LayoutManagers?</strong></blockquote><p>We can manage/create RecyclerView behaviours using LayoutMangers. RecyclerView uses pre built LayoutMangers and Implements different behaviours such as :</p><ol><li>Vertical/Horizontal List(Using LinearLayoutManger)</li><li>Uniform Grid List (Using GridLayoutManager)</li><li>Staggered Grid List (Using StaggeredGridLayoutManager)</li></ol><blockquote><strong>LayoutManager is For?</strong></blockquote><p><em>LayoutManger Helps us in :</em></p><ol><li>Orientation of the List (Vertical orHorizontal).</li><li>Manages positions of the items.</li><li>Defines type of list i.e List, Gird or staggered.</li><li>Calculates position and size of items of individual items in the RecyclerView.</li></ol><blockquote><strong>LinearLayoutManager</strong></blockquote><p>In order to show list in a vertical or horizontal fashion we make use of LinearLayoutManager.</p><p><strong>Below is the code snippet :</strong></p><ol><li><em>Horizontal LinearLayoutManager</em></li></ol><pre><strong>val </strong>layoutManager = LinearLayoutManager(<strong>this</strong>)<br>layoutManager.<em>orientation </em>= LinearLayoutManager.<em>HORIZONTAL<br><br></em>recyclerview.<em>layoutManager</em>=layoutManager</pre><p>2. <em>Vertical LinearLayoutManager</em></p><pre><strong>val </strong>layoutManager = LinearLayoutManager(<strong>this</strong>)<br>layoutManager.<em>orientation </em>= LinearLayoutManager.<em>VERTICAL<br><br></em>recyclerview.<em>layoutManager</em>=layoutManager</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*CIQSR4T4-FF6UEk_7SqSSw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*4TrNpBYqGQ33Mqo45PpSPA.png" /><figcaption>RecyclerView with Vertical and Horizontal behaviours. (Image references from <a href="https://enoent.fr/images/articles/recyclerview-basics/recyclerview-linear-horizontal-reversed.png">https://enoent.fr/images/articles/recyclerview-basics/recyclerview-linear-horizontal-reversed.png</a>)</figcaption></figure><blockquote>GridLayoutManager</blockquote><p>To display list items in the form of grid similar to Photos app inside our phone we use the LayoutManager.</p><p><strong><em>GridLayoutManager</em></strong> accepts two parameters in below code snippet i.e Context and SpanCount.</p><p><strong>Below is the code snippet :</strong></p><pre><strong>val </strong>layoutManager =GridLayoutManager(<strong>this</strong>,2)<em><br><br></em>recyclerview.<em>layoutManager</em>=layoutManager</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*Tf6PvNZsloOsuJXIV0Ty6A.png" /><figcaption>RecyclerView with Grid (Image reference from <a href="https://enoent.fr/images/articles/recyclerview-basics/recyclerview-grid-3-vertical-reversed.png">https://enoent.fr/images/articles/recyclerview-basics/recyclerview-grid-3-vertical-reversed.png</a>)</figcaption></figure><blockquote>StaggeredLayoutManager</blockquote><p>This LayoutManager comes into play when we want to display items in random and zig zag way. In short individual items may varies in terms of dimensions (width or height).</p><p><strong><em>StaggeredGridLayoutManager</em></strong> accepts two parameters in below code snippet i.e SpanCount and Orientation (Vertical or Horizontal).</p><p><strong>Below is the code snippet :</strong></p><pre><strong>val </strong>layoutManager = StaggeredGridLayoutManager(3,StaggeredGridLayoutManager.<em>VERTICAL</em>)</pre><pre>recyclerview.<em>layoutManager</em>=layoutManager</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*O85m9gBDswe42D0cEoHaNg.png" /><figcaption>RecyclerView with Staggered Grid(Image reference from <a href="https://enoent.fr/images/articles/recyclerview-basics/recyclerview-staggered-grid.png">https://enoent.fr/images/articles/recyclerview-basics/recyclerview-staggered-grid.png</a>)</figcaption></figure><p>That’s what all we need to know if we want handle RecyclerView with different behaviours. Above mentioned code snippets are in Kotlin and will be posting the whole tutorial with Github link soon.</p><p>Happy Coding!!</p><p>Cheers!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d15c3424d85" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Copy Cat : The App To Copy Everything From EveryWhere :-)]]></title>
            <link>https://medium.com/@kamalvaid/copy-cat-the-app-to-copy-everything-from-everywhere-8cbcd90291aa?source=rss-ac8a5902947b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cbcd90291aa</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[app-review]]></category>
            <category><![CDATA[copy]]></category>
            <dc:creator><![CDATA[Kamal Vaid]]></dc:creator>
            <pubDate>Wed, 05 Dec 2018 20:44:24 GMT</pubDate>
            <atom:updated>2018-12-05T20:44:24.614Z</atom:updated>
            <content:encoded><![CDATA[<h3>Copy Cat : The App To Copy Everything From EveryWhere :-)</h3><p>Android by default has the long press which gives us various options, using which we can copy and paste text from one place to another.</p><blockquote><strong>Copy Disabled</strong></blockquote><p>But what if we want to copy useful/meaningful text found in an app and that app has disabled the copy feature. What we do in that case, We start writing that text again. This is ok if text is not that long and you have that much time to write :D . But what if text is too long, for a lazy person like me it’s impossible to write that text :( .</p><p>Now you can overcome this pain of writing the text where copy is disabled by using a simple app named <a href="https://play.google.com/store/apps/details?id=com.simplifiedtext"><strong>CopyCat</strong></a><strong>.</strong></p><h3><strong>Copycat : Copy Any Text On Screen (100% accurate)</strong></h3><p>It is super easy to use <a href="https://play.google.com/store/apps/details?id=com.simplifiedtext"><strong>Copycat</strong></a> app on your Android mobile as it doesn’t come with a lot of options or any complicated feature. This app also works great if you are using a phone with low memory as it does not occupies much of space i.e less than 2.5 MB.</p><p>In order to utilize this, just <a href="https://play.google.com/store/apps/details?id=com.simplifiedtext"><strong>Download</strong></a> this amazing app on your Android mobile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Fdyn4IoRHTcLlEIIt2dZQ.png" /><figcaption>Copycat on Google Play Store</figcaption></figure><p>Once you successfully install Copycat, you will get the below launch(first) screen, where you will have only two option’s to enable this app and get yourself running copy any text on screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*zaFh9F8QeuFrYNI2ZUnqug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*1BvuP0N24ojqkjU8KgRRTw.png" /><figcaption>Launch Screen with Two Options</figcaption></figure><blockquote><strong>Auto Save</strong></blockquote><p>This feature will automatically save text which you have copied into your your <strong>Notes</strong> i.e will save your one step if you regularly copy text between apps and then paste in your <strong>Notes</strong> for reference.</p><p>You can enable AutoSave mode either by tapping on the text displayed in the launch screen or simply tapping settings from the more option icon at the right top of the app. These options will take you to settings page of the app as shown above where you can toggle on/off the <strong>AutoSave</strong> feature as required.</p><p>Now whenever you copy something you will get a local notification in the notification panel from Copycat having two options <strong>Discard</strong> and <strong>Save. </strong>Clicking on Save option will automatically save the copied text into your <strong>Copycat Notes</strong>.It is super Awesome :-) .</p><blockquote><strong>Universal Copy</strong></blockquote><p>This is the second mode that you will see on the launch screen once you install <strong>Copycat</strong>.</p><p>Again, You can enable <strong>Universal Copy</strong> mode either by tapping on the text displayed in the launch screen or simply tapping settings from the more option icon at the right top of the app. And in the settings page you can toggle on/off the settings for this feature as required.</p><p>After enabling it on your mobile, you can find a <strong>Notification</strong> on your Notification status bar. Whenever, you want to copy any text, you will have to go to your notification bar and enable it for a particular time.</p><p>Hope you find this Super Amazing app to make copy text easy where ever disabled :-) . Download and do leave a review &amp; rating for the app once you use it.</p><p>Cheers !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cbcd90291aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started With Action On Google — Part 2]]></title>
            <link>https://blog.chatbotslife.com/getting-started-with-action-on-google-part-2-7e36ed09b287?source=rss-ac8a5902947b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e36ed09b287</guid>
            <category><![CDATA[google-assistant]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[action-on-google]]></category>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Kamal Vaid]]></dc:creator>
            <pubDate>Mon, 03 Sep 2018 05:22:44 GMT</pubDate>
            <atom:updated>2018-09-06T12:56:27.115Z</atom:updated>
            <content:encoded><![CDATA[<p>As in the last article we gone through all the basic stuff which is required to build your <strong>Action</strong> in <strong>Action On Google</strong>, now lets dig into the next level i.e how you can use <strong>DialogFlow</strong> to construct the <strong>Conversational</strong> part in your <strong>Action</strong>.</p><p>Firstly Go to <a href="https://console.actions.google.com/u/">Action On Google console</a> for your <strong>Action</strong> and follow the below steps :</p><p><strong>Step 1 : Navigating to Actions</strong></p><p>Click on actions in the left navigation and you will be re-directed actions pages to create your first action page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4G3ZlmMQtnqx-wLLv6AMig.png" /><figcaption>Add your first action.</figcaption></figure><p><strong>Step 2 : Adding Your First Action</strong></p><p>Click on add your first action button and you will be prompted to select the language if not already and then finally you will get a pop-up saying create Action. The pop-up will list custom intent, Built-in Intents, Templates, Home-automation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a5QwyqWR7AYObyvoMyXmEw.png" /><figcaption>Building Action</figcaption></figure><p><strong>Step 3 : Continuing Building Action With DialogFlow</strong></p><p>Select Custom Intents and click on build. You will be re-directed to DialogFlow console. It will ask for login with <strong>Google</strong> i.e <strong>Gmail</strong> if you are not already logged into the console. Once you do that then it will create a <strong>DialogFlow</strong> <strong>Agent</strong> for you which will taking care of all the <strong>conservations</strong> between your <strong>Action</strong> and <strong>Users</strong>.</p><figure><a href="https://www.eventbrite.com/e/chatbot-conference-tickets-45884424549?utm-medium=discovery&amp;utm-campaign=social&amp;utm-content=attendeeshare&amp;aff=escb&amp;utm-source=cp&amp;utm-term=listing"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oyftTzPL9qaCYc8z2EbcHg.png" /></a></figure><blockquote>DialogFlow Agents are the modules which uses Natural Language Understanding mechanism to transform user requests into results mapped with that particular request.</blockquote><p>Once you are there in <strong>DialogFlow</strong> <strong>Agent</strong> creation console page, just give your <strong>Agent</strong> a name and click on create. And will you will be able to see below screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BsWfpQicNHjyHy6NOUgfEQ.png" /></figure><p>Awesome :-) You have successfully created your <strong>Agent</strong> and Now you are ready to build <strong>conservations</strong> to which your <strong>Action</strong> will respond via <strong>DialogFlow</strong>.</p><h3>Trending AI Articles:</h3><blockquote><a href="https://chatbotslife.com/introduction-to-deep-learning-on-social-networks-how-to-learn-even-more-about-your-personal-life-cd1da6d67770">1. Intro to Deep Learning in Social Networks</a></blockquote><blockquote><a href="https://chatbotslife.com/ultimate-guide-to-leveraging-nlp-machine-learning-for-you-chatbot-531ff2dd870c">2. Ultimate Guide to Leveraging NLP &amp; NLU for you Chatbot</a></blockquote><blockquote><a href="https://chatbotslife.com/deep-learning-in-7-lines-of-code-7879a8ef8cfb">3. Deep Learning in 7 Lines of Code</a></blockquote><blockquote><a href="https://chatbotslife.com/ai-nlp-workshop-fa39e2eac049">4. AI &amp; NLP Workshop</a></blockquote><p><strong>Lets Understands how DialogFlow Works before jumping into creating conservations.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*5vfGtU4LV2wPmcBnOgaPOw.png" /><figcaption>Reference Image From :<a href="https://dialogflow.com/docs/agents">https://dialogflow.com/docs/agents</a></figcaption></figure><p>Above Flow diagram depicts how <strong>DialogFlow</strong> process the request from user and delivers the <strong>Results</strong> back.</p><p>So in order to handle user request we need to create <strong>Intents</strong> which contain’s <strong>Training</strong> <strong>Phrases</strong> mapping to what User Say’s.</p><p>So what is Intent all about?</p><blockquote><strong>Intents : Contains training data (phrases) which will map to User request and returns the action to be taken as per user request.</strong></blockquote><p>There are different Sections available in Intents which needs to be implemented. Sections like :</p><ol><li>Contexts</li><li>Events</li><li>Training Phrases</li><li>Action and Parameters</li><li>Responses</li><li>Fulfillment</li></ol><p>In this article we will focus on 2 Sections mainly i.e <strong>Training</strong> <strong>Phrases</strong> and <strong>Responses</strong> in order to create a successful Intent responding to User request.</p><p><strong>Creating a Intent</strong></p><p><strong>Step 1 : Create a intent</strong></p><p>Click on the <strong>+ (plus)</strong> icon in front of <strong>Intents</strong> inside the left navigation panel in <strong>DialogFlow</strong> <strong>Agent</strong> console. After clicking you will be re-directed to New <strong>Intent</strong> page in the <strong>DialogFlow</strong> where you need to enter the name of the <strong>Intent</strong> (Give a meaning name to your Intent like AboutMe here)and click on Save Button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aQSjp0DFMyS-c7zgGiti-Q.png" /><figcaption>New Intent Creation Page</figcaption></figure><p><strong>Step 2 : Understanding Training Phrases</strong></p><p>Now go to the 3rd Section i.e <strong>Training phrases</strong> and click on <strong>ADD TRAINING PHRASES</strong>. You will see a section opening up, which will allow you to add phrases to which your <strong>Intent</strong> will respond with results if those phrases matches with User requests(Saying). So think about all the possible phrases that a user can say which can map with your intent for a result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ETlIBUUzPkt9yO45keUVQ.png" /><figcaption>Training Phrases Section</figcaption></figure><p><strong>Step 3 : Adding Training Phrase’s</strong></p><p>Once you identified the phrases for your <strong>Intent</strong> to handle now its time to add them in the <strong>training phrase</strong> section. Something like :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QUcL8KxzFEfGANde9NWCZw.png" /><figcaption>Training Phrases Example</figcaption></figure><p><strong>Step 4 : Add a response in your intent</strong></p><p>Once you are done with adding all the possible <strong>training phrases</strong> in the concerned section now its time to add <strong>response</strong> which user will see as a result if its request/query if matched with defined Intent training phrases.</p><p>Further Response has 2 Tabs :</p><ol><li>Default</li><li>Google Assistant</li></ol><p>Here in this article we will focus on adding default response and will learn how to use <strong>Google Assistant</strong> tab effectively for response in next article.</p><blockquote>Default Response : Contains list of text responses which will be triggered as a result of your intent if user request matches the training phrases defined in the training phrases section.</blockquote><p>Note : If you have defined multiple text responses in the default response section than a text response will be picked randomly for results</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DtsW2TxYn8s1lWxVBn1UXA.png" /><figcaption>Adding a response for the intent</figcaption></figure><p>Great, once you complete all the above steps then you are ready with your first <strong>Intent</strong> and now lets see how can we test this intent in <strong>DialogFlow</strong>.</p><p>But before jumping to test the intent do not forget to <strong>Save your Intent</strong> :-). Just click on Save button placed right side of Intent name.</p><p><strong>Step 5 : Testing the Intent in DialogFlow</strong></p><p>At the right side , you will see a <strong>Try It Now</strong> input box. Here in this Input box you need to enter a text matching or carrying same meaning as one of training phrases defined in the <strong>Training Phrases</strong> Section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WL4o3q8X2D4DYflO6M5cJg.png" /><figcaption>Testing Intent</figcaption></figure><p>Here you can see the input and result exactly as of expected. Agent responded to user query with the default response that we defined in the <strong>Response</strong> section.</p><p>So thats how you can create ’N’ number of intents depending upon you Action requirement.</p><p>Now lets test this in our <strong>Action on Action</strong> <strong>On</strong> <strong>Google</strong> Console. In order to do that :</p><p><strong>Step 1 : Select Simulator</strong></p><p>Go to Left navigation panel in your <strong>Action</strong> <strong>On</strong> <strong>Google</strong> Console and select simulator.</p><p><strong>Step 2 : Enable Testing In Simulator</strong></p><p>Click on Start testing button in the simulator and you will see a pop-up displaying you versions of your actions for testing. Since we have not published anything yet we will se a draft version. Just click on Done to enable testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MfnKuB_wEXyDjhqQiHdXhQ.png" /></figure><p>Thats it, now you can test the Intent we created in the <strong>DialogFlow</strong> whether it is working in Action inside <strong>Action</strong> <strong>On</strong> <strong>Google </strong>Console<strong> </strong>or not.</p><p>In order to do that just click on talk to my app (<strong>Invocation</strong> that you defined for your action ) and write the query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*75lE7N4uyVMt3XNG2-a3fg.png" /><figcaption>Tested Result on AOG Simulaor</figcaption></figure><p>Thats it for now. Thanks for reading :-).</p><p>In Next Article, i will describe how you use Google Assistant Tab for showing results in AOG.</p><p>And its time for some networking now. Lets get connected, connect with me on : <a href="https://www.linkedin.com/in/kamal-vaid/">LinkedIn</a> , <a href="https://plus.google.com/u/1/+KamalVaid">Google+</a>, <a href="https://twitter.com/cammykamal">Twitter</a>, <a href="https://github.com/cammykamal">Github</a>, <a href="https://www.facebook.com/cammykamal">Facebook</a> .</p><p>For more details do checkout the Official documentation :</p><p><a href="https://developers.google.com/actions/extending-the-assistant">Action On Google</a></p><p><a href="https://dialogflow.com/docs/getting-started">DialogFlow</a></p><p>Cheers!!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F3e59ef%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F3e59ef&amp;image=http%3A%2F%2Fapi.screenshotlayer.com%2Fapi%2Fcapture%3Faccess_key%3Dfe59908dad3baab69ffab249a2224b03%26viewport%3D1024x612%26width%3D1000%26url%3Dhttps%253A%252F%252Fupscri.be%252F3e59ef%253Fscreenshot&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href">https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href</a></iframe><figure><a href="https://chatbotslife.com/bot-communities-mastermind-group-d2dae9876709#.53x0py6ou"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*6XUspT9JOSq0w0Fi35HIaA.png" /></a></figure><figure><a href="https://m.me/ChatbotsLife"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*c1LDMH5vbnIz9rmAka8Hwg.png" /></a></figure><figure><a href="https://chatbotslife.com/chatbot-development-hire-top-ai-chatbot-developers-c8b45ef7f207"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*D0Jf3dI6ZThtqcfwDYY7mg.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e36ed09b287" width="1" height="1" alt=""><hr><p><a href="https://blog.chatbotslife.com/getting-started-with-action-on-google-part-2-7e36ed09b287">Getting Started With Action On Google — Part 2</a> was originally published in <a href="https://blog.chatbotslife.com/">Chatbots Life</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>