<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rohit Singh on Medium]]></title>
        <description><![CDATA[Stories by Rohit Singh on Medium]]></description>
        <link>https://medium.com/@rohitksingh?source=rss-7b157818555a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*5KwB9qAf9_tUymYcqhwqvg.jpeg</url>
            <title>Stories by Rohit Singh on Medium</title>
            <link>https://medium.com/@rohitksingh?source=rss-7b157818555a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 19:52:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rohitksingh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Vibe Coding and the Agricultural Revolution of Software]]></title>
            <link>https://rohitksingh.medium.com/vibe-coding-and-the-agricultural-revolution-of-software-ff6cdc42efd0?source=rss-7b157818555a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff6cdc42efd0</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[future-of-work]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <dc:creator><![CDATA[Rohit Singh]]></dc:creator>
            <pubDate>Sun, 15 Feb 2026 11:59:32 GMT</pubDate>
            <atom:updated>2026-02-15T11:59:32.994Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lWdSIdpaxvdrJI3As2n8fA.png" /></figure><p>We are living through a “Neolithic” moment in technology.</p><p>For the last forty years, software development was a form of high-tech foraging. We were <strong>Hunter-Gatherers</strong>. We trekked through the dense wilderness of documentation, tracked down elusive bugs through miles of logs, and hand-sharpened our regex tools to catch a single piece of data.</p><p>But a shift is happening. We are entering the era of <strong>Vibe Coding</strong>.</p><p>Just as the move from foraging to farming fundamentally rewired human society, this shift from manual syntax to natural language-driven development is changing the “metabolism” of how we build.</p><h3>The Hunter-Gatherer: Survival by Craft</h3><p>In the “Manual Era,” a developer was an artisan. Your value was tied to your local knowledge — knowing exactly which “berry bushes” (libraries) were stable and where the “water holes” (reliable APIs) were located.</p><ul><li><strong>The Tools:</strong> Hand-crafted syntax. Mastery was measured by how well you could swing the spear of C++, Java, or Python.</li><li><strong>The Caloric Cost:</strong> High. You spent massive mental energy for every line of code “caught” and brought back to the codebase.</li><li><strong>The Result:</strong> You had a deep, intimate understanding of the kill. If the software broke, you knew why, because you had touched every fiber of its logic.</li></ul><h3>The Vibe Coder: Survival by Cultivation</h3><p>Vibe Coding represents the transition from hunting for syntax to <strong>cultivating intent</strong>. Instead of foraging for the right function, you provide the “soil” (context), the “seed” (the prompt), and the “irrigation” (the architectural guardrails).</p><ul><li><strong>The Tools:</strong> LLMs, agents, and natural language. Mastery is measured by your ability to manage the system rather than the syntax.</li><li><strong>The Caloric Cost:</strong> Low per line, but high in curation. You are no longer typing; you are directing.</li><li><strong>The Result:</strong> Abundance. You can “harvest” entire applications in the time it used to take to hunt down a single complex bug.</li></ul><h3>The New Challenges of Abundance</h3><p>When humans started farming, they didn’t necessarily work less — they just worked <em>differently</em>. They had to worry about property disputes, storage, and crop failure. In the Vibe Coding era, we face the same “Agricultural” problems:</p><h3>The Maintenance Burden</h3><p>It is much easier to plant a field than to keep it healthy for ten years. We are currently generating code at a rate that far outstrips our ability to manually audit it. We are building massive, fragile systems that “vibe” correctly on the surface but may hide complex “weeds” (security vulnerabilities) beneath.</p><h3>The Knowledge Gap</h3><p>Early farmers often had worse nutrition than hunters because they relied on a single crop. Similarly, if we rely entirely on the “latent space” of a model to think for us, we risk losing the foundational “muscle memory” of logic. What happens when the “harvest” (the AI) fails and the hunters have forgotten how to track?</p><h3>The Verification Crisis</h3><p>The bottleneck of software is shifting from <strong>Production</strong> to <strong>Verification</strong>. The human role is evolving from “Writer” to “Editor-in-Chief.” The challenge is no longer <em>how do I write this?</em> but <em>is what was grown actually what I intended?</em></p><h3>The Verdict: A Change in Metabolism</h3><p>The Agricultural Revolution allowed humans to stop moving and start building permanent structures. Vibe Coding is doing the same for software. It allows us to stop fighting the language and start focusing on permanent <strong>architectures</strong> and <strong>user experiences</strong>.</p><p>However, just as a farmer must still understand the seasons, a Vibe Coder must still understand <strong>Logic</strong>. We are moving away from the exhaustion of manual foraging toward the complexity of mass cultivation. We aren’t just changing our tools; we are changing our relationship with the machine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff6cdc42efd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Slide Fragment from the Bottom in Android]]></title>
            <link>https://rohitksingh.medium.com/slide-fragment-from-the-bottom-in-android-f50717b87eb4?source=rss-7b157818555a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f50717b87eb4</guid>
            <dc:creator><![CDATA[Rohit Singh]]></dc:creator>
            <pubDate>Sat, 31 Oct 2020 00:21:16 GMT</pubDate>
            <atom:updated>2020-10-31T03:52:55.582Z</atom:updated>
            <content:encoded><![CDATA[<p>If you want something like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/1*lKM485J0qYbMAF_vOIEAdQ.gif" /></figure><p>Then you are at the right place. It’s really simple. Just Create these 4 anim XML files, and replace the current fragment with your new fragment.</p><h3><strong>2 Fragments - 4 Anims</strong></h3><ul><li>DogsListFragment + DogDetailFragment</li><li>slide_in_bottom + slide_out_top + slide_in_top + slide_out_bottom.</li></ul><p>But let’s visualize it first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oQfviJJ9lvex2_SrzUI1EQ.png" /></figure><p><strong>R.anim.slide_in_bottom</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f5b4ba600a610cc2b6d56c369da326a/href">https://medium.com/media/2f5b4ba600a610cc2b6d56c369da326a/href</a></iframe><p><strong>R.anim.slide_out_top</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f9fd3ccb4c8118f629874d8ef8b319e5/href">https://medium.com/media/f9fd3ccb4c8118f629874d8ef8b319e5/href</a></iframe><p><strong>R.anim.slide_in_top</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e64cab976de16c4c27cd860f2925e81/href">https://medium.com/media/3e64cab976de16c4c27cd860f2925e81/href</a></iframe><p><strong>R.anim.slide_out_bottom</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2426100945f8590d6873d5c00f5eae22/href">https://medium.com/media/2426100945f8590d6873d5c00f5eae22/href</a></iframe><p>And this code for <strong>sliding in the fragment</strong> from the bottom.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/afeae65ef77cdd5db01de196d272ec74/href">https://medium.com/media/afeae65ef77cdd5db01de196d272ec74/href</a></iframe><h3>How to reverse this on the back button click?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*Fxar5WrvvinAgcvizGK0zg.gif" /></figure><p>If you want to reverse the animation on the back button click? just pop the current fragment from the backstack.</p><pre>getSupportFragmentManager().popBackStack();</pre><p>Using this approach you can make similar animations like left to right, right to left, etc.</p><p><a href="https://github.com/rohitksingh/Woof">Full code sample</a></p><pre><strong>Putting up content takes a lot of time and effort </strong>😓<strong>.</strong><br>👏 clap 👏 <strong>If you think you learned something from this article.  Also follow me on Medium. It motivates me write more frequently.       You can find me on </strong><a href="https://stackoverflow.com/users/4700156/rohit-singh"><strong>Stackoverflow</strong></a><strong>,</strong><a href="https://github.com/rohitksingh"><strong>Github</strong></a><strong>,and,on </strong><a href="https://www.linkedin.com/in/rohit94singh/"><strong>Linkedin</strong></a><strong>.<br>Give feedback and feel free to correct mistakes.</strong></pre><h3>Read More:</h3><p><a href="https://medium.com/@rohitksingh/what-is-addtobackstack-in-fragment-661ac01a6507">What is addToBackStack in Fragment</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RvRRCnWdWv5ORZRbhxjpGA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f50717b87eb4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is addToBackStack in Fragment]]></title>
            <link>https://rohitksingh.medium.com/what-is-addtobackstack-in-fragment-661ac01a6507?source=rss-7b157818555a------2</link>
            <guid isPermaLink="false">https://medium.com/p/661ac01a6507</guid>
            <category><![CDATA[backstack]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[addtobackstack]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[fragments]]></category>
            <dc:creator><![CDATA[Rohit Singh]]></dc:creator>
            <pubDate>Sat, 13 Jun 2020 02:27:05 GMT</pubDate>
            <atom:updated>2020-10-31T00:38:21.654Z</atom:updated>
            <content:encoded><![CDATA[<p>Fragment API unlike Activity API does not come with <strong>Back Button navigation</strong> by default. So if you have added or replaced many Fragments on a Fragment container. There is no way to go back to the previous Fragment on a Back Button Pressed.</p><p>Let&#39;s see the difference between the behaviors</p><p><strong>Case 1: Default behavior</strong></p><pre>getSupportFragmentManager()<br>            .beginTransaction()<br>            .add(R.id.fragmentContainer, fragment, &quot;TAG&quot;)<br>            .commit();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZI1JxrPb6g8QOjnEKGhAA.png" /></figure><p><strong>Case 2: With addToBackStack</strong></p><pre>getSupportFragmentManager()<br>            .beginTransaction()<br>            .add(R.id.fragmentContainer, fragment, &quot;TAG&quot;)<br>            .addToBackStack(&quot;TAG&quot;)<br>            .commit();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uat04aV2HbW_dfM1kdY_-g.png" /></figure><pre><strong>Putting up content takes a lot of time and effort </strong>😓<strong>.</strong><br>👏 clap 👏 <strong>If you think you learned something from this article.You can find me on </strong><a href="https://stackoverflow.com/users/4700156/rohit-singh"><strong>Stackoverflow</strong></a><strong>,</strong><a href="https://github.com/rohitksingh"><strong>Github</strong></a><strong>,and,on </strong><a href="https://www.linkedin.com/in/rohit94singh/"><strong>Linkedin</strong></a><strong>.<br>Give feedback and feel free to correct mistakes.</strong></pre><h3>Read More:</h3><p><a href="https://rohitksingh.medium.com/slide-fragment-from-the-bottom-in-android-f50717b87eb4">How to slide in a fragment from the Bottom.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/1*lKM485J0qYbMAF_vOIEAdQ.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=661ac01a6507" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Color part of TextView in Android]]></title>
            <link>https://rohitksingh.medium.com/how-to-color-part-of-textview-in-android-53cc06c89872?source=rss-7b157818555a------2</link>
            <guid isPermaLink="false">https://medium.com/p/53cc06c89872</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android-textview]]></category>
            <category><![CDATA[app-development]]></category>
            <dc:creator><![CDATA[Rohit Singh]]></dc:creator>
            <pubDate>Mon, 18 May 2020 11:15:39 GMT</pubDate>
            <atom:updated>2020-05-18T11:15:39.798Z</atom:updated>
            <content:encoded><![CDATA[<h3>Use HTML-escapes + Html.fromHtml()</h3><p>The trick here is to add HTML Tags for styling in the String and then set that String to TextView.</p><h3>Code:</h3><blockquote>Keep the string in string (resource)folder like this:</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/adeb072a1c01e99fb5fa373e6a3e83a3/href">https://medium.com/media/adeb072a1c01e99fb5fa373e6a3e83a3/href</a></iframe><blockquote>Read the string from string (resource)folder like this</blockquote><pre>String text = this.getResources().getString(R.string.textFromRes);<br>htmlText.setText(Html.fromHtml(text));</pre><h3>Output:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*mj1wJ61WSrb1nPO-8cI9eA.png" /></figure><p>Note: The string shown in the above output looks like this</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/98f2de003f36cde5c4cd9102a8f58d26/href">https://medium.com/media/98f2de003f36cde5c4cd9102a8f58d26/href</a></iframe><pre><strong>Putting up content takes a lot of time and effort </strong>😓<strong>.</strong><br>👏 clap 👏 <strong>If you think you learned something from this article.You can find me on </strong><a href="https://stackoverflow.com/users/4700156/rohit-singh"><strong>Stackoverflow</strong></a><strong>,</strong><a href="https://github.com/rohitksingh"><strong>Github</strong></a><strong>,and,on </strong><a href="https://www.linkedin.com/in/rohit94singh/"><strong>Linkedin</strong></a><strong>.<br>Give feedback and feel free to correct mistakes.</strong></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53cc06c89872" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ESP32 Microprocessor + Mangoose OS(PART-1)]]></title>
            <link>https://rohitksingh.medium.com/esp32-microprocessor-mangoose-os-part-1-2092129c0545?source=rss-7b157818555a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2092129c0545</guid>
            <category><![CDATA[esp32-programming]]></category>
            <category><![CDATA[esp32-tutorial]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[mongoose-os]]></category>
            <dc:creator><![CDATA[Rohit Singh]]></dc:creator>
            <pubDate>Tue, 14 Apr 2020 16:19:44 GMT</pubDate>
            <atom:updated>2020-04-14T16:19:44.314Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Mongoose OS?</h3><p>It is an open-source <strong>Operating System</strong> for the Internet of Things. which is used to create firmware(applications) for microprocessors. Many microcontrollers like ESP32, ESP8266, STM32, TI CC3200, TI CC3220, etc support this OS.</p><h3><strong>What is MOS Tool?</strong></h3><p>Mangoose OS uses mos tool to perform various tasks such as</p><ul><li>building firmware</li><li>flashing firmware</li><li>managing devices</li><li>provisioning devices on cloud services</li></ul><p>and so on.</p><h3>MOS Tool Installation:</h3><h4>In Mac OS:</h4><p>The most straightforward way to install the mos tool in MacOs is via <a href="https://brew.sh/">Homebrew</a>.</p><p>If you don’t have Homebrew install in your mac.</p><p>Paste the following command in the terminal.</p><pre>/bin/bash -c “$(curl -fsSL   https://raw.githubusercontent.com/Homebrew/install/master/install.sh)&quot;</pre><p>Or</p><p>Follow the <a href="https://docs.brew.sh/Installation">Installation Guide</a>.</p><p>After homebrew is installed type following brew command in the terminal to install mos tool.</p><pre>$ brew tap cesanta/mos</pre><pre>$ brew install mos</pre><p><strong>$ brew tap cesanta/mos</strong></p><p>If you are using this command for the first time it will take a couple of minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4qCFfSjxeL6bt61ZPabGEg.png" /></figure><p><strong>$ brew install mos</strong></p><p>This command installs mos tool in your mac. If the mos is already installed then it will show the message that mos is already installed with the currently available version. You can reinstall mos for getting the latest mos version. To reinstall type <strong>$ brew reinstall mos</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-JeChUEgQyKezMjDxKPTaw.png" /></figure><p>Congratulations 👏you have installed mos tool. Now you ready for the battle.</p><pre><strong>Putting up content takes a lot of time and effort </strong>😓<strong>.</strong><br>👏 clap 👏 <strong>If you think you learned something from this article.You can find me on </strong><a href="https://stackoverflow.com/users/4700156/rohit-singh"><strong>Stackoverflow</strong></a><strong>,</strong><a href="https://github.com/rohitksingh"><strong>Github</strong></a><strong>,and,on </strong><a href="https://www.linkedin.com/in/rohit94singh/"><strong>Linkedin</strong></a><strong>.<br>Give feedback and feel free to correct mistakes.</strong></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2092129c0545" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to write LocalBroadcastManager in Android?]]></title>
            <link>https://rohitksingh.medium.com/how-to-write-localbroadcastmanager-in-android-fa301efda00f?source=rss-7b157818555a------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa301efda00f</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[localbroadcastmanager]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Rohit Singh]]></dc:creator>
            <pubDate>Wed, 25 Mar 2020 11:14:54 GMT</pubDate>
            <atom:updated>2020-11-08T07:05:46.726Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to use LocalBroadcastManager in Android?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*UXSZ2kiOq5oGWaQpN4PylQ.png" /></figure><p>Advantages of using LocalBroadcast Receiver over Broadcast Reciever?</p><ol><li><strong>Secure Out</strong>: Your broadcasted data remains inside the App. So other apps can not receive your data</li><li><strong>Secure In</strong>: Your app will not receive Data from other apps Broadcast.</li><li><strong>Drains less battery</strong>: It is a more efficient way to send/receive data locally.</li></ol><h3>How to change your global Broadcast to LocalBroadcast?</h3><blockquote><em>LocalBroadcastReceiver is the same as BroadcastReceiver in Android. So if you know how to use BroadcastReceiver then you have got this. The code is almost similar.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*-f1v3zB0IfBo2CzQUOriNg.gif" /></figure><h4>1) Create Instance</h4><pre>LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(this);</pre><h4>2) For registering BroadcastReceiver</h4><blockquote><em>Replace</em></blockquote><pre>registerReceiver(new YourReceiver(),new IntentFilter(&quot;YourAction&quot;));</pre><blockquote><em>With</em></blockquote><pre>localBroadcastManager.registerReceiver(new YourReceiver(),new IntentFilter(&quot;YourAction&quot;));</pre><h4>3) For sending a broadcast message</h4><blockquote><em>Replace</em></blockquote><pre>sendBroadcast(intent);</pre><blockquote><em>With</em></blockquote><pre>localBroadcastManager.sendBroadcast(intent);</pre><h4>4) For unregistering BroadcastReceiver</h4><blockquote><em>Replace</em></blockquote><pre>unregisterReceiver(mybroadcast);</pre><blockquote><em>With</em></blockquote><pre>localBroadcastManager.unregisterReceiver(mybroadcast);</pre><p>And that&#39;s it.</p><pre><strong>Putting up content takes a lot of time and effort </strong>😓<strong>.</strong><br>👏 clap 👏 <strong>If you think you learned something from this article.</strong></pre><pre><strong>You can find me on </strong><a href="https://stackoverflow.com/users/4700156/rohit-singh"><strong>Stackoverflow</strong></a><strong>,</strong><a href="https://github.com/rohitksingh"><strong>Github</strong></a><strong>,and,on </strong><a href="https://www.linkedin.com/in/rohit94singh/"><strong>Linkedin</strong></a><strong>.<br>Give feedback and feel free to correct mistakes.</strong></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa301efda00f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why and How to use TaskStackBuilder in Android?]]></title>
            <link>https://rohitksingh.medium.com/why-and-how-to-use-taskstackbuilder-in-android-420983dd1de2?source=rss-7b157818555a------2</link>
            <guid isPermaLink="false">https://medium.com/p/420983dd1de2</guid>
            <category><![CDATA[android-navigation]]></category>
            <category><![CDATA[taskstackbuilder]]></category>
            <category><![CDATA[android-notification]]></category>
            <category><![CDATA[android-backstack]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Rohit Singh]]></dc:creator>
            <pubDate>Fri, 28 Feb 2020 22:22:47 GMT</pubDate>
            <atom:updated>2020-06-13T23:14:08.461Z</atom:updated>
            <content:encoded><![CDATA[<h3>Q: Why?</h3><h3>A: To provide proper navigation.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*WVH9_BojkmAFjPQDxHevew.gif" /></figure><ol><li>When the app is launched by App icon <strong>(Normal Flow)</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*PH2HBr8CkoEVK779hbEMYw.png" /></figure><p>2) When the app is launched by some Notification</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*ZAt91ryYc9WC4XjkDv9vmA.png" /></figure><p>The general flow of navigation in your app is <strong>MainActivity-&gt;DetailActivity</strong></p><p>But sometimes a Notification might directly open the DetailActivity. In this case, pressing the back button will not lead you to the `MainActivity. It&#39;s an <strong>EXPECTED BEHAVIOR</strong>. However, you can modify this if you want to navigate back to MainActivity.</p><h3>How?</h3><ol><li><strong>Declare Parent of DetailActivity.</strong></li></ol><p>android:parentActivityName=&quot;.Activities.MainActivity&quot; add this in Manifest file.</p><p>So it will look like this.</p><pre>&lt;activity android:name=&quot;.Activities.DetailActivity&quot;<br>    android:parentActivityName=&quot;.Activities.MainActivity&quot;&gt;<br>&lt;/activity&gt;</pre><p>But! this feature was added in Android 4.1. So if you want to target older devices. Add a <strong>meta-tag as well</strong>.</p><pre>&lt;activity android:name=&quot;.Activities.DetailActivity&quot;<br>    android:parentActivityName=&quot;.Activities.MainActivity&quot;&gt;<br>    &lt;meta-data<br>      android:name=&quot;android.support.PARENT_ACTIVITY&quot;<br>      android:value=&quot;.Activities.MainActivity&quot; /&gt;<br>&lt;/activity&gt;</pre><p><strong>2) Use TaskStackBuilder to create a Pending Intent.</strong></p><pre>public PendingIntent getPendingIntent(Intent intent){<br><br>    TaskStackBuilder taskStackBuilder = TaskStackBuilder<br>                                            .create(this);<br>    taskStackBuilder.addNextIntentWithParentStack(intent);<br>    PendingIntent pendingIntent =  taskStackBuilder<br>             .getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);<br><br>}</pre><p>You are all set. Now just pass this Pending intent to create Notifications.</p><pre><strong>Putting up content takes a lot of time and effort </strong>😓<strong>.</strong><br>👏 clap 👏 <strong>If you think you learned something from this article.</strong></pre><pre><strong>You can find me on </strong><a href="https://stackoverflow.com/users/4700156/rohit-singh"><strong>Stackoverflow</strong></a><strong>,</strong><a href="https://github.com/rohitksingh"><strong>Github</strong></a><strong>,and,on </strong><a href="https://www.linkedin.com/in/rohit94singh/"><strong>Linkedin</strong></a><strong>.<br>Give feedback and feel free to correct mistakes.</strong></pre><h3>Read More:</h3><p><a href="https://medium.com/@rohitksingh/what-is-addtobackstack-in-fragment-661ac01a6507">What is addToBackStack in Fragment</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uat04aV2HbW_dfM1kdY_-g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=420983dd1de2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intent Service: Don’t reinvent the wheel.]]></title>
            <link>https://rohitksingh.medium.com/intent-service-dont-reinvent-the-wheel-3e61149ec3b0?source=rss-7b157818555a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e61149ec3b0</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[services]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[intentservice]]></category>
            <dc:creator><![CDATA[Rohit Singh]]></dc:creator>
            <pubDate>Thu, 27 Feb 2020 23:49:28 GMT</pubDate>
            <atom:updated>2020-03-25T10:32:07.736Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jv37Ui5lYqadawQJEJSDug.jpeg" /></figure><p>This is a <a href="https://stackoverflow.com/questions/15524280/service-vs-intentservice-in-the-android-platform/47110145#47110145">re-post of an answer I wrote on Stackoverflow.</a></p><p><a href="https://developer.android.com/reference/android/app/IntentService.html">IntentService</a> extends <a href="https://developer.android.com/guide/components/services.html">Service</a> class which clearly means that IntentService is intentionally made for the <strong>same</strong> purpose.</p><p><strong>So what is the purpose?</strong></p><p>`IntentService’s purpose is to make our job easier to run background tasks without even worrying about</p><ul><li>Creation of worker thread</li><li>Queuing the processing multiple-request one by one (Threading)</li><li>Destroying the Service</li></ul><p>So <strong>NO</strong>, Service can do any task which an IntentService would do. If your requirements fall under the above-mentioned criteria, then you don&#39;t have to write those logics in Service class. So don&#39;t reinvent the wheel because IntentService is the invented wheel.</p><h3>The “Main” difference</h3><blockquote><em>The Service runs on the UI thread while an IntentService runs on a separate thread</em></blockquote><h3>When do you use IntentService?</h3><p>When you want to perform multiple background tasks one by one which exists beyond the scope of an Activity then the IntentService is perfect.</p><h3>How IntentService is made from Service</h3><p>A normal service runs on the UI Thread(Any Android Component type runs on UI thread by default eg Activity, BroadcastReceiver, ContentProvider and Service). If you have to do some work that may take a while to complete then you have to create a thread. In the case of multiple requests, you will have to deal with synchronization. IntentService is given some default implementation which does those tasks for you.<br>According to the <a href="https://developer.android.com/guide/components/services.html#ExtendingIntentService">developer page</a></p><ol><li>IntentService creates a Worker Thread</li><li>IntentService creates a Work Queue which sends the request to onHandleIntent() method one by one</li><li>When there is no work then IntentService calls stopSelf() method</li><li>Provides default implementation for onBind() the method which is null</li><li>Default implementation for onStartCommand() which sends Intent request to WorkQueue and eventually to onHandleIntent()</li></ol><pre><strong>Putting up content takes a lot of time and effort </strong>😓<strong>.</strong><br>👏 clap 👏 <strong>If you think you learned something from this article.</strong></pre><pre><strong>You can find me on </strong><a href="https://stackoverflow.com/users/4700156/rohit-singh"><strong>Stackoverflow</strong></a><strong>,</strong><a href="https://github.com/rohitksingh"><strong>Github</strong></a><strong>,and,on </strong><a href="https://www.linkedin.com/in/rohit94singh/"><strong>Linkedin</strong></a><strong>.<br>Give feedback and feel free to correct mistakes.</strong></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e61149ec3b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create a DoubleTapListner in Android]]></title>
            <link>https://rohitksingh.medium.com/how-to-create-a-doubletaplistner-in-android-ad1f50c1f7a9?source=rss-7b157818555a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad1f50c1f7a9</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[double-tap]]></category>
            <dc:creator><![CDATA[Rohit Singh]]></dc:creator>
            <pubDate>Tue, 04 Feb 2020 06:59:01 GMT</pubDate>
            <atom:updated>2020-03-25T10:34:03.131Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*nfNacgOF9wXM7EOBaRGskA.gif" /></figure><h3>button.setOnClickListener(this);</h3><p>You must have seen this a thousand times. I bet. Wouldn’t it be nice to have something like this for “DoubleTapListner”</p><p>You can create a DoubleTapListener by yourself by extending View.OncliclkListener and attach it to any View(Button, TextView, EditText, etc) in Android.</p><h4>Follow these simple steps and you will be able to create a Double, Triple and even a “unicorn” listener.</h4><h4>Step1:</h4><p>Create an interface</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fac62e11b5c54cf3c1ab5c3c780ab301/href">https://medium.com/media/fac62e11b5c54cf3c1ab5c3c780ab301/href</a></iframe><h4>Step 2:</h4><p>Create a class DoubleTapListner which extends View.OnClickListener</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e9fad46e5a22a39e020164d0378200ba/href">https://medium.com/media/e9fad46e5a22a39e020164d0378200ba/href</a></iframe><h4>Step 3:</h4><p>Use it in your Activity</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/93e993845dec86dfd706bf90613a378e/href">https://medium.com/media/93e993845dec86dfd706bf90613a378e/href</a></iframe><p>And you are done!</p><p>You can see the full code <a href="https://github.com/rohitksingh/My_Android_Garage/tree/master/DoubleTapListener">HERE</a></p><pre><strong>Putting up content takes a lot of time and effort </strong>😓<strong>.</strong><br>👏 clap 👏 <strong>If you think you learned something from this article.</strong></pre><pre><strong>You can find me on </strong><a href="https://stackoverflow.com/users/4700156/rohit-singh"><strong>Stackoverflow</strong></a><strong>,</strong><a href="https://github.com/rohitksingh"><strong>Github</strong></a><strong>,and,on </strong><a href="https://www.linkedin.com/in/rohit94singh/"><strong>Linkedin</strong></a><strong>.<br>Give feedback and feel free to correct mistakes.</strong></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad1f50c1f7a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Different states of Android Activity]]></title>
            <link>https://rohitksingh.medium.com/different-states-of-android-activity-95597254e353?source=rss-7b157818555a------2</link>
            <guid isPermaLink="false">https://medium.com/p/95597254e353</guid>
            <category><![CDATA[android-activity]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android-activity-states]]></category>
            <category><![CDATA[android-lifecycle]]></category>
            <dc:creator><![CDATA[Rohit Singh]]></dc:creator>
            <pubDate>Sun, 22 Dec 2019 06:09:37 GMT</pubDate>
            <atom:updated>2020-03-25T10:34:27.632Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*l0eRXZpYB4kov87CEiMI1Q.jpeg" /></figure><p>An Android Activity has 4 States</p><ul><li>Running</li><li>Paused</li><li>Stopped</li><li>Destroyed</li></ul><p>Now there is a very unclear Demarcation among them if you just started learning Android application development. I will try to explain it in simple terms. So hang on!</p><h3>1) Running</h3><p>When a user is actively interacting with an Activity then the activity is in Running State.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*FOJq20kt8ITyNQ1BcXDGDw.gif" /></figure><h3>2) Paused</h3><p>When a partial or a transparent Dialog/Activity gets focus on the top of the previous Activity then the Activity goes to the paused state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*cBWF62Mfve7Y-EsSbdy-MA.gif" /></figure><p>You can see that the dialog partially hides the “Profile Activity”. The profile Activity is still visible but the user can not interact with it because the dialog has gained the focus. In this case, the Profile Activity goes to the paused state.</p><h3>3) Stopped</h3><p>When an activity gets completely hidden by another Activity or dialog then the Activity goes to stop state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*YmVtMbqJIptxdQkFx5IAlQ.gif" /></figure><p>You can see the profile Activity gets completely hidden by Another Activity.</p><h3>4) Destroyed</h3><p>There are two main reasons when an activity goes to the destroyed state.</p><ul><li>Android OS</li><li>YOU</li></ul><p>Android OS: When an activity remains in background for way too long. Then there is a possibility that the Android OS may destroy your Activity to free up some space for more important tasks.</p><p>You: When you call finish() method in the Activity then the activity goes to the destroyed state.</p><p>I know I have not covered the lifecycle methods and Activity Backstack while explaining the states. But the idea was to keep this article as simple as possible. Hope you all liked it.</p><pre><strong>Putting up content takes a lot of time and effort </strong>😓<strong>.</strong><br>👏 clap 👏 <strong>If you think you learned something from this article.</strong></pre><pre><strong>You can find me on </strong><a href="https://stackoverflow.com/users/4700156/rohit-singh"><strong>Stackoverflow</strong></a><strong>,</strong><a href="https://github.com/rohitksingh"><strong>Github</strong></a><strong>,and,on </strong><a href="https://www.linkedin.com/in/rohit94singh/"><strong>Linkedin</strong></a><strong>.<br>Give feedback and feel free to correct mistakes.</strong></pre><h3>Read More:</h3><p><a href="https://medium.com/@r4rohit002/recyclerview-and-handling-different-type-of-row-inflation-83912f6d3792">Create Multiple ViewHolders in a single RecyclerView</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*txTKfYmmPkq5m3cuXtv8dg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95597254e353" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>