<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6819244212846682870</id><updated>2024-11-08T07:05:40.347-08:00</updated><category term="Android"/><category term="Android O"/><category term="Android SDK"/><category term="Authentication"/><category term="Java"/><category term="Kotlin"/><category term="TextView"/><category term="Android Studio"/><category term="Animation"/><category term="Auto Size"/><category term="AutoFIt"/><category term="Bottom navigation"/><category term="Debug"/><category term="Dynamic Animation"/><category term="Fingerprint"/><category term="Fonts"/><category term="Github API"/><category term="Gradle"/><category term="Layout"/><category term="Library"/><category term="Material design"/><category term="Mobile Development"/><category term="Observable"/><category term="Observer"/><category term="Picture in picture"/><category term="Reactive Programming"/><category term="ReactiveX"/><category term="RxBinding"/><category term="Rxjava"/><category term="Security"/><category term="Spring Animation"/><category term="Sqlite"/><category term="Typeface"/><category term="Video"/><category term="Xml"/><category term="databse"/><category term="shared preferences"/><title type='text'>OverrideAndroid </title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://overrideandroid.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://overrideandroid.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rahul Mohan</name><uri>http://www.blogger.com/profile/12975251566930884736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6819244212846682870.post-4017573530884816605</id><published>2018-05-04T05:59:00.000-07:00</published><updated>2018-05-04T07:48:41.068-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Authentication"/><category scheme="http://www.blogger.com/atom/ns#" term="Github API"/><category scheme="http://www.blogger.com/atom/ns#" term="Gradle"/><category scheme="http://www.blogger.com/atom/ns#" term="Library"/><title type='text'>Github OAuth Client Library - Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjvrgsr1QZz2E-fGqaVFlrL0PNrNUYw3LIAA66NO-0HnqMSpl7v_6E9E2BfmWYJaix47RZ85C7gh2SWfKow42Cho_hfCuPMtLKuYVfHAChOwGvSudRh5TqQOkBNNykOVBmLqolOEH74FsQ/s1600/login.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1600&quot; data-original-width=&quot;900&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjvrgsr1QZz2E-fGqaVFlrL0PNrNUYw3LIAA66NO-0HnqMSpl7v_6E9E2BfmWYJaix47RZ85C7gh2SWfKow42Cho_hfCuPMtLKuYVfHAChOwGvSudRh5TqQOkBNNykOVBmLqolOEH74FsQ/s320/login.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfZ31vPlYTPnzEUn4tIrrj1XCuP2V2Li6ACGVwIWXSM4cpPhhXv-mTEF1gdeEmaKRLKCvRIlq2U3ePtDwGcZ1K3YzrpAEjMw4yhf7dsx92O3p3nGBKhxxDDZxlg6A4KioOUp_JV3P7tKFA/s1600/authorize.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1600&quot; data-original-width=&quot;900&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfZ31vPlYTPnzEUn4tIrrj1XCuP2V2Li6ACGVwIWXSM4cpPhhXv-mTEF1gdeEmaKRLKCvRIlq2U3ePtDwGcZ1K3YzrpAEjMw4yhf7dsx92O3p3nGBKhxxDDZxlg6A4KioOUp_JV3P7tKFA/s320/authorize.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; margin-left: 1em; margin-right: 1em; text-decoration: none; vertical-align: baseline; white-space: pre;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
The Github_OAuth library helps to easily add a Github&#39;s OAuth implementation flow to your Android application. &lt;br /&gt;
&lt;br /&gt;
It will open a new Dialog Fragment with webview and user token will be returned on callback.&lt;br /&gt;
&lt;br /&gt;
Find more about &lt;a href=&quot;https://developer.github.com/v3/guides/basics-of-authentication/#registering-your-app&quot;&gt;GitHub&#39;s OAuth implementation&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Let’s go through a sample application that authenticate using Github. complete source code of this library and sample application is available on&lt;a href=&quot;https://github.com/rahulmmohan/Github_OAuth&quot;&gt; &lt;/a&gt;&lt;a href=&quot;https://github.com/rahulmmohan/Github_OAuth&quot;&gt;Github.&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Setup&lt;/h2&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Using Gradle&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
The Github-OAuth library is pushed to jcenter, so you need to add the following dependency to your app&#39;s build.gradle.&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/88bd563bf185f7a3005131fe7dcfafdc.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
As a module&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
If you can&#39;t include it as gradle dependency, you can also download this GitHub repo and copy the library folder to your project.&lt;/div&gt;
&lt;div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
Usage&lt;/h2&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Obtaining GithubAuthenticator instance&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/c26e8dde1da2622fe68f9eb04d1495f8.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Obtaining an access token via the GithubAuthenticator&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/f7038f7045067ffc10d8f32e501213bd.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
Authenticate will open a new Dialog Fragment with webview and user token will be returned on callback&lt;/div&gt;
&lt;div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Enable logs&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/b3e25e0a5d9d55b551f6fd0d856696ff.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Scope can also be defined (optional)&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/8ee9dcadd50aea85b73d58345d3e76c7.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
Available scopes are from &lt;a href=&quot;https://developer.github.com/apps/building-oauth-apps/scopes-for-oauth-apps/#available-scopes&quot;&gt;developer page&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://overrideandroid.blogspot.com/feeds/4017573530884816605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://overrideandroid.blogspot.com/2018/05/github-oauth-client-library-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/4017573530884816605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/4017573530884816605'/><link rel='alternate' type='text/html' href='http://overrideandroid.blogspot.com/2018/05/github-oauth-client-library-android.html' title='Github OAuth Client Library - Android'/><author><name>Rahul Mohan</name><uri>http://www.blogger.com/profile/12975251566930884736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjvrgsr1QZz2E-fGqaVFlrL0PNrNUYw3LIAA66NO-0HnqMSpl7v_6E9E2BfmWYJaix47RZ85C7gh2SWfKow42Cho_hfCuPMtLKuYVfHAChOwGvSudRh5TqQOkBNNykOVBmLqolOEH74FsQ/s72-c/login.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6819244212846682870.post-7388774810684680891</id><published>2018-01-02T09:06:00.000-08:00</published><updated>2018-01-02T09:06:01.089-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android O"/><category scheme="http://www.blogger.com/atom/ns#" term="Android SDK"/><category scheme="http://www.blogger.com/atom/ns#" term="Picture in picture"/><category scheme="http://www.blogger.com/atom/ns#" term="Video"/><title type='text'>Picture-in-Picture: Working in Android Oreo</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh205kHVQsPSRWsT9hKVGJ3gYdeYrXafn9DAOK4EwP6oBNRVeWWF5HysaX7wV3TWePaxDsIu7jkxpSMd0BEWyuos8EIjz0poLetLll1FCTWUlxw11yufwEqrvAc6KCftIk5PKAaaDA0TqPC/s1600/Screen+Shot+2018-01-02+at+10.18.20+PM.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;586&quot; data-original-width=&quot;800&quot; height=&quot;467&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh205kHVQsPSRWsT9hKVGJ3gYdeYrXafn9DAOK4EwP6oBNRVeWWF5HysaX7wV3TWePaxDsIu7jkxpSMd0BEWyuos8EIjz0poLetLll1FCTWUlxw11yufwEqrvAc6KCftIk5PKAaaDA0TqPC/s640/Screen+Shot+2018-01-02+at+10.18.20+PM.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;span id=&quot;docs-internal-guid-f513ff12-b7c9-d574-a2b2-c045c8d49585&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;/div&gt;
&lt;span id=&quot;docs-internal-guid-f513ff12-b7c9-d574-a2b2-c045c8d49585&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span id=&quot;docs-internal-guid-f513ff12-b7c9-d574-a2b2-c045c8d49585&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;From release of the &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android O&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, which saw some exciting new additions for us to get our hands on!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;One of the most noticeable user-facing changes is the introduction of a &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;picture in picture (PIP)&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; option – similar to an Apple iPad feature added in iOS 9 – which should make multitasking easier in some circumstances. &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;PIP&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; is a special type of multi-window mode mostly used for video playback. &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;PIP&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; mode is already available for Android TV; Android O makes the feature available on other Android devices.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Let’s take a look at this exciting new feature and how we can implement it into our Android applications!&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To learn more about Picture-in-Picture I created a playground project to have a play with the new features. &lt;/span&gt;&lt;a href=&quot;https://github.com/rahulmmohan/Android-PictureInPicture&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;You can check this out for yourself here!&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;What is Picture-In-Picture?&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Picture-in-Picture (PiP)&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; allows you to keep videos open as they play on top of of another screen. This wouldn’t be the same as the multi-window feature which allows users to keep two apps open simultaneously, but instead is likely to be more similar to the way YouTube videos play in a small player at the bottom right corner of the screen after you minimize them which allows you to continue scrolling through YouTube and looking at other videos. The change here would be that users will have the ability to do the same type of thing but while in other apps as well.&lt;/span&gt;&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Implementing Picture-in-Picture&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Implementing Picture-in-Picture into our applications is a simple process. There’s only several steps allow us to display PiP-windows to our users!&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;picture-in-picture support&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The first step, is allow your activity to support PiP. Set &lt;/span&gt;&lt;span style=&quot;color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;android:supportsPictureInPicture&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; tag to true:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/53965f6e61d6bf0ba5f8d99c3e32b484.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Enter Picture In Picture Mode&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To enter picture-in-picture mode, an activity must call &lt;/span&gt;&lt;span style=&quot;color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;enterPictureInPictureMode(). &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The other thing to keep in mind is that you need specials parameters to enter to PiP mode from your activity:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/b4cbc6296ae20b558c1c2ed001ba5dfd.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;You need to set an aspect ratio to PiP parameters builder. The aspect ratio is used when the activity is in PiP mode. To do that, you have to pass the width and height of your video view. Then, you can call to enterPictureInPictureMode passing the PiP parameters built.&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Handling UI during picture-in-picture&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;When the activity enters or exits picture-in-picture mode the system calls &lt;/span&gt;&lt;span style=&quot;color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Activity.onPictureInPictureModeChanged()&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; or &lt;/span&gt;&lt;span style=&quot;color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Fragment.onPictureInPictureModeChanged()&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/039d414ca20fb882ed70e13ef23d5f46.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 4pt; margin-top: 14pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;References&lt;/span&gt;&lt;/h1&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;
&lt;li style=&quot;font-family: roboto; font-size: 11pt; list-style-type: disc; vertical-align: baseline; white-space: pre;&quot;&gt;&lt;a href=&quot;https://android-developers.googleblog.com/2017/03/first-preview-of-android-o.html&quot; style=&quot;font-size: 11pt; text-decoration: none;&quot;&gt;&lt;span style=&quot;color: blue; font-size: 11pt; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;https://android-developers.googleblog.com/2017/03/first-preview-of-android-o.html&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: roboto; font-size: 11pt; list-style-type: disc; vertical-align: baseline; white-space: pre;&quot;&gt;&lt;a href=&quot;https://developer.android.com/preview/migration.html&quot; style=&quot;font-size: 11pt; text-decoration: none;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;https://developer.android.com/preview/migration.html&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: roboto; font-size: 11pt; list-style-type: disc; vertical-align: baseline; white-space: pre;&quot;&gt;&lt;a href=&quot;http://www.androidcentral.com/android-o&quot; style=&quot;font-size: 11pt; text-decoration: none;&quot;&gt;&lt;span style=&quot;color: blue; font-size: 11pt; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://www.androidcentral.com/android-o&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;color: #666666; font-family: roboto; font-size: 11pt; white-space: pre;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: roboto; font-size: 11pt; white-space: pre;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: roboto; font-size: 11pt; white-space: pre;&quot;&gt;&lt;/span&gt;&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://overrideandroid.blogspot.com/feeds/7388774810684680891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://overrideandroid.blogspot.com/2018/01/picture-in-picture-working-in-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/7388774810684680891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/7388774810684680891'/><link rel='alternate' type='text/html' href='http://overrideandroid.blogspot.com/2018/01/picture-in-picture-working-in-android.html' title='Picture-in-Picture: Working in Android Oreo'/><author><name>Rahul Mohan</name><uri>http://www.blogger.com/profile/12975251566930884736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh205kHVQsPSRWsT9hKVGJ3gYdeYrXafn9DAOK4EwP6oBNRVeWWF5HysaX7wV3TWePaxDsIu7jkxpSMd0BEWyuos8EIjz0poLetLll1FCTWUlxw11yufwEqrvAc6KCftIk5PKAaaDA0TqPC/s72-c/Screen+Shot+2018-01-02+at+10.18.20+PM.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Kochi, Kerala, India</georss:featurename><georss:point>9.9312328 76.267304100000047</georss:point><georss:box>9.4307463000000009 75.621857100000042 10.4317193 76.912751100000051</georss:box></entry><entry><id>tag:blogger.com,1999:blog-6819244212846682870.post-5408024556129450463</id><published>2017-05-09T21:00:00.001-07:00</published><updated>2017-05-12T18:26:44.872-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android SDK"/><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Kotlin"/><title type='text'>How to Use Kotlin in Your Android Projects</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;autosizing_banner.png&quot; src=&quot;https://lh6.googleusercontent.com/PqUM48d4IGgynE8I209r9hhxgoDLg36jJnIuVq_4HhEL46eRJD4KS-yU61KX3x2I8mMxCKbxdzsH370TUDAwAri103wmYPNoo5qVvBhnwKYZmH07Vl_4E9apUrHNNDavPT5fmKsr&quot; style=&quot;border: none; transform: rotate(0rad);&quot;&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt; text-align: left;&quot;&gt;
&lt;b id=&quot;docs-internal-guid-cac0dbd9-f07c-f9f2-ac11-2d2349d9f5d5&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;One great news of &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;moving to Kotlin&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; is, do not need to start from a new project. You could add it to your existing Java Android project. The language is interoperable with Java. So you could use steps below either for a new or existing project.&lt;/span&gt;&lt;/div&gt;
&lt;/b&gt;&lt;/h1&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Setting up Your Environment&lt;/span&gt;&lt;/h1&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt; text-align: left;&quot;&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;By default, Android Studio has no idea what to do with Kotlin, so the first step is to install the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin plugin&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and configure Kotlin in your project.&lt;/span&gt;&lt;/div&gt;
&lt;/b&gt;&lt;/h1&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Installing the Kotlin Plugin&lt;/span&gt;&lt;/h2&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt; text-align: left;&quot;&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Launch Android Studio and install the kotlin plugin.&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;In Android Studio&#39;s quick start menu, select &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Configure &amp;gt;&amp;gt; Plugins&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;click on Install &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;JetBrains plugin…&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Search for and select &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;from the list and click &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Install&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;When the installation completes,&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; restart Android Studio&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; to activate the plugins.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;ezgif-1-f35f72b52d.gif&quot; height=&quot;565&quot; src=&quot;https://lh6.googleusercontent.com/SSYKto6lCn_q7-Gh72q_eVAkXDjbf_iZz_PTLGwwUeeP6zES3HvBv5RRqiQwAa4qCbm2VzokPh9xaibEXOUitouxnutZzH53NEk4JG-bI_Ir4iz2rKDwZpXlsycgIzeLaA_r3BPy&quot; style=&quot;border: none; transform: rotate(0rad);&quot; width=&quot;640&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/b&gt;&lt;/h1&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Configuring Your Project to Use Kotlin&lt;/span&gt;&lt;/h2&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt; text-align: left;&quot;&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Now IDE can understand and run Kotlin code, but need to configure kotlin for every project.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create a new project in Android Studio from &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;File &amp;gt;&amp;gt; New Project &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;by filling the required details.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Select &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Tools &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;from the Android Studio toolbar, followed by &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;and &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Configure Kotlin in Project&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-05-10 at 8.47.47 AM-min.png&quot; height=&quot;324&quot; src=&quot;https://lh6.googleusercontent.com/djKLuaH-G_Lg84TVFrLYDi1f7fzkMpqRXbRx62KbUj_uZ4eg1so4nOTHnCCjESIxHKLPrKUceRgpzSL0SBJ2CGobnWwrwLxynZSiKtH07S9m7ptJp4YsDtJFBPjButumquzPAjJL&quot; style=&quot;border: none; transform: rotate(0rad);&quot; width=&quot;640&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;On the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Configure Kotlin in Project&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; popup, select the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;plugin version&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; you want to use and click &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;OK&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-05-10 at 8.49.43 AM-min.png&quot; height=&quot;187&quot; src=&quot;https://lh6.googleusercontent.com/AKnVcIKfaVBAk5udjcheTJfI6HuXNA-3pwUMlLdR32TtU-WNg2L6yPtdOo_YL8CGDCXuOenxlxhReaNn4XSKAt6poQ4UjjuEMSjSaa1iAgGehbE73jD5wGZTn0OEOtmOssZX_jL8&quot; style=&quot;border: none; transform: rotate(0rad);&quot; width=&quot;400&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The Configure Kotlin in Project option makes a number of changes to your project’s&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; build.gradle&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; files, so let’s take a closer look at how these files have changed. Open your &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;project-level &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;build.gradle&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; file. it should look something like this:&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/fc880daa0d2ced8ee608ffce5c7aa37d.js&quot;&gt;&lt;/script&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Now, let’s take a look at your &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;module-level &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;build.gradle&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; file:&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/a05af70d7469849351db38d16046aaf2.js&quot;&gt;&lt;/script&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Click on &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Sync Now&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; to build the project.&lt;/span&gt;&lt;/div&gt;
&lt;/b&gt;&lt;/h1&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Convert Any Java File to Kotlin&lt;/span&gt;&lt;/h1&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt; text-align: left;&quot;&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;One of the feature of &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;kotlin plugin&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; is that we can convert a &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;java classes to kotlin classes&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Let&#39;s convert MainActivity file into a Kotlin source file by invoking the Kotlin plugin’s &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Convert Java File to Kotlin File&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; action.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Select your MainActivity file, and then select &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Code &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;from Android Studio’s menu bar, followed by &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Convert Java File to Kotlin File&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-05-10 at 8.50.41 AM-min.png&quot; height=&quot;391&quot; src=&quot;https://lh6.googleusercontent.com/fusbk6HgNQIFSzHrgCG6HdaxrAUkQ5zzt02d9k8CBeS0ns3QitvW4HkRZuzGyKFwce6mzpBod3S4tZaSXheSe0X9pM12rdXaM5ZNtUrPl82Zrn8kD1kDWmFxQOHwSWoCnGDSZ7LC&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;624&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Your newly-converted &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;MainActivity&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; should look something like this:&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/80ee1491a04877d8f3716c7a34462d75.js&quot;&gt;&lt;/script&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Notice that the file&#39;s extension has changed from &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.java&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; to &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.kt&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/b&gt;&lt;/h1&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Using Kotlin Android Extensions&lt;/span&gt;&lt;/h1&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt; text-align: left;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin Android Extensions&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; plugin allow you to use the widgets in the layout XML directly in activity without calling the &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;findViewById&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; method.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Add &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;org.jetbrains.kotlin:kotlin-android-extensions&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; as a build script dependency in app module&#39;s &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: italic; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;build.gradle&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/635eea860f9df0d0e4a9148cb1d138a8.js&quot;&gt;&lt;/script&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create a Kotlin class, &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;KotlinActivity&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, that extends &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Activity &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;and override its &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;onCreate &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;method. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To create a Kotlin file, right your &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;app/src/main/&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; directory and select &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;New &amp;gt;&amp;gt; Kotlin Activity&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-05-10 at 8.51.49 AM-min.png&quot; height=&quot;391&quot; src=&quot;https://lh6.googleusercontent.com/pIt9IkkFAG7X88Us679eMUOZU0PxOMpFrgVrkt-SveH_yGhDNLMqdzLFqbQ0WtGYJn3qftV-jogXVhtLTz1wqntb1B6wB44acHqfUsr09NOrrOrdPWNE9zZjRuwbuCdiA-SGOiLZ&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;624&quot;&gt;&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/8c650d93ab866f5f65f158cb1da8da28.js&quot;&gt;&lt;/script&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;In the layout XML file, define a &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;TextView &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;with an id of &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;messageTextview&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;br&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/0e55a32d63b480de35080984429d6274.js&quot;&gt;&lt;/script&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Now, instead of calling &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;findViewById &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;to get a reference to the TextView, you can import it using the following code snippet:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #000088; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; kotlinx&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;android&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;synthetic&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;another_activity&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;myMessage&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;If you had more widgets in your layout, you can import all of them using the following code snippet:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #000088; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; kotlinx&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;android&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;synthetic&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;another_activity&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.*&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Now access &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;TextView &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;using its id &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;messageTextview&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;messageTextview&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;setText&lt;/span&gt;&lt;span style=&quot;color: #666600; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #008800; font-family: &amp;quot;consolas&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&quot;Hello&quot;)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;In this tutorial, you have learned how to use Kotlin in your Android projects after installing the Kotlin plugin and the Kotlin Android Extensions plugin for Android Studio. As Kotlin and Java classes are largely interoperable, if you are still learning Kotlin, it is best to introduce it in your Android projects gradually.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/h1&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
&lt;/span&gt;&lt;/h1&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://overrideandroid.blogspot.com/feeds/5408024556129450463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://overrideandroid.blogspot.com/2017/05/how-to-use-kotlin-in-your-android.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/5408024556129450463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/5408024556129450463'/><link rel='alternate' type='text/html' href='http://overrideandroid.blogspot.com/2017/05/how-to-use-kotlin-in-your-android.html' title='How to Use Kotlin in Your Android Projects'/><author><name>Rahul Mohan</name><uri>http://www.blogger.com/profile/12975251566930884736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh6.googleusercontent.com/PqUM48d4IGgynE8I209r9hhxgoDLg36jJnIuVq_4HhEL46eRJD4KS-yU61KX3x2I8mMxCKbxdzsH370TUDAwAri103wmYPNoo5qVvBhnwKYZmH07Vl_4E9apUrHNNDavPT5fmKsr=s72-c" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6819244212846682870.post-295137382568640881</id><published>2017-04-30T02:27:00.001-07:00</published><updated>2017-05-10T20:34:56.595-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Android SDK"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Kotlin"/><category scheme="http://www.blogger.com/atom/ns#" term="Mobile Development"/><title type='text'>Kotlin: Do more with less code</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbIyT8I_FRXC67j3wcYn2MhcmTkoehm5P0V1m2520JG1kp2XHOLNDiCqPrQG8QPPxlRVs6AC4BQUA6U2tgGdYPJDe523nSoBzeVt8cvJG7pBRhiJa9mECwGhnIjMe33OWDnuYal-zumncC/s1600/autosizing_banner.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbIyT8I_FRXC67j3wcYn2MhcmTkoehm5P0V1m2520JG1kp2XHOLNDiCqPrQG8QPPxlRVs6AC4BQUA6U2tgGdYPJDe523nSoBzeVt8cvJG7pBRhiJa9mECwGhnIjMe33OWDnuYal-zumncC/s1600/autosizing_banner.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Java&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; is the most widely used language for Android development, but that doesn’t mean it is always the best choice.The biggest problem with Java is that it is &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;old&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;verbose&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, not a “&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;modern&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;language&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;” and don’t forget the infamous &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;NullPointerException&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Java 8&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, bringing some modern flavors to the language but Android certainly doesn’t use all the features of Java 8 and we are still stuck in the old Java 7 and 6.That&#39;s where &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; comes in: This relatively new open source language, based on the Java Virtual Machine (JVM), is gaining traction with Android software engineers. &lt;/span&gt;&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;What is Kotlin?&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; is a statically-typed programming language(sometimes referred to as Swift for Android) that runs on the JVM, developed by the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;JetBrains team&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, and is now in its 1.1 version. What makes it useful in Android development is that it compiles to JVM bytecode. It is fully compatible with Java, and Kotlin code can be simply converted to Java code and vice versa (there is a plugin from JetBrains). That means Kotlin can use any framework, library etc. written in Java.&lt;/span&gt;&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Why Kotlin&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Java 8 solved some language issues and corrected even more with Java 10. In order to get much of a benefit from the corrections made in these two releases, you have to set the minimum SDK to Android 24 just to use Java 8, which isn’t an option for many developers. For almost everybody, Java 10 isn’t even on the radar.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; aims to fill that gap of a missing modern language for the Android platform.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; Kotlin&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; has heap of features, here covering just the important ones to get you started.&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;No More NullPointerExceptions&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;One of the most common reasons for crashes in our apps&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; have been the NullPointerExceptions.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; comes with &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;null-safety&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; system which helps in catching null(s) during compile time.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;By default every variable is treated as non-null unless we tell to compiler that it’s a null variable using an special operator “&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;” at the end of the variable type.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Suppose you have a String variable and you are trying to assign a null value to it:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/81daed4198cefdc4fdd8a141f30b5609.js&quot;&gt;&lt;/script&gt;



&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Using this null variable in further code will also give compile-time error unless handled using not null condition.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/387d5766d3dd4ef685e59f56870347ad.js&quot;&gt;&lt;/script&gt;



&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The compiler is smart enough to understand that we are using an object which can be null-able hence it shows compile time error.&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Write Less Code, Be Happy- Lambda Expressions&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;A &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;lambda expression&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; represents an anonymous function. Lambdas are a great way of reducing the amount of code needed to perform some tasks that come up all the time in Android development.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Java 8 has introduced native lambda expressions, and these are now supported in Android Nougat. Although this feature isn’t something that’s unique to Kotlin, it’s still worth taking a look at them. Plus, if you’re working on a project that contains both Kotlin and Java code, then you can now use lambda expressions across your entire project!&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Adding a click listener to a button. In Java 7 and earlier, this would typically require the following code:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/a436fcbfe7c298ebfdb41d3c357fbfd5.js&quot;&gt;&lt;/script&gt;



&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;However, Kotlin lambda functions allow you to set a click listener using a single line of code:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/698a03b0d609639752a9b84da33ea47b.js&quot;&gt;&lt;/script&gt;


&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Smart Casting&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Smart casting is one of the interesting feature of Kotlin compiler. The Compiler does smart casting on our behalf. It even handles the negative scenario like if the “view” is not an “TextView”.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/67fe9a0d80d4873ecd95ba1ff4b410c1.js&quot;&gt;&lt;/script&gt;



&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Great IDE and Tooling Support&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; is a &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;JetBrains&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; product, the ones who specialize in creating some of the best and most used IDEs in the world.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;There is a plugin that you can install in Android Studio to get Kotlin working in your project.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-04-30 at 11.25.07 AM-min.png&quot; height=&quot;513&quot; src=&quot;https://lh4.googleusercontent.com/HWngkZg438XB6leFqIIy_q9X4Uo4ubn5sqfdN6ZUkjJ9VveiNmuvjIuzG9h5-P1Lbb8GjhQVO7hUQ9AqJ6zR_4aVVxnq1ARSaEvEjFiYzTXON4pQ8cco7Hb-TObTN_l3hV61WLos&quot; style=&quot;border: none; transform: rotate(0rad);&quot; width=&quot;624&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;All IDE features work perfectly in Kotlin. You can mix and match Kotlin and Java code in the same project and everything still works great. The IDE support is really great with Kotlin where other JVM based languages don’t even come close.&lt;/span&gt;&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;About the Syntax&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;In order to understand the features of Kotlin. We will have a look at the basic syntax in Kotlin. You can refer the syntax in detail from the official website.&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Variables&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The way to define a variable is with the “val” or “var” keyword. The type will be inferred from the Context:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/041e0db27e9c3cc9e437139273ee673e.js&quot;&gt;&lt;/script&gt;




&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;You can specify the type explicitly:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/0149aeafcdeaea16c52f68ac41c01526.js&quot;&gt;&lt;/script&gt;




&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Did you notice there is no new keyword near ArrayList() ?. Because there is no new keyword in Kotlin.&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Functions&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Structure of the function:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/fd7fd30498c1af5a9ea8a13019dbaadf.js&quot;&gt;&lt;/script&gt;



&lt;br /&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Start with “&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;” keyword&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The parameter names are written before the type&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The return type is written at the end of the function&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The above function can be &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin-ized&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; even more:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/567440a13224bfe93cfdf1566a538c55.js&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Did you notice there are no semicolons(;) ?. Kotlin is semicolon free language :)&lt;/span&gt;&lt;br /&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 4pt; margin-top: 14pt;&quot;&gt;
&lt;b id=&quot;docs-internal-guid-639a772a-bdff-3280-a97e-4ab5e1902e87&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;font-weight: normal; line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To learn more about &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, I recommend browsing the &lt;/span&gt;&lt;a href=&quot;http://kotlinlang.org/docs/reference/&quot; style=&quot;font-weight: normal; text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin reference&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. The &lt;/span&gt;&lt;a href=&quot;http://kotlinlang.org/docs/reference/basic-syntax.html&quot; style=&quot;font-weight: normal; text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Getting Started&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; section will help you get up to speed with this new language.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;In the &lt;a href=&quot;http://www.overrideandroid.info/2017/05/how-to-use-kotlin-in-your-android.html&quot; target=&quot;_blank&quot;&gt;next tutorial&lt;/a&gt;, you will learn how to use the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin plugin&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Kotlin Android Extensions&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; plugin for Android Studio.&lt;/span&gt;&lt;/div&gt;
&lt;/b&gt;&lt;/h1&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://overrideandroid.blogspot.com/feeds/295137382568640881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://overrideandroid.blogspot.com/2017/04/kotlin-do-more-with-less-code.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/295137382568640881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/295137382568640881'/><link rel='alternate' type='text/html' href='http://overrideandroid.blogspot.com/2017/04/kotlin-do-more-with-less-code.html' title='Kotlin: Do more with less code'/><author><name>Rahul Mohan</name><uri>http://www.blogger.com/profile/12975251566930884736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbIyT8I_FRXC67j3wcYn2MhcmTkoehm5P0V1m2520JG1kp2XHOLNDiCqPrQG8QPPxlRVs6AC4BQUA6U2tgGdYPJDe523nSoBzeVt8cvJG7pBRhiJa9mECwGhnIjMe33OWDnuYal-zumncC/s72-c/autosizing_banner.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6819244212846682870.post-6438068483334783004</id><published>2017-04-20T09:04:00.000-07:00</published><updated>2017-04-30T22:23:46.697-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Animation"/><category scheme="http://www.blogger.com/atom/ns#" term="Dynamic Animation"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring Animation"/><title type='text'>Introduction to Spring Animation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvYFodSOCIe0VY0Z-r8PvscY2AuaEjXqPTm8cOPMSaDeVUymgM1n8zgjAnNyfXNwvfCoJIR5j39wd7sdnxjv24ZtTNJCP6MnZNObeMJkYbx91s1Isv0okdKhrkgQQtA1OdpoRhE-HgbMpZ/s1600/1*h_Zu8ZtaUOxOIfvHX7U95Q.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvYFodSOCIe0VY0Z-r8PvscY2AuaEjXqPTm8cOPMSaDeVUymgM1n8zgjAnNyfXNwvfCoJIR5j39wd7sdnxjv24ZtTNJCP6MnZNObeMJkYbx91s1Isv0okdKhrkgQQtA1OdpoRhE-HgbMpZ/s1600/1*h_Zu8ZtaUOxOIfvHX7U95Q.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;When writing an application, it&#39;s important to consider exactly what your graphical demands will be. Varying graphical tasks are best accomplished with varying techniques. Android provides a variety of powerful APIs for applying animation to UI elements and drawing custom 2D and 3D graphics.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Dynamic-animation&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; is a new module introduced in revision 25.3.0 of the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android Support Library&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. It provides a small set of classes for making realistic &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Physics-based Animations&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;What is Physics-based Animation&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Physics-based animation&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; uses the fundamentals of physics to build animations. An animation is driven by force. The animation comes to rest when the force reaches equilibrium. The new set of animation APIs embeds physics to render a more natural-looking and flexible animation.&lt;/span&gt;&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Spring Animation&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Spring Animation&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; is one of the animation API provided by the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Dynamic-animation&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; module. Physics-based animations are driven by force. Spring force, is one such force that guides interactivity and motion. In a &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;spring-based animation&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, the value and the velocity are calculated based on the spring force that are applied on each frame.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;ezgif.com-video-to-gif.gif&quot; height=&quot;400&quot; src=&quot;https://lh5.googleusercontent.com/IM7yz81I9HmLi2C36N_-fN4ig_rIbZCkC88ONMnhMbrl6V0cQgEoL8p-hs4d26kTGz3UU7FPK0PlhRH9MkZKSrCczOUREWtWEN9Q4vfY81fFpkJnN9WZte6BTEIRvO4NkKbZKJTH&quot; style=&quot;border: none; transform: rotate(0rad);&quot; width=&quot;195&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To demonstrate, I am creating a simple app that animate a view with &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;spring-based animation. &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Complete source code for the examples used in this tutorial is available on &lt;/span&gt;&lt;a href=&quot;https://github.com/rahulmmohan/SpringAnimation&quot; style=&quot;text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;github&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Let’s start by creating a new project.&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Creating New Project&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create a new project in Android Studio from &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;File &amp;gt; New Project&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. When it prompts you to select the default activity, select &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Empty Activity&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and proceed.&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Update Build Configuration&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;In order to use the physics-based support library, you must modify your app project&#39;s classpath dependencies within your development environment.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To add a support library to your application project:&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Open the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;build.gradle&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; file of your application.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Add the support library to the dependencies section.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/e8473a2b2d456ab827bc499f016cee56.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Making a Spring Animation&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Let’s start with how every Spring Animation is made.&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create a SpringAnimation object for your View with a specified ViewProperty&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create a SpringForce object and set your desired parameters&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Apply the created SpringForce to your SpringAnimation.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Start the animation&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Creating the Layout&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;So quickly create a layout with a ImageView placed center of the screen.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/646e6557488354a5d92c9a021dc7f327.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create a SpringAnimation object&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Open your &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;MainActivity.java&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and create a method that returns SpringAnimation with SpringForce object and set your desired parameters. The method look like this:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/e55ecd8ab47923a168cc585159e87e95.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Now create SpringAnimation objects for the ImageView.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/72e5adce2eb81d3a398bb53aab750041.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;color: #666666; font-size: 14.666666984558105px;&quot;&gt;Damping ratio&lt;span style=&quot;font-weight: 400;&quot;&gt;
The damping ratio describes a gradual reduction in a spring oscillation. By using the damping ratio, you can define how rapidly the oscillations decay from one bounce to the next.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: 14.666666984558105px; white-space: pre-wrap;&quot;&gt;Stiffness&lt;/span&gt;&lt;span style=&quot;font-size: 14.666666984558105px; font-weight: normal; white-space: pre-wrap;&quot;&gt;
Stiffness defines the spring constant, which measures the strength of the spring. A stiff spring applies more force to the object that is attached when the spring is not at the rest position.&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Drag the view. Springs back to its original position&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Now we are going to drag the view around the screen and when it release the view springs back to its original position.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/a00eec821be40e4a32c00770f0f194c6.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 4pt; margin-top: 14pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;color: #666666; font-size: 14.666666984558105px;&quot;&gt;That&#39;s it :)&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://overrideandroid.blogspot.com/feeds/6438068483334783004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://overrideandroid.blogspot.com/2017/04/introduction-to-spring-animation.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/6438068483334783004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/6438068483334783004'/><link rel='alternate' type='text/html' href='http://overrideandroid.blogspot.com/2017/04/introduction-to-spring-animation.html' title='Introduction to Spring Animation'/><author><name>Rahul Mohan</name><uri>http://www.blogger.com/profile/12975251566930884736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvYFodSOCIe0VY0Z-r8PvscY2AuaEjXqPTm8cOPMSaDeVUymgM1n8zgjAnNyfXNwvfCoJIR5j39wd7sdnxjv24ZtTNJCP6MnZNObeMJkYbx91s1Isv0okdKhrkgQQtA1OdpoRhE-HgbMpZ/s72-c/1*h_Zu8ZtaUOxOIfvHX7U95Q.png" height="72" width="72"/><thr:total>1</thr:total><georss:featurename>Kochi, Kerala, India</georss:featurename><georss:point>9.9312328 76.267304100000047</georss:point><georss:box>9.4307463000000009 75.621857100000042 10.4317193 76.912751100000051</georss:box></entry><entry><id>tag:blogger.com,1999:blog-6819244212846682870.post-4524720860141174489</id><published>2017-04-12T10:26:00.000-07:00</published><updated>2017-04-30T22:27:20.805-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="databse"/><category scheme="http://www.blogger.com/atom/ns#" term="Debug"/><category scheme="http://www.blogger.com/atom/ns#" term="shared preferences"/><category scheme="http://www.blogger.com/atom/ns#" term="Sqlite"/><title type='text'>Android Debug Database: A Library for Debugging Android Databases and Shared Preferences</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW1Ki8KTvUPKJ6JS4FDRSNTbp9Pyr2NTAFzFJJzJ32snQCZtjlWSjw7UYAPRTsC-wMhWB_B-uEtWj8ugJ06USi7JVOTJgaC1KRLyBqDkM1UMDpPVErrFMlUnnXikP7JPwgzrDURbAwER1-/s1600/Android-Debug-database.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW1Ki8KTvUPKJ6JS4FDRSNTbp9Pyr2NTAFzFJJzJ32snQCZtjlWSjw7UYAPRTsC-wMhWB_B-uEtWj8ugJ06USi7JVOTJgaC1KRLyBqDkM1UMDpPVErrFMlUnnXikP7JPwgzrDURbAwER1-/s1600/Android-Debug-database.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android comes with a powerful built-in database called &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SQLite&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, but it doesn&#39;t come with the best set of debugging tools. When it comes to debugging databases in an android application, it is very difficult to see what’s happening inside the database. The same is true with &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Shared Preferences&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. In fact, unless you have a rooted device, you can&#39;t even get the SQLite tables off your device without jumping through some hoops.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android Debug Database&lt;/span&gt;&lt;/h1&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android Debug Database is a powerful library for debugging &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SQLite databases &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;and &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Shared Preferences&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; in Android applications. It allows you to view databases and shared preferences directly in your browser in a very simple way.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;By using the Android Debug Database we can do the following:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;See all the databases.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;See all the data in the shared preferences used in your application.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Run any sql query on the given database to update and delete your data.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Directly edit the database values.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Directly edit shared preferences.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Delete database rows and shared preferences.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Search in your data.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Sort data.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Download database.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android Debug Database Library in your application&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Let’s take a look how we can implement it into our Android applications and debug the SQLite databases and shared preferences.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 14.666666984558105px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Complete source code for the examples used in this tutorial is available on &lt;a href=&quot;https://github.com/rahulmmohan/Android-Debug-Database&quot;&gt;github&lt;/a&gt;. &lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Creating New Project&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;We’ll start by creating new project in Android Studio and do the basic setup required.Create a new project in Android Studio from &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;File &amp;gt; New Project&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and fill the project details.&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Update Build Configuration&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Open &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;build.gradle&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; located under &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;app&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; module and add android debug database dependency.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/55697324b7cef2d37fe28bd2416d6d13.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create SQLite Database Handler Class&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create a new class in your project src directory and name it as &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;DatabaseHandler.java&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; ( Right Click on &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;src/package &amp;gt; New &amp;gt; Class&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Now extend your &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;DatabaseHandler.java&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; class from &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SQLiteOpenHelper&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/42e8b58e86b095e0affdd9aaf78e2136.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Insert Records&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Update &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;MainAcitvity.java&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; file to create the instance of &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;DatabaseHandler.java&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; class and add some rows.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/a1b3a152b5fe0bf164d981fe3461508e.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Store Data Using Shared Preferences&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Another way of storing data of an application is called &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;Shared Preference&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;s&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. Shared Preferences allow you to save and retrieve data in the form of key,value pair.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create a Shared Preference instance and store some values.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/ac781248f98a3cbaaf2c3fdc095142ea.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Debugging Databases and Shared Preferences&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Now we can debug the database and shared preference used in the app with the help of a web interface.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To do that do the following steps:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Your Android phone and laptop should be connected to the same Network.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;If you are using it over usb, run &lt;/span&gt;&lt;span style=&quot;background-color: #d9d9d9; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;adb forward tcp:8080 tcp:8080 &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: 72pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Start the application, you will see in the logcat an entry like follows :&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmtZWZP-i4_oRAmhF7SgA4jvdKtp7Z1jzG0ec0Gf1WiflBQhjWxMFG3IEh-tx8Rod3iduNozupO8wZCJCjIBFtuB4ow5fKNc2n5waoFQ4zk-CNovUmAfNmUr7vHrxW-nOpZxOcmNRkESUC/s1600/Screen+Shot+2017-04-12+at+10.23.31+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;112&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmtZWZP-i4_oRAmhF7SgA4jvdKtp7Z1jzG0ec0Gf1WiflBQhjWxMFG3IEh-tx8Rod3iduNozupO8wZCJCjIBFtuB4ow5fKNc2n5waoFQ4zk-CNovUmAfNmUr7vHrxW-nOpZxOcmNRkESUC/s640/Screen+Shot+2017-04-12+at+10.23.31+PM.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android Default Emulator: run &lt;/span&gt;&lt;span style=&quot;background-color: #d9d9d9; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;adb forward tcp:8080 tcp:8080&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and open &lt;/span&gt;&lt;a href=&quot;http://localhost:8080/&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://localhost:8080&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;If you want use different port other than 8080. In the app build.gradle file under buildTypes do the following change :&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/ffe1746fd4736ee8b495af3e44fb6fe2.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Seeing Sqlite Database&lt;/span&gt;&lt;img alt=&quot;Screen Shot 2017-04-12 at 10.25.16 PM-min.png&quot; src=&quot;https://lh4.googleusercontent.com/g47Dwxmo-UyrvmpOaB7EjJk-zAkjhg_m4sCypcY_qSkvarw-G5-0nLYnWEMouGn3unV55FvF69gmU1FfchRy2nMfY2tvt97U1wTxCbEkoFkkdv41px79CL0r83KBKtucZoSBrGOw&quot; style=&quot;border: none; color: #666666; font-family: Roboto; font-size: 11pt; font-weight: 400; transform: rotate(0rad); white-space: pre-wrap;&quot; /&gt;&lt;/h2&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Editing Values&lt;/span&gt;&lt;img alt=&quot;Screen Shot 2017-04-12 at 10.25.35 PM-min.png&quot; src=&quot;https://lh3.googleusercontent.com/93FoPJw5B24Z-PI0RnjcxcqwhaVl5GkWPrCB_KqYxuBZhqn34Ltt5hTlbTgjVH33-tRPq1Vr6m_SYMkLuCX4Qs2kKbo_UUSw8Ex3jtyvHEld3mQ9ENzjOSfGWrUnEPOlHUtxccNh&quot; style=&quot;border: none; color: #666666; font-family: Roboto; font-size: 11pt; font-weight: 400; transform: rotate(0rad); white-space: pre-wrap;&quot; /&gt;&lt;/h2&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Run Sql Query&lt;/span&gt;&lt;img alt=&quot;Screen Shot 2017-04-12 at 10.26.47 PM-min.png&quot; src=&quot;https://lh5.googleusercontent.com/Jk5_Rjv2xwe0C6LdSsUX9Z9OqKDO1bfmOy_tSpXDy_o4b1-nRxpmy-wMHx1T0o4kkV2gA1crmmvQXa4-OY_8Ra8WYIAZPJalK5EzW_z6cnU_uipLgkdEbeeVDd3dZS-e_kEvWLEI&quot; style=&quot;border: none; color: #666666; font-family: Roboto; font-size: 11pt; font-weight: 400; transform: rotate(0rad); white-space: pre-wrap;&quot; /&gt;&lt;/h2&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Seeing Shared Preference&lt;/span&gt;&lt;img alt=&quot;Screen Shot 2017-04-12 at 10.26.19 PM-min.png&quot; src=&quot;https://lh6.googleusercontent.com/3lnY02EAD9FZlcnpZfRwhy1B4sHA2IIEelNFmawtFgpaCbCy8LimDPiOT2FJD4DDjydUCbwX07hCPoXsLezSpLnxvdhFa3eUSbDkozMrlTcruo_kid_4s8V8-F6VfIIvh6uxJ1Z-&quot; style=&quot;border: none; color: #666666; font-family: Roboto; font-size: 11pt; font-weight: 400; transform: rotate(0rad); white-space: pre-wrap;&quot; /&gt;&lt;/h2&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 4pt; margin-top: 14pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;div&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/h1&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 4pt; margin-top: 14pt;&quot;&gt;
&lt;/h1&gt;
&lt;span style=&quot;color: #666666; font-family: roboto;&quot;&gt;&lt;span style=&quot;font-size: 14.666666984558105px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://overrideandroid.blogspot.com/feeds/4524720860141174489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://overrideandroid.blogspot.com/2017/04/android-debug-database-library.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/4524720860141174489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/4524720860141174489'/><link rel='alternate' type='text/html' href='http://overrideandroid.blogspot.com/2017/04/android-debug-database-library.html' title='Android Debug Database: A Library for Debugging Android Databases and Shared Preferences'/><author><name>Rahul Mohan</name><uri>http://www.blogger.com/profile/12975251566930884736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW1Ki8KTvUPKJ6JS4FDRSNTbp9Pyr2NTAFzFJJzJ32snQCZtjlWSjw7UYAPRTsC-wMhWB_B-uEtWj8ugJ06USi7JVOTJgaC1KRLyBqDkM1UMDpPVErrFMlUnnXikP7JPwgzrDURbAwER1-/s72-c/Android-Debug-database.png" height="72" width="72"/><thr:total>4</thr:total><georss:featurename>Kochi, Kerala, India</georss:featurename><georss:point>9.9312328 76.267304100000047</georss:point><georss:box>9.4307463000000009 75.621857100000042 10.4317193 76.912751100000051</georss:box></entry><entry><id>tag:blogger.com,1999:blog-6819244212846682870.post-45672693749412604</id><published>2017-04-05T11:46:00.000-07:00</published><updated>2017-04-30T22:28:09.339-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android O"/><category scheme="http://www.blogger.com/atom/ns#" term="Auto Size"/><category scheme="http://www.blogger.com/atom/ns#" term="AutoFIt"/><category scheme="http://www.blogger.com/atom/ns#" term="TextView"/><title type='text'>Exploring Android O: Autosizing TextViews</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHImsj2N9pipSCmUZhJ3rjhihrVSJpd0Bd-6mDstMkKykIb4ztDQJxMoIZIKB4-aF7w7pWcHisBtfzGcSRZehFx4oddjV8ceaVxqx0IQ6AN5H3ahkNHC8KxjrK75J6NAJgZrOgJ9xYZCl5/s1600/autosizing_banner.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHImsj2N9pipSCmUZhJ3rjhihrVSJpd0Bd-6mDstMkKykIb4ztDQJxMoIZIKB4-aF7w7pWcHisBtfzGcSRZehFx4oddjV8ceaVxqx0IQ6AN5H3ahkNHC8KxjrK75J6NAJgZrOgJ9xYZCl5/s1600/autosizing_banner.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;With the release of first developer preview of &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android O, &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Google come with a solution to &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;auto-size&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; text in a &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;TextView&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; similar to the way the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;iOS SDK&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; allows to select “&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;fit text to box&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;”. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Let’s take a look at this exciting new feature and how we can implement it into our Android applications!&lt;/span&gt;&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Autosizing TextViews&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android O&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; allows to instruct a &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;TextView&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; to let the size of the text expand or contract automatically to fill its layout based on the TextView&#39;s characteristics and boundaries. This setting makes it easier to optimize the text size on different screens with dynamic content.&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Creating New Project&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;We’ll start by creating new project in Android Studio and do the basic setup required.Create a new project in Android Studio from &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;File &amp;gt; New Project&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and fill the project details. While creating the project, select the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;API O: Android 7+(O preview)&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; as Minimum SDK.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-04-05 at 10.09.58 PM-min.png&quot; height=&quot;364&quot; src=&quot;https://lh4.googleusercontent.com/4CKx94Q7CFEC-TkuMEchhT0dBztk0ly_R4LT_yYtT14LS3uJ2kIsE4ncRkkvGZ5EPvaS_VsRHkvCR2VXMRz3x-zY6m-oR6MJziIrGcEZ0RsizEJqx_lkGReO61fg9fb1KRBDDjQo&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;624&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Update Build Configuration&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Open &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;build.gradle&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; located under &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;app&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; module and Update &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;compileSdkVersion&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;buildToolsVersion&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;targetSdkVersion&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, and the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Support Library&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; version with the following versions:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/4297aed9fe7840343a7fb5a5e0d2a6ef.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Textview Autosizing in XML&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;There are two ways to set up &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;TextView&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; Autosizing in XML. By using &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Granularity&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Preset Sizes.&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Granularity&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;By using granularity, we can specify a range of minimum and maximum text sizes and a dimension that specifies the size of each step. The TextView can uniformly scale, in a range between the given minimum and maximum size attributes. Each increment takes on the step size specified in the granularity attribute.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/33c35f2a53bb1fd77a5b52d3791aa40e.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;autoSizeText&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; attribute to instruct the TextView to auto-size. The valid values are &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;none&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, which is a default value, and &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;uniform&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;autoSizeMinTextSize&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The minimum text size constraint to be used when auto-sizing text&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;autoSizeMaxTextSize&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;: The maximum text size constraint to be used when auto-sizing text&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;autoSizeStepGranularity&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; attributes to set the autosizing dimensions in the layout XML file.The default is 1px. Overwrites autoSizePresetSizes if set.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Another method to define these attributes is to use the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Properties &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;window. Selected the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Design tab&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; at the bottom of the window and open the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Properties &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;window.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-04-05 at 11.04.46 PM-min.png&quot; height=&quot;207&quot; src=&quot;https://lh5.googleusercontent.com/X5t0IbeBf_a_BpQd6xBAX8Uy8EZjFMU8oqrDW8XatY275FdJoephjc5DIwq3af5T-tu0tBriapdlVNpVxTDxCnPWlglsTsP2Qi_aUrfpF9kaGcmSS_pZ7qmM51Poy08dO0p847Rq&quot; style=&quot;border: none; transform: rotate(0rad);&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Preset Sizes&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Preset sizes are used to, autosize the TextView from a list of predefined sizes. &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;autoSizePresetSizes&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; attribute in the layout XML file is used to &amp;nbsp;instruct the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;TextView&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; to auto-size from a size array.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;You can create a array file by the following steps&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Right-click the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;values&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; folder and go to &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;New &amp;gt; Values resource file&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Give file name: &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;arrays&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-04-05 at 11.03.31 PM-min.png&quot; height=&quot;217&quot; src=&quot;https://lh4.googleusercontent.com/ftmw_2H9V092f_4KsM-COWHaZBVFAD6qQ8JDOzHLka7Dt9ixcGdZE5VBgfhMyixFZ_pTK6f3zWrd5ZmPUKTKR8rEH79-pw4GYYTq27dSsOak97tQTZ4U4XfsIdIXaTzRArSn9oNF&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;624&quot; /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/97e2ba5d258eef550d206870a20b4eec.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/976c281b4e69ecc6f4207d0ec3bb9e30.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;You can also define these attributes in the Properties window in Android Studio.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-04-05 at 11.04.46 PM 2-min.png&quot; height=&quot;207&quot; src=&quot;https://lh6.googleusercontent.com/I0YekTrfUgphHGo2JIJyGr0fM3vV6BI_MgqM7DE9VUqFKK5DYgrCrOQwlW6eexfYuW8WKF5dMxbxztIfgh_M2R8mWT1h4oGVsPGlkmX675X44vJxKlAx66LuKwMGxtCGkS1sEi2v&quot; style=&quot;border: none; transform: rotate(0rad);&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;b id=&quot;docs-internal-guid-55ce55f5-3f44-731d-c9f3-b0434487aa2f&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 11pt; margin-left: -0.75pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Using Textview Autosizing programmatically&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;You can set up autosizing programmatically by using the following methods:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To set up the autosizing by using &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;granularity&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, Call the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;setAutoSizeTextTypeUniformWithConfiguration(int autoSizeMinTextSize, int autoSizeMaxTextSize, int autoSizeStepGranularity, int unit)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;method. You can use any &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;TypedValue&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; dimension unit for maximum, minimum, and granularity values.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To set up the autosizing by using &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;preset sizes&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, Call the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;setAutoSizeTextTypeUniformWithPresetSizes(int[] presetSizes, int unit)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; method. You can provide an array of sizes and any TypedValue dimension unit for the size.&lt;/span&gt;&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 4pt; margin-top: 14pt;&quot;&gt;
&lt;/h1&gt;
&lt;span style=&quot;color: #666666; font-family: roboto;&quot;&gt;&lt;span style=&quot;font-size: 14.666666984558105px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://overrideandroid.blogspot.com/feeds/45672693749412604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://overrideandroid.blogspot.com/2017/04/exploring-android-o-autosizing-textviews.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/45672693749412604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/45672693749412604'/><link rel='alternate' type='text/html' href='http://overrideandroid.blogspot.com/2017/04/exploring-android-o-autosizing-textviews.html' title='Exploring Android O: Autosizing TextViews'/><author><name>Rahul Mohan</name><uri>http://www.blogger.com/profile/12975251566930884736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHImsj2N9pipSCmUZhJ3rjhihrVSJpd0Bd-6mDstMkKykIb4ztDQJxMoIZIKB4-aF7w7pWcHisBtfzGcSRZehFx4oddjV8ceaVxqx0IQ6AN5H3ahkNHC8KxjrK75J6NAJgZrOgJ9xYZCl5/s72-c/autosizing_banner.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6819244212846682870.post-2437905328376984418</id><published>2017-03-30T10:17:00.000-07:00</published><updated>2017-04-30T22:26:49.879-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android O"/><category scheme="http://www.blogger.com/atom/ns#" term="Fonts"/><category scheme="http://www.blogger.com/atom/ns#" term="Layout"/><category scheme="http://www.blogger.com/atom/ns#" term="TextView"/><category scheme="http://www.blogger.com/atom/ns#" term="Typeface"/><category scheme="http://www.blogger.com/atom/ns#" term="Xml"/><title type='text'>Exploring Android O: Fonts in XML</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy6A2UwRVP02DbgJo_nhoz1G6hrO3bDo9OpFlpB0_YBGh9GRXXx5aHmfSM-MA5xK6P3TlLNqX623CyLUsmdWcfh6W-nzVCGKnparsp0jzO6TOlpa5M1kTBwsn_1AVLy1_qsDVdF_IWnUyn/s1600/Android-O-min.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy6A2UwRVP02DbgJo_nhoz1G6hrO3bDo9OpFlpB0_YBGh9GRXXx5aHmfSM-MA5xK6P3TlLNqX623CyLUsmdWcfh6W-nzVCGKnparsp0jzO6TOlpa5M1kTBwsn_1AVLy1_qsDVdF_IWnUyn/s1600/Android-O-min.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Google just released a few information about the next version of Android, which arrives later this year and is known for now as &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android O&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span id=&quot;docs-internal-guid-489f0618-201d-7415-48e2-d74c5cd0337a&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;With the first developer preview, we saw some exciting stuff that will have a big impact for developers and the apps they can make. New ways to use custom fonts and icons, a better way to deliver professional-level audio and awesome ways to connect with others for things like head-to-head gaming or local social applications.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span id=&quot;docs-internal-guid-489f0618-201d-7415-48e2-d74c5cd0337a&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span id=&quot;docs-internal-guid-489f0618-201d-7415-48e2-d74c5cd0337a&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;One of the features of this announcement includes &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Fonts in XML&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; — in this article we’re going to take a look at exactly what this and how we can make use of them within our applications!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span id=&quot;docs-internal-guid-489f0618-201d-7415-48e2-d74c5cd0337a&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span id=&quot;docs-internal-guid-489f0618-201d-7415-48e2-d74c5cd0337a&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Get started with Android O SDK&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;span id=&quot;docs-internal-guid-489f0618-201d-7415-48e2-d74c5cd0337a&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span id=&quot;docs-internal-guid-489f0618-201d-7415-48e2-d74c5cd0337a&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android O Developer Preview&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, a program that gives you everything you need to make your apps compatible and build for the next version of Android.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span id=&quot;docs-internal-guid-489f0618-201d-7415-48e2-d74c5cd0337a&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span id=&quot;docs-internal-guid-489f0618-201d-7415-48e2-d74c5cd0337a&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Install Android Studio 2.4&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;span id=&quot;docs-internal-guid-489f0618-201d-7415-48e2-d74c5cd0337a&quot;&gt;
&lt;/span&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span id=&quot;docs-internal-guid-489f0618-201d-7415-48e2-d74c5cd0337a&quot;&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To access the O Developer Preview, you must first update to &lt;/span&gt;&lt;a href=&quot;https://developer.android.com/studio/preview/index.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android Studio 2.4&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. Only Android Studio 2.4 includes support for all the new developer features available with Android O. So you need to get the canary version of Android Studio 2.4 to begin using the Android O SDK.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span id=&quot;docs-internal-guid-489f0618-201d-7415-48e2-d74c5cd0337a&quot;&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Install SDK and tools&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Launch Android Studio 2.4 and open the SDK Manager by clicking &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Tools &amp;gt; Android &amp;gt; SDK Manager&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;In the &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SDK Platforms&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; tab, check &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Show Package Details&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. Below &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android O Preview&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; check the &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android SDK Platform O.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Switch to the &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SDK Tools&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; tab and check all items that have updates available. This should include the following that are required:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;color: #666666; font-family: Roboto; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; list-style-type: disc; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android SDK Build-Tools 26.0.0 (rc1 or higher)&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;color: #666666; font-family: Roboto; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; list-style-type: disc; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android SDK Platform-Tools 26.0.0 (rc1 or higher)&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;color: #666666; font-family: Roboto; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; list-style-type: disc; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android Emulator 26.0.0&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;color: #666666; font-family: Roboto; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; list-style-type: disc; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Support Repository&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Click &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;OK &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;to install all the selected SDK packages.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj71yMVV2USPAiJsWE2R6q6cPo4nm_EdrKQvaCv1F2-PBas7EWc3P2CTCRwu8ER-NVgCA9wExYA3tHJqoTKtyMzlNyOYTGJAnqwd-6XjyJ4Qqs7bnAMh0rvhzZLylY59z9EehXUMsJ_kZY9/s1600/Screen+Shot+2017-03-30+at+10.25.36+PM-min.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;420&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj71yMVV2USPAiJsWE2R6q6cPo4nm_EdrKQvaCv1F2-PBas7EWc3P2CTCRwu8ER-NVgCA9wExYA3tHJqoTKtyMzlNyOYTGJAnqwd-6XjyJ4Qqs7bnAMh0rvhzZLylY59z9EehXUMsJ_kZY9/s640/Screen+Shot+2017-03-30+at+10.25.36+PM-min.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Setup Device running Android O&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Download the Android O system image for the Android Emulator. It&#39;s listed in the &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SDK Manager &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;under &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android O Preview&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; as &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Google APIs Intel x86 Atom System Image&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Working With Fonts&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Android O introduces a new feature, &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Fonts in XML&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, which lets you use fonts as resources. This means, there is no need to bundle fonts as assets. Fonts are compiled in &lt;/span&gt;&lt;span style=&quot;color: #cc4125; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; file and are automatically available in the system as a resource.&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Creating New Project&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;We’ll start by creating new project in Android Studio and do the basic setup required.Create a new project in Android Studio from &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;File &amp;gt; New Project&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and fill the project details. While creating the project, I have selected the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Empty Activity&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; as default activity.&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Update Build Configuration&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Open &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;build.gradle&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; located under &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;app&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; module and Update &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;compileSdkVersion&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;buildToolsVersion&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;targetSdkVersion&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, and the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Support Library&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; version with the following versions:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/bbc505bec2ee6841d5796a056b46f094.js&quot;&gt;&lt;/script&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Add Fonts As Resources&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;You can access the font resources with the help of a new resource type, &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;font&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.To add fonts as resources do the following steps:&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #666666; font-family: Roboto; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; list-style-type: decimal; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Right-click the &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;res&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; folder and go to &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;New &amp;gt; Android resource directory&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #666666; font-family: Roboto; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; list-style-type: decimal; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Give Directory name: font&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #666666; font-family: Roboto; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; list-style-type: decimal; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;In the &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Resource &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-style: italic; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; list, select &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;font&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, and then click &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;OK&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 10.5pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-03-29 at 9.31.41 PM-min.png&quot; height=&quot;211&quot; src=&quot;https://lh6.googleusercontent.com/VHOS8TFWw-aatbTgN-PNIl60HXgpU2aUCuxyeOmIqnLmhTQZyrDe7L0NGgE2JOAFJe6FvX-xVC6oeTMxqQr8GLX1dTKpzX3D-EWXPb2GMC4LLOd-jfckbCN1Dv0MHxl673vdqdvx&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;624&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 10.5pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-03-29 at 9.28.02 PM-min.png&quot; height=&quot;363&quot; src=&quot;https://lh4.googleusercontent.com/Mu0VC6SvjcOdam2sGx9uWunVpp1gx4XDViQ6wxiAhlnGXU5VjQO5cKbZ4FMNObaGb0LhHMMEtbd8MEmpo5NzMe9qwGbkrt0-zO_PTinh62eK73M-0OQP38HQDrt2N6Vc8sn_Z7sH&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;624&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Next step is to add fonts in the font folder. &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #6a6a6a; font-family: &amp;quot;arial&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Google Fonts&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #545454; font-family: &amp;quot;arial&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; are beautiful web fonts that can be used without restrictions. You can download and install &lt;/span&gt;&lt;a href=&quot;https://fonts.google.com/&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: white; color: #1155cc; font-family: &amp;quot;arial&amp;quot;; font-size: 11pt; font-weight: 700; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Google Fonts&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #6a6a6a; font-family: &amp;quot;arial&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #6a6a6a; font-family: &amp;quot;arial&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;for free.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #6a6a6a; font-family: &amp;quot;arial&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Before adding font files to font folder rename files according to the naming conventions:&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;color: #666666; font-family: Roboto; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; list-style-type: decimal; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Resource name should contains be a-z,0-9,_&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;color: #666666; font-family: Roboto; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; list-style-type: decimal; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 11pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-size: 11pt; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Resource name should start with a-z,_&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 11pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Below is the project structure after adding the fonts to the font resource folder:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 11pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-03-29 at 10.24.27 PM-min.png&quot; height=&quot;331&quot; src=&quot;https://lh4.googleusercontent.com/8TD2CajteFMqfebH0eFMLZI8cuf7dBZcDKSRjjC_-Ib-pA6n_Tl72n4VVMV_tDdzwB8IqNP9kcWpe8ck3aTdbUGtXdGLPle9Cuwm1MJA6eGieKsGAiUKHmf7DOdFOx7pLh60GnNr&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;322&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 11pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Double-click a font file to preview the file&#39;s fonts in the editor.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 11pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 10.5pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-03-29 at 10.41.29 PM-min.png&quot; height=&quot;391&quot; src=&quot;https://lh4.googleusercontent.com/Hirz2y4lmxVewCc-39dbyt-V8_XUnAF0TEV50jG1Sfjjcnfjc55U7gcCl8v4AtN3pLHeo6jpzzkjTmpWnQq2EvZiP5o84CeM6elFvQ0HTrWxiiAj7WTuMEzmSiwGt8l2HtP7xyMg&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;624&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; white-space: pre-wrap;&quot;&gt;Using fonts in XML layouts&lt;/span&gt;&lt;br /&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To attach fonts to the &lt;/span&gt;&lt;span style=&quot;color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;TextView&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;or in styles, use the &lt;/span&gt;&lt;span style=&quot;color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;fontFamily&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;attribute.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Open &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;activity_main.xml&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; file and add a &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;TextView &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;to the layout. Then use the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #38761d; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;fontFamily &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;attribute to access the font file. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/95701e4b1eaba464c279f28fb715c7aa.js&quot;&gt;&lt;/script&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Another method to set the font is to use the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Properties &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;window. Selected the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Design tab&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; at the bottom of the window and open the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Properties &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;window.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-03-30 at 9.53.28 PM.png&quot; height=&quot;308&quot; src=&quot;https://lh5.googleusercontent.com/9PZ9F3ISjS3ekwNpXACmZe1f8td6v4GYZxX11jXgV2cu8nvd7AVlKjwv-Pt-4G0LGaregE_UVmHDtagkHVGSmYJTe9DwcErK66anUlmFdz-SJopVxLM7Dc0RS5RtQvFIE0bjY1Hw&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;297&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The Android Studio layout preview, shown in the rightmost pane allows you to preview the font set in the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;TextView&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 11pt; margin-top: 0pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-03-29 at 11.01.08 PM-min.png&quot; src=&quot;https://lh4.googleusercontent.com/7xx34xP3g1g6ZB9a667ZZZAA5hnFhvPDuEt2nk_w0OkG8ssgPYTL-hUcd1VyX_AmXMV3LdzlnWs80eGuVXEpG0H4kLuARYb8DF8myXvy6ROEFB419DmzrdZIfLODzW8h8V55aSi3&quot; style=&quot;border: none; transform: rotate(0rad);&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 11pt; margin-left: -0.75pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-weight: 400; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Using fonts programmatically&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;You can retrieve fonts by using the &lt;/span&gt;&lt;span style=&quot;color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;getFont(int)&lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; method, where you need to pass the resource identifier of the font that you want to retrieve. This method returns a &lt;/span&gt;&lt;span style=&quot;color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Typeface &lt;/span&gt;&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;object. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/0610d060c44968cfd65b5d47a8ac4f5d.js&quot;&gt;&lt;/script&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 4pt; margin-top: 14pt;&quot;&gt;
&lt;/h1&gt;
&lt;span style=&quot;color: #666666; font-family: roboto;&quot;&gt;&lt;span style=&quot;font-size: 14.666666984558105px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;/ul&gt;
&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://overrideandroid.blogspot.com/feeds/2437905328376984418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://overrideandroid.blogspot.com/2017/03/exploring-android-o-fonts-in-xml.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/2437905328376984418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/2437905328376984418'/><link rel='alternate' type='text/html' href='http://overrideandroid.blogspot.com/2017/03/exploring-android-o-fonts-in-xml.html' title='Exploring Android O: Fonts in XML'/><author><name>Rahul Mohan</name><uri>http://www.blogger.com/profile/12975251566930884736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy6A2UwRVP02DbgJo_nhoz1G6hrO3bDo9OpFlpB0_YBGh9GRXXx5aHmfSM-MA5xK6P3TlLNqX623CyLUsmdWcfh6W-nzVCGKnparsp0jzO6TOlpa5M1kTBwsn_1AVLy1_qsDVdF_IWnUyn/s72-c/Android-O-min.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6819244212846682870.post-8911517740841872504</id><published>2017-03-23T11:37:00.000-07:00</published><updated>2017-04-30T22:24:53.810-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Authentication"/><category scheme="http://www.blogger.com/atom/ns#" term="Fingerprint"/><category scheme="http://www.blogger.com/atom/ns#" term="Security"/><title type='text'>Getting started with Android Fingerprint Authentication</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; dir=&quot;rtl&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://lh4.googleusercontent.com/b8srLnrOlt8B_BFMmpDIg_2mudL6IWW3r56XgtdqsNMAP_lUifCD0bR9bsHU6fSkGtofUbL_7jXBmDJ6_f9myEGoNpGGWzfO_RpG18-qc928xSsqKiOVH9lsEEVD_fCXCZ8WB5yt&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;13467458873_9ac65da217_b.jpg&quot; border=&quot;0&quot; height=&quot;439&quot; src=&quot;https://lh4.googleusercontent.com/b8srLnrOlt8B_BFMmpDIg_2mudL6IWW3r56XgtdqsNMAP_lUifCD0bR9bsHU6fSkGtofUbL_7jXBmDJ6_f9myEGoNpGGWzfO_RpG18-qc928xSsqKiOVH9lsEEVD_fCXCZ8WB5yt&quot; style=&quot;border: none; transform: rotate(0rad);&quot; title=&quot;Placeholder image&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-weight: 400; margin-left: 1em; margin-right: 1em; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;With the release of Android 6.0 Marshmallow, Google has introduced best way to authenticate the User- That is&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;Fingerprint Authentication&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.With this API, Google has created a native approach for fingerprint authentication across all Android devices. Developers can now authenticate their users on an app-by-app basis for everything from mobile purchases to app sign-in screens and more with just the tap of a finger.&lt;/span&gt;&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Why fingerprint authentication?&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;let’s look at some of the ways in which fingerprint authentication can improve the user experience:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;It’s a quick and convenient way of authenticating the user’s identity.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;You can’t forget a fingerprint! &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;No more struggling with mobile keyboards.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;No more annoying password recovery or reset.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;our fingerprint is unique and impossible to guess.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Creating the Fingerprint Authentication Project&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Imagine you are developing an app that requires to perform some critical operation like, payment. You want to be sure that your user is authenticated prior wiring any kind of money, right? &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Let’s go through a sample application that authenticate the user by fingerprint.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/ji2zbibqluY&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Complete source code for the examples used in this tutorial is available on&lt;/span&gt;&lt;a href=&quot;https://github.com/rahulmmohan/Fingerprint-Authentication-Demo&quot; style=&quot;font-family: roboto; font-size: 11pt; text-decoration: none; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #2196f3; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline;&quot;&gt;github&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. &lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Creating New Project&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Open Android Studio and create a new project. You can use the settings of your choice, but set your project’s SDK version to Android 6.0 (API 23) or higher.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-weight: 400; margin-left: 1em; margin-right: 1em; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-03-23 at 11.28.37 PM.png&quot; height=&quot;385&quot; src=&quot;https://lh5.googleusercontent.com/WaIWwk-0Kjq9n3gLomSp-VFsKThvKSp61e2WwSBJP1JNAuY1aYkCcL0GdhiLj-MXBodM6OgzcKhgPxi0mZe__aKg_ScPNpOPB6I3ivLew1YfsO1ZaEpfjZ_cjTOGB6h8XXyT00Uh&quot; style=&quot;border: none; transform: rotate(0rad);&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Updating the Manifest&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Fingerprint authentication requires that the app request the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;USE_FINGERPRINT&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; permission within the project manifest file.&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/083c8b39d577169635fd167421d9ee41.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Creating user interface&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create the fingerprint icon with the help of “Android Image Assets”. To do so, Right click on the drawable folder and Create a &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;New ⇒ Image Asset&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; named ic_action_fingerprint.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;You can download fingerprint icons from &lt;/span&gt;&lt;a href=&quot;https://github.com/rahulmmohan/Fingerprint-Authentication-Demo/raw/master/drawables.zip&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and paste in res folder.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Now we have all our resources, let’s create our UI:&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/27177e3ca4e6c9dbdc16ba38aa602cd6.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Checking the Security Settings&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Now time to implement the fingerprint authentication part of our app.As a first step we’re going to check that:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The device features a fingerprint sensor.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The user has protected their lockscreen.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The user has registered at least one fingerprint on their device.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create a method called &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;checkFingerPrintSensor()&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; on MainAcitivity.java file.&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/52228a3f5537f737be8c38006a4bd96f.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Accessing Android Keystore and Generate Encryption Key&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;We are going to create a method called &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;generateKey()&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; that generate an encryption key which is then stored securely on the device using the Android Keystore system. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The following task are going to do:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Gain access to the Android keystore, by generating a Keystore instance.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Initialize the KeyGenerator by Specify the operation(s) this key can be used for&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Configure this key so that the user has to confirm their identity with a fingerprint each time they want to use it&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: #666666; font-family: Roboto; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Generate the key&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/106f94aa9866763ad5047f2ea9f1b2b3.js&quot;&gt;&lt;/script&gt;

&lt;script src=&quot;https://gist.github.com/rahulmmohan/3aea1a8f6f1db10d1bebec8b7dd546c8.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create the Android Cipher&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The &lt;/span&gt;&lt;a href=&quot;https://developer.android.com/reference/javax/crypto/Cipher.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;cipher&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; that will be used to create the encrypted &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;FingerprintManager.CryptoObject&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; instance. This CryptoObject will, in turn, be used during the fingerprint authentication process. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The getInstance method of the Cipher class is called to obtain a Cipher instance which is subsequently configured with the properties required for fingerprint authentication. The previously generated key is then extracted from the Keystore container and used to initialize the Cipher instance.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Create method with name &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;generateCipher()&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; that return a cipher object.&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/4ed6afe189948292581d1420b5949ccf.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Authenticating&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;We’re ready to authenticate.This is done by calling FingerprintManager’s &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;authenticate(CryptoObject, CancellationSignal, int, AuthenticationCallback, Handler)&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; method. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;CryptoObject&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The crypto object is passed to fingerprint manager to protect the integrity of the fingerprint authentication.There is a chance that third party can intercept the results returned by fingerprint scanner. Crypto object is used to encrypt the results returned by fingerprint scanner.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;CancellationSignal&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;This gives us the ability to stop listening for fingerprints. In a typical implementation, this class&#39;s &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;cancel()&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; method will be called in the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;onPause()&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; lifecycle method. This ensures we aren’t listening for fingerprints while the application isn’t available.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;AuthenticationCallback&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;This is the listener for fingerprint events. Create an AuthenticationCallback object like below:&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/49b4eb51f057b066faedc05b4248e485.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Finally the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;onCreate()&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; method will look like this:&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/a18f20b42dbd58482d393628bb89f134.js&quot;&gt;&lt;/script&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Updating user interface&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Next step is to update the user interface with authentication success or failure.Just create two method to handle this.&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/d1786527aa052aa58d282caad1fc5aca.js&quot;&gt;&lt;/script&gt;

&lt;script src=&quot;https://gist.github.com/rahulmmohan/acb892647ef3cdce55cf94e78eaac5e2.js&quot;&gt;&lt;/script&gt;
&lt;br /&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 20pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Testing the project&lt;/span&gt;&lt;/h1&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Whenever you’re working on an Android app, you should test that app across a wide range of Android Virtual Devices (AVDs) plus at least one physical Android smartphone or tablet.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;First, make sure your Android smartphone or tablet is configured to support fingerprint authentication by securing your lockscreen with a PIN, password or pattern and then registering at least one fingerprint on your device. Typically, you register a fingerprint by going to &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;b&gt;Settings ⇒ Security ⇒ Fingerprint&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and then following the onscreen instructions.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #787878; font-family: &amp;quot;roboto&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;When it comes to testing Android’s fingerprint authentication on an AVD, there’s an immediate problem: an emulated Android device doesn’t have any physical hardware.The solution is to use the extended controls of the AVD.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #787878; font-family: &amp;quot;arial&amp;quot;; font-size: 13pt; font-style: normal; font-weight: 400; margin-left: 1em; margin-right: 1em; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screen Shot 2017-03-23 at 10.54.46 PM.png&quot; height=&quot;172&quot; src=&quot;https://lh3.googleusercontent.com/MvfgDGNP3GZCXJEbWUhTBHYlRPTpH9up3kjBJoBNGzuD3enV3zhvV13Lv_3NVthU1HvsavRNgSfS9702xfAxQ-z3BvZujpbfKikkOpDBhGNFWV8Idt_7nKV6ey5I7OiqjUVlxZI_&quot; style=&quot;border: none; transform: rotate(0rad);&quot; width=&quot;624&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #787878; font-family: &amp;quot;arial&amp;quot;; font-size: 13pt; font-style: normal; font-weight: 400; margin-left: 1em; margin-right: 1em; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;
&lt;img alt=&quot;Screen Shot 2017-03-23 at 11.05.23 PM.png&quot; height=&quot;344&quot; src=&quot;https://lh5.googleusercontent.com/EdYoWeBtC0CRoCOOl8VnevcPbUIh6GxWBMXkuAepctye1JxfBiqVovN0lf_OwlDBsx7RBgE_zoCNNWtacu3PZS4XDVn4eQ-mxRBcMY1dxnq7gNc9EL5vJp1fQrU3gna9DA1I88ck&quot; style=&quot;background-color: white; border: none; color: #787878; font-family: arial; font-size: 13pt; transform: rotate(0rad); white-space: pre-wrap;&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 20pt; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #666666; font-family: roboto;&quot;&gt;&lt;span style=&quot;font-size: 14.666666984558105px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://overrideandroid.blogspot.com/feeds/8911517740841872504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://overrideandroid.blogspot.com/2017/03/getting-started-with-android.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/8911517740841872504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/8911517740841872504'/><link rel='alternate' type='text/html' href='http://overrideandroid.blogspot.com/2017/03/getting-started-with-android.html' title='Getting started with Android Fingerprint Authentication'/><author><name>Rahul Mohan</name><uri>http://www.blogger.com/profile/12975251566930884736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh4.googleusercontent.com/b8srLnrOlt8B_BFMmpDIg_2mudL6IWW3r56XgtdqsNMAP_lUifCD0bR9bsHU6fSkGtofUbL_7jXBmDJ6_f9myEGoNpGGWzfO_RpG18-qc928xSsqKiOVH9lsEEVD_fCXCZ8WB5yt=s72-c" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6819244212846682870.post-7450091446030575690</id><published>2017-03-15T10:57:00.001-07:00</published><updated>2017-04-30T22:25:00.632-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Observable"/><category scheme="http://www.blogger.com/atom/ns#" term="Observer"/><category scheme="http://www.blogger.com/atom/ns#" term="Reactive Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="ReactiveX"/><category scheme="http://www.blogger.com/atom/ns#" term="RxBinding"/><category scheme="http://www.blogger.com/atom/ns#" term="Rxjava"/><title type='text'>Reactive Programming with RxBinding</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Developing a complex Android app that has lots of network connections, user interactions, and animations often means writing code that is full of nested callbacks. &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;a href=&quot;http://reactivex.io/&quot; target=&quot;_blank&quot;&gt;ReactiveX&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; offers an alternative approach that is both clear and concise, to manage asynchronous tasks and events.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;img alt=&quot;unnamed.png&quot; height=&quot;258&quot; src=&quot;https://lh6.googleusercontent.com/xd7H3HCaIMgHqk0jyQEwCE1uwgLzvTwCwuifr5YZmHP-FqnkpB9xVU_kF7jzh1zmTwMQIQauAvJxANmiH4kP5GSAgp3Rpxi9OF5T0Ea1aDYSpEuItGaBPyBZlrHc2My5u05dCyvB&quot; style=&quot;border: none; margin-left: auto; margin-right: auto; transform: rotate(0rad);&quot; title=&quot;Placeholder image&quot; width=&quot;241&quot; /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; white-space: pre-wrap;&quot;&gt;ReactiveX&lt;/span&gt;&lt;/h4&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; white-space: pre-wrap;&quot;&gt;ReactiveX is a combination of the best ideas from the Observer pattern, the Iterator pattern, and functional programming&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-weight: 700; white-space: pre-wrap;&quot;&gt;RxJava&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;RxJava is a JVM implementation of ReactiveX, developed by NetFlix, and is very popular among Java developers.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 21pt; white-space: pre-wrap;&quot;&gt;What is Reactive Programming&lt;/span&gt;&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Reactive programming&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; is an asynchronous &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;programming paradigm&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; oriented around &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;data streams&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and the propagation of change. This means that it should be possible to express static (e.g. arrays) or dynamic (e.g. event emitters) data streams with ease in the programming languages used, and that the underlying execution model will automatically propagate the changes through the data flow.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;For example, in an imperative programming setting, &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;a:=b+c&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; would mean that &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; is being assigned the result of &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;b+c&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; in the instant the expression is evaluated, and later, the values of &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;c&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; can be changed with no effect on the value of &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;However, in reactive programming, the value of &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; would be automatically updated whenever the values of &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and &lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; change, without the program executing the sentence &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;a:=b+c&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; again.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Observable and Observer&lt;/span&gt;&lt;/h4&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;There are two basic and very important items in reactive programming, &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Observables&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Observers&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. Observables publish values, while Observers subscribe to Observables, watching them and reacting when an Observable publishes a value.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;In simpler terms:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;An Observable performs some action, and publishes the result.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;An Observer waits and watches the Observable, and reacts whenever the Observable publishes results.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;There are three different changes that can occur on an Observable that the Observer reacts to. These are:&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Publishing a value&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Throwing an error&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Completed publishing all values&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;A class that implements the Observer interface must provide methods for each of the three changes above:&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;An &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;onNext()&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; method that the Observable calls whenever it wishes to publish a new value&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;An &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;onError()&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; method that’s called exactly once, when an error occurs on the Observable.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;An &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;onCompleted()&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; method that’s called exactly once, when the Observable completes execution.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;So an Observable that has an Observer subscribed to it will call the Observer’s onNext() zero or more times, as long as it has values to publish, and terminates by either calling onError() or onCompleted().&lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 21pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 21pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;What are the RxBinding Libraries?&lt;/span&gt;&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.32; margin-bottom: 15pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;One of the benefits of using &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;RxJava&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; is the ability to compose asynchronous events in a more straightforward way. Complex UI interactions in Android can also be greatly simplified too, especially when there are multiple UI events that can trigger. To describe the interaction pattern with standard Android code, you would usually need to use a combination of both &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;listeners&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Handlers&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;AsyncTask&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. With &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;RxJava&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; and &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;RxBinding&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;, this logic can be greatly simplified and you can describe the interaction patterns between multiple UI components.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;RxBinding is a set of libraries that allow you to react to user interface events via the RxJava paradigm. Let’s take a look at a few example.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;This is how Android developers typically react to a text change for an EditText&lt;/span&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/ade5c30da339b062cd21a8356721d097.js&quot;&gt;&lt;/script&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; white-space: pre-wrap;&quot;&gt;Now the same thing, but written with RxBinding support:&lt;/span&gt;&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/b731739b0b1f62ac38990a1c213f06f0.js&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;In the example above, I use the &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;RxTextView.textChanges()&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; method to react only to the text change event. In traditional Android, we have to implement a full TextWatcher to accomplish this, wasting multiple lines of code because the &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;beforeTextChanged&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; event and &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;afterTextChanged&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;callbacks must also be implemented. This dead code simply pollutes the class and offers no additional value. With RxBinding I can achieve more control over what I want to react to in my application without the additional overhead in my codebase.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 21pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 21pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;A Simple Example&lt;/span&gt;&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;For example, consider what you would need to create a simple registration form with two fields, username and email.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The registration form has these behaviours:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The initial state of both fields are blank.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;If the field is valid according to the criteria, the text will be colored black.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Criteria for email is a valid email using simple regex check.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Valid user name if it’s more than 4 character in length.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;If the field is not valid, the text will be colored RED.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The Register button is only active when both fields are valid.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;If you used to create Android applications, you’d now how many handlers and anonymous classes you will write to track the state of the fields and to create the behaviour of the register button.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;iframe align=&quot;center&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;360&quot; src=&quot;https://www.youtube.com/embed/kMWSf_DfkAk&quot; width=&quot;640&quot;&gt;&lt;/iframe&gt;
&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span id=&quot;goog_2119784099&quot;&gt;&lt;/span&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Setting Up RxBinding&lt;/span&gt;&lt;/h4&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To use RxAndroid in an Android Studio project, add it as a &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;compile&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; dependency in the app module’s &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;build.gradle&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/19f711b0ef6ccff35cf5cbff2f975f67.js&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;b style=&quot;background-color: white; font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Creating an Observer and observables&lt;/span&gt;&lt;/h4&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;As mentioned above we can create &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;RxTextView.textChanges()&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; observable to react to the text change event.We’d like to capture the text and print them in the ADB console.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/09ecd6a179a1f40224959dca855e54f7.js&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;When we run this app, we’ll get these output.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;capture text.gif&quot; height=&quot;216&quot; src=&quot;https://lh4.googleusercontent.com/XM2Wq2l5Rx11RJ9tP_UFRVcVPM_u9y77J7ODCRU5CUmkELu_uSjexsw99wZfqL-V0HFpidXFCtC1DIWv963kIFYj7Mn1b8wvThZ1qNCcGyYrj6fPzwqN220QUyxfR8HEzV3crsXf&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;500&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Transforming with Operators&lt;/span&gt;&lt;/h4&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Now, let’s implement the behaviour of the validity of each field. Map the text from each fields and verify.To achieve this we’ll define several Observables for each EditText. The condition of validity are&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;UserName should be more than 4 characters in length.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Email should match a simple regex validation.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Since &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;RxBinding&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; is applying RxJava paradigms to existing Android Views and Widgets, you can use RxJava operators to perform transformations on the stream of data that is emitted in real time.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/8082d882a9d1141b319d9dbe10c3eb01.js&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The code is pretty straightforward.&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;This is the email pattern we’ll use for email validation. We’re using classes from &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;java.util.regex package&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;font-family: roboto; font-size: 14pt; font-style: normal; font-variant-alternates: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-position: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;We create an Observable&amp;lt;Boolean&amp;gt; for the UserName and email.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Next we need to map the validity Observable to a color observable and subscribe to them to change the text Color.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/f5f82070ca8aeaaad91743937825e5b5.js&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The result is as expected.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;map to color.gif&quot; height=&quot;303&quot; src=&quot;https://lh3.googleusercontent.com/agmUwknM0Z6FQ-LvoLHG7deAsuaxCMFpuapZlFz_IvxNJST1RVAYw-N5gFIkuUTsFnyVidrKJo3l-7sZStiMdMYbww_wLk3TSkhTXW_wEsuN-N-olORm6_pbBRlnIWPj34sZf1M7&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h4&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Combining Observables&lt;/span&gt;&lt;/h4&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Lastly, we’d like to implement a use case where the Register button only enabled when both fields are enabled. For this we’ll need to combine two observables to one. To do that we use combineLatest method.W&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;hen an item is emitted by either of two Observables, combine the latest item emitted by each Observable via a specified function and emit items based on the results of a function.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;b style=&quot;background-color: white; font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Code will look like this:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/edec4d289a1358211dba64894b60b5a1.js&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;compining observe.gif&quot; height=&quot;326&quot; src=&quot;https://lh4.googleusercontent.com/ejWWeafIbUZdGnPlc_SidVWGNdBnwfNbX8MKqStP4bIuzqU4GgqwrEmmJlTptq7Jfq8Z8b0FZy4oZ3eMAfzNMSpcNYoRS8LwwWuv7DkSeV9Kg_hjsNfUsu-gwGZ3zD_DeJ3O8Rjy&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;b style=&quot;background-color: white; font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 16pt; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Filtering Observables&lt;/span&gt;&lt;/h4&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The items from userNameValid, emailValid and registerEnabled are emitted on each user input. This causes the subscribers are called everytime the user type in the fields. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;everytime.gif&quot; height=&quot;242&quot; src=&quot;https://lh3.googleusercontent.com/RisN2zKzoa3GjMJAcdl2RdxHrhK-bUNdBBvRbkx9A3fMygp1CrUIW49SHDDPbWAJ4lQfBsOSQ8AcZgJaM-7SdvRNjEdtSGbUbg1pnMFv8tf2pjRZoskY6nJ9sTgFJVKavJD8ZG78&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;480&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;We only want the subscriber only called when the validity changes. For this, we’d need to call &lt;/span&gt;&lt;span style=&quot;background-color: #b6d7a8; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;distinctUntilChanged()&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; method on our Observables. Thus, the code becomes:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/rahulmmohan/9fce24328b84b026f856e86aa152d5b7.js&quot;&gt;&lt;/script&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-top: 10pt; text-align: center;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;filter_observer.gif&quot; height=&quot;277&quot; src=&quot;https://lh4.googleusercontent.com/geA6RN1FU08KVEvvJsQzv9mfFpZONI4bW9FEVMRabeB187w2zdruyRVyO6rUeIp5CagnfijbrH5smANC_D6vcUMq3j4BXnnBxFbkqvtlTRz0ga6EiOIT94D7dEUWvlLn06Au00uw&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;500&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;b style=&quot;background-color: white; font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.68; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 10pt;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;As usual, the complete source code for the examples used in this tutorial is &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;available on &lt;a href=&quot;https://github.com/rahulmmohan/RxAndroid-Sample-RegistrationForm&quot; target=&quot;_blank&quot;&gt;github&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;roboto&amp;quot;; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. Feel free to check out and use however you see fit.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 10pt;&quot;&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/h3&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;h1 dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-left: -0.75pt; margin-top: 24pt;&quot;&gt;
&lt;/h1&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://overrideandroid.blogspot.com/feeds/7450091446030575690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://overrideandroid.blogspot.com/2017/03/reactive-programming-with-rxbinding.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/7450091446030575690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/7450091446030575690'/><link rel='alternate' type='text/html' href='http://overrideandroid.blogspot.com/2017/03/reactive-programming-with-rxbinding.html' title='Reactive Programming with RxBinding'/><author><name>Rahul Mohan</name><uri>http://www.blogger.com/profile/12975251566930884736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh6.googleusercontent.com/xd7H3HCaIMgHqk0jyQEwCE1uwgLzvTwCwuifr5YZmHP-FqnkpB9xVU_kF7jzh1zmTwMQIQauAvJxANmiH4kP5GSAgp3Rpxi9OF5T0Ea1aDYSpEuItGaBPyBZlrHc2My5u05dCyvB=s72-c" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6819244212846682870.post-5578426599078071774</id><published>2017-03-09T11:18:00.000-08:00</published><updated>2017-04-30T22:25:09.838-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Bottom navigation"/><category scheme="http://www.blogger.com/atom/ns#" term="Material design"/><title type='text'>Introduction to Android Bottom Navigation View</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;Bottom navigation with tabs has been quite a common primary navigation pattern over on iOS for a long time.It enables navigation through a series of hierarchical app screen.&amp;nbsp;Android guidelines already included tabs too, but they were at the top of the screen, combined with swipeable pages, implemented with a ViewPager.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;Google officially added Bottom Navigation&amp;nbsp;to version 25 of the Design Support Library&amp;nbsp;and released new versions of its Photos and Google+ app with this component as its main navigation.Let’s take a dive into how we can use it!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
I made a really simple app, you can find it from &lt;a href=&quot;https://github.com/rahulmmohan/Bottom-Navigation-View&quot; target=&quot;_blank&quot;&gt;GitHub&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHK30gg0aR8MdQuTgRMvOMB8s_yEYyN0VroEaY9U9lUn5JgkVxcfvlpwfWFt08Ptpum1hktp7M6mhm2-8Di6DKvBn91GN7hU3cUCGuFB0yKO6al7TPjhH5I-9slTY2jQwT5BsRM6JYksoA/s1600/ezgif-2-a5a9c94abe.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHK30gg0aR8MdQuTgRMvOMB8s_yEYyN0VroEaY9U9lUn5JgkVxcfvlpwfWFt08Ptpum1hktp7M6mhm2-8Di6DKvBn91GN7hU3cUCGuFB0yKO6al7TPjhH5I-9slTY2jQwT5BsRM6JYksoA/s400/ezgif-2-a5a9c94abe.gif&quot; width=&quot;223&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 20px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;Usage&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;Bottom navigation provides quick navigation between top-level views of an app. It is primarily designed for use on mobile.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 20px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;When to use&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;Bottom navigation should be used for:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Three to five top-level destinations of similar importance (alternative: a&amp;nbsp;persistent navigation drawer&amp;nbsp;accessible from anywhere in the app)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot; , &amp;quot;helvetica&amp;quot; , sans-serif;&quot;&gt;Destinations requiring direct access from anywhere in the app (alternative:&amp;nbsp;tabs&amp;nbsp;for only one or two destinations).&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/h4&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 20px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;How to Use&amp;nbsp;It&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;&lt;i&gt;1. Add the design support library&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;The first step is to add the design support library to your app-level&amp;nbsp;&lt;span style=&quot;background-color: #f9f2f4; color: #c7254e; font-family: monospace; font-size: 13px;&quot;&gt;build.gradle&lt;/span&gt;&amp;nbsp;file. Example is as shown below:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://gist-it.appspot.com/https://github.com/rahulmmohan/Bottom-Navigation-View/blob/master/app/build.gradle?slice=22:29&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;&lt;i&gt;2. Add to your layout&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;br /&gt;
Next we simply need to add the Bottom Navigation View widget to our desired layout file. Remember that this should be aligned with the bottom of the screen with all content displaying above it. We can add this view like so:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://gist-it.appspot.com/https://github.com/rahulmmohan/Bottom-Navigation-View/blob/master/app/src/main/res/layout/activity_main.xml?slice=30:38&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;&lt;i&gt;3. Populate Menu&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;We can add content to the bottom navigation view&amp;nbsp;by specifying a menu resource file. First, create a menu file and then populate it by using the following attribute of BottomNavigationView.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://gist-it.appspot.com/https://github.com/rahulmmohan/Bottom-Navigation-View/blob/master/app/src/main/res/layout/activity_main.xml?slice=36&quot;&gt;&lt;/script&gt;

&lt;script src=&quot;http://gist-it.appspot.com/https://github.com/rahulmmohan/Bottom-Navigation-View/blob/master/app/src/main/res/menu/navigation.xml&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;&lt;i&gt;4. Styles&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;The bottom navigation view also can be customized with several different options, including&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: rgba(0, 0, 0, 0.0352941); font-family: Menlo; font-size: 16.6px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;app:itemBackground&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;arial&amp;quot;; font-size: 18px; line-height: normal;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;font-kerning: none;&quot;&gt;app:itemIcontint&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;arial&amp;quot;; font-size: 18px; line-height: normal;&quot;&gt;, and &lt;/span&gt;&lt;span style=&quot;font-kerning: none;&quot;&gt;app:ItemTextColor&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;arial&amp;quot;; font-size: 18px; line-height: normal;&quot;&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://gist-it.appspot.com/https://github.com/rahulmmohan/Bottom-Navigation-View/blob/master/app/src/main/res/layout/bottom_navgation_styled.xml&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;If you add this to your app and run it on your device, you’ll see a shiny new bottom navigation view like below:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkTbnr6tuGHPors4Y1meGVqoHxBMCseHA76Sto5FpmbbKoLHQ-2cgloMp5SNoIuhnCYNM_YL9eZ9ZPS9YIGjE7IoS5nZx5ybwYJqLwxtnB6QgCy4afyeQq6dH5YFwVUbBF2N_jfCFCv8DU/s1600/Screen+Shot+2017-03-09+at+11.48.33+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;61&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkTbnr6tuGHPors4Y1meGVqoHxBMCseHA76Sto5FpmbbKoLHQ-2cgloMp5SNoIuhnCYNM_YL9eZ9ZPS9YIGjE7IoS5nZx5ybwYJqLwxtnB6QgCy4afyeQq6dH5YFwVUbBF2N_jfCFCv8DU/s400/Screen+Shot+2017-03-09+at+11.48.33+PM.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;&lt;i&gt;5. Handling Enabled/Disabled state&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;We can easily handle the display of both enabled and disabled menu items.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;First, we need to create a selector file for our enabled / disabled colors like following.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;/div&gt;
&lt;script src=&quot;http://gist-it.appspot.com/https://github.com/rahulmmohan/Bottom-Navigation-View/blob/master/app/src/main/res/drawable/nav_item_color_state.xml&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgba(0, 0, 0, 0.8); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: normal;&quot;&gt;
&lt;div style=&quot;font-family: arial; font-size: 18px;&quot;&gt;
&lt;span style=&quot;background-color: rgba(0 , 0 , 0 , 0.0352941); font-family: &amp;quot;menlo&amp;quot;; font-size: 16.6px;&quot;&gt;app:itemIcontint=&quot;@drawable/nav_item_color_state&quot;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot;; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot;; font-size: 18px;&quot;&gt;&lt;span style=&quot;background-color: rgba(0 , 0 , 0 , 0.0352941); font-family: &amp;quot;menlo&amp;quot;; font-size: 16.6px;&quot;&gt;app:ItemTextColor=&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: rgba(0 , 0 , 0 , 0.0352941); font-family: &amp;quot;menlo&amp;quot;; font-size: 16.6px;&quot;&gt;@drawable/nav_item_color_state&lt;/span&gt;&lt;span style=&quot;background-color: rgba(0 , 0 , 0 , 0.0352941); font-family: &amp;quot;menlo&amp;quot;; font-size: 16.6px;&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: rgba(0 , 0 , 0 , 0.0352941); font-family: &amp;quot;menlo&amp;quot;; font-size: 16.6px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: arial; font-size: 18px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;Disabled and Enabled states will then be displayed reflecting the stated look and feel from the selector file:&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgba(0, 0, 0, 0.8); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgba(0, 0, 0, 0.8); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFbOwg0duHv1iIk9jpMh6Jp2rWzmhyphenhyphenIIMURtugyRj-YISpeVgBiZ-rgHIYuONFSBg8_BxIb5WXOuNVVoxilYJCY9oyBbIPHMblgjzIfqVOf55K6KIyXGm7MW8xD6tdoviocyzMjn8HRxuu/s1600/Screen+Shot+2017-03-09+at+11.59.00+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;63&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFbOwg0duHv1iIk9jpMh6Jp2rWzmhyphenhyphenIIMURtugyRj-YISpeVgBiZ-rgHIYuONFSBg8_BxIb5WXOuNVVoxilYJCY9oyBbIPHMblgjzIfqVOf55K6KIyXGm7MW8xD6tdoviocyzMjn8HRxuu/s400/Screen+Shot+2017-03-09+at+11.59.00+PM.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgba(0, 0, 0, 0.8); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgba(0, 0, 0, 0.8); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;&lt;i&gt;6.listen to tab selection events&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgba(0, 0, 0, 0.8); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(38, 38, 38); -webkit-text-stroke-width: initial; background-color: white; color: #262626; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;To listen for click events on the BottomNavigationView, we just need to call &lt;/span&gt;&lt;span style=&quot;background-color: rgba(0 , 0 , 0 , 0.0352941); font-family: &amp;quot;menlo&amp;quot;; font-size: 16.6px; line-height: normal;&quot;&gt;setOnNavigationItemSelectedListener()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: rgba(0 , 0 , 0 , 0.0352941); font-family: &amp;quot;menlo&amp;quot;; font-size: 16.6px; line-height: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(38, 38, 38); -webkit-text-stroke-width: initial; background-color: white; color: #262626; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;Example of how to do this is:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(38, 38, 38); -webkit-text-stroke-width: initial; background-color: white; color: #262626; font-family: Arial; font-size: 18px; line-height: normal; min-height: 21px;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;script src=&quot;http://gist-it.appspot.com/https://github.com/rahulmmohan/Bottom-Navigation-View/blob/master/app/src/main/java/com/sample/bottomnavigationviewsample/MainActivity.java?slice=13:33&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; background-color: white; font-family: Arial; font-size: 18px; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;When we receive click events for the items, we can simply react accordingly. In my sample I simply change the text on the textview that is being displayed on the screen.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: arial; line-height: normal;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: arial; line-height: normal;&quot;&gt;
&lt;span style=&quot;font-kerning: none;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://overrideandroid.blogspot.com/feeds/5578426599078071774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://overrideandroid.blogspot.com/2017/03/introduction-to-android-bottom.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/5578426599078071774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6819244212846682870/posts/default/5578426599078071774'/><link rel='alternate' type='text/html' href='http://overrideandroid.blogspot.com/2017/03/introduction-to-android-bottom.html' title='Introduction to Android Bottom Navigation View'/><author><name>Rahul Mohan</name><uri>http://www.blogger.com/profile/12975251566930884736</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHK30gg0aR8MdQuTgRMvOMB8s_yEYyN0VroEaY9U9lUn5JgkVxcfvlpwfWFt08Ptpum1hktp7M6mhm2-8Di6DKvBn91GN7hU3cUCGuFB0yKO6al7TPjhH5I-9slTY2jQwT5BsRM6JYksoA/s72-c/ezgif-2-a5a9c94abe.gif" height="72" width="72"/><thr:total>0</thr:total></entry></feed>