<?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 Abhas Kumar on Medium]]></title>
        <description><![CDATA[Stories by Abhas Kumar on Medium]]></description>
        <link>https://medium.com/@abhaswrites?source=rss-41fcb4ffb183------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Iz8HJKTPWT4Y4DqwHaokyQ.jpeg</url>
            <title>Stories by Abhas Kumar on Medium</title>
            <link>https://medium.com/@abhaswrites?source=rss-41fcb4ffb183------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:51:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhaswrites/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[The Career That Never Made Sense]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://abhaswrites.medium.com/the-career-that-never-made-sense-88ba997da228?source=rss-41fcb4ffb183------2"><img src="https://cdn-images-1.medium.com/max/1600/1*8y6uZyoPyIM3ZJdlvew5fA.png" width="1600"></a></p><p class="medium-feed-snippet">You are seeing the slot calendar right! Currently it looks colored, but it started with blank white 0 filled slots 4 months ago. Yes you&#x2026;</p><p class="medium-feed-link"><a href="https://abhaswrites.medium.com/the-career-that-never-made-sense-88ba997da228?source=rss-41fcb4ffb183------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://abhaswrites.medium.com/the-career-that-never-made-sense-88ba997da228?source=rss-41fcb4ffb183------2</link>
            <guid isPermaLink="false">https://medium.com/p/88ba997da228</guid>
            <category><![CDATA[startup-lessons]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[life-lessons]]></category>
            <dc:creator><![CDATA[Abhas Kumar]]></dc:creator>
            <pubDate>Tue, 01 Sep 2026 21:08:40 GMT</pubDate>
            <atom:updated>2026-09-01T21:08:40.540Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Current ISPs and Starlink — Future of Internet]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">Understanding Internet Service Providers: From Traditional Networks to the Future of Global Connectivity</p><p class="medium-feed-link"><a href="https://abhaswrites.medium.com/current-isps-and-starlink-future-of-internet-e41a7c45897b?source=rss-41fcb4ffb183------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://abhaswrites.medium.com/current-isps-and-starlink-future-of-internet-e41a7c45897b?source=rss-41fcb4ffb183------2</link>
            <guid isPermaLink="false">https://medium.com/p/e41a7c45897b</guid>
            <dc:creator><![CDATA[Abhas Kumar]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 21:03:17 GMT</pubDate>
            <atom:updated>2025-07-24T21:03:17.626Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A personal journey of reflection and realization — A new chapter.]]></title>
            <link>https://abhaswrites.medium.com/a-personal-journey-of-reflection-and-realization-a-new-chapter-be077f7738a8?source=rss-41fcb4ffb183------2</link>
            <guid isPermaLink="false">https://medium.com/p/be077f7738a8</guid>
            <dc:creator><![CDATA[Abhas Kumar]]></dc:creator>
            <pubDate>Mon, 16 Sep 2024 07:12:13 GMT</pubDate>
            <atom:updated>2024-09-16T07:13:47.052Z</atom:updated>
            <content:encoded><![CDATA[<h3>A personal journey of reflection and realization — A new chapter.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vdwq79sXmGcUDCTXK2nD1Q.jpeg" /></figure><p>Yesterday, I visited the <strong>Gurudwara</strong> and spent a longer time there, immersed in the chanting and focusing through meditation. It was an incredible experience, especially participating in <strong>Seva</strong>, one of Sikhism’s most revered practices, alongside prayers. However, the visit had a rather unexpected end for me and turned out to be injurious somehow.</p><p>Over time, I’ve also visited <strong>monasteries</strong>, trying to capture the essence of <strong>Buddhism</strong>, and growing up, <strong>Hinduism</strong> has always been deeply rooted in my blood. Our traditions, across all these faiths, teach us to believe in a higher energy, a supreme force, and encourage us to practice prayer and devotion, believing in its power to shape both our personal and professional lives.</p><p>I may not know how the future will unfold, but I can confidently say that I’ve started to explore <strong>spirituality</strong> from different perspectives, even if it’s just at a very basic level. For me, spirituality has never worked in the ways many people expect nowadays. But that doesn’t mean it hasn’t worked — it’s just taken a very different form.</p><p>Whenever I feel overwhelmed by the relentless stream of thoughts, by a sedentary lifestyle filled with meaningless friendships, complicated relationships, goal-chasing, and internal battles, spirituality serves as a <strong>mental reset</strong>. Yes, a <strong>change of mind</strong>. I step back, forget everything for a while, and listen to devotional music, remember whichever form of God resonates with me, or simply sit in a temple or <strong>Gurudwara</strong>, chanting divine names. These moments give my mind the necessary space to breathe, offering a <strong>break</strong> before gearing up for the next challenge.</p><p>To be honest, I’ve never experienced a divine experience or felt something special in these moments. But that’s because I never try to force it. <strong>If something is meant to be felt, I believe it will come naturally — I won’t chase it.</strong></p><p>I’ve faced a lot of <strong>failures</strong>, despite having the abilities and drive to succeed. In many ways, I’ve been a victim of my own decision-making. But that’s alright — there was no one to guide me on what was right or wrong, so I explored everything on my own. I tried everything that intrigued me, made mistakes, learned, and made decisions based on that learning. I‘ve rejected the notion of discovering <strong>my passion</strong> through the lens of others. I no longer believe that someone else’s fascination or dreams should dictate the <strong>purpose</strong> of my life. Failure, to me, has never been a disappointment. Instead, it’s been a <strong>motivation</strong>. Each failure lights a fire inside me to fight back, and that resilience, I believe, is my inheritance — it’s in my blood.</p><p>And this inner strength? I attribute a lot of it to <strong>spirituality</strong>. Not the mystical kind, but the everyday kind. The belief that there’s something larger than me, guiding me, even if I can’t always see it. For me, spirituality is not about sitting in a temple or Gurudwara waiting for a miracle. It’s about understanding that there’s a <strong>powerful energy</strong> that helps me rise after every fall.</p><p>This doesn’t mean I don’t respect or value the <strong>rituals</strong>. On the contrary, I deeply value our traditions. I regularly visit these places of worship because I want to stay connected to my culture and heritage. But for me, spirituality isn’t about feeling something extraordinary every time I walk into a temple, Gurudwara, or monastery. It’s about <strong>honoring</strong> a system that has been passed down through generations — a system that helps me reset and refocus.</p><p>For me, spirituality is simple: it’s about <strong>helping people</strong>, holding good intentions, ensuring that people and animals feel safe around me, and giving back to society through my actions and knowledge, do whatever you enjoy which isn’t hurting others (It could be dance, music, photography, comedy, anything it could be). And most importantly, I’ve realized that <strong>hard work</strong> has no substitute. You can pray, chant, and meditate, but if you’re not working toward your goals, no miracle is going to make things happen for you.</p><p>From now on, I’ve decided to stop looking for <strong>miracles</strong> through prayer alone. I’ll stop expecting emotional balance just by sitting in a religious place without making the necessary efforts in my daily life. Instead, I’ll visit temples, <strong>Gurudwaras</strong>, and <strong>monasteries</strong> to stay connected with my culture, to feel that peaceful energy, to take a break, and to find that positive <strong>shift</strong> in my mind. But I’ll always know that real change — real progress — only happens when your <strong>actions align with your ambitions</strong>.</p><p>Thanks a lot.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be077f7738a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jetpack compose unpacked — 1]]></title>
            <link>https://abhaswrites.medium.com/jetpack-compose-unpacked-1-c4dab18c3ae2?source=rss-41fcb4ffb183------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4dab18c3ae2</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin-native]]></category>
            <dc:creator><![CDATA[Abhas Kumar]]></dc:creator>
            <pubDate>Wed, 06 Dec 2023 08:49:53 GMT</pubDate>
            <atom:updated>2023-12-06T08:49:53.181Z</atom:updated>
            <content:encoded><![CDATA[<h3>Jetpack compose unpacked — 1</h3><p>I am crafting a series dedicated to Jetpack Compose, the innovative Android UI library that, while no longer brand new, continues to gain rapid adoption within the Android ecosystem.</p><p>So today, I will just try to make you understand what is this new library and how is it different from traditional XML approach?</p><p><strong><em>Reading this article will help you in understanding the basics of Jetpack compose, why &amp; how to start using it.</em></strong></p><p>There are two ways we can code UI screens.</p><ol><li>Imperative way</li><li>Declarative way</li></ol><p>What is this Imperative &amp; Declarative way? The Imperative way, currently prevalent in Android app development, involves using XML to define the user interface and then crafting the corresponding logic in Java or Kotlin.</p><p>On the other hand, the Declarative way, exemplified by Jetpack Compose, presents a paradigm shift in UI development. This approach focuses on declaring the desired UI state, allowing the framework to handle the underlying complexities, and streamlining the development process. In the realm of web development, the adoption of the declarative approach to UI development occurred much earlier.</p><h3>So now first let’s understand what this both fancy word actually means?</h3><p>Consider the scenario of planning a visit to a mall for shopping, where you have two options for transportation: using your own car or booking a cab. <strong>Let’s focus on the imperative approach, such as deciding to use your car.</strong> The process involves several manual steps — retrieve your car from the parking, clean and check its fuel, drive to the mall location, find parking, and finally, enter the mall. This entire sequence represents an imperative approach, where you take on the responsibility of executing each step to reach the goal, defining how to achieve the desired outcome of reaching the mall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*P5SPbH9lVFyC6Z7hMbxjZg.jpeg" /><figcaption>Choosing your own method of driving to mall</figcaption></figure><p>Now, let’s explore the second method, <strong>opting for a cab by booking through a service like Uber.</strong> In this scenario, you simply open the Uber app, specify your destination, and the rest unfolds seamlessly. A car arrives at your location, transports you to the mall, and the task is complete. Here, you only need to declare your destination or goal — where you want to go — and the system takes care of the details. This exemplifies the declarative way of achieving desired goals, where you define the outcome without having to manage every step of the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cEOS1LrO0yQyi0j9WeKeQg.jpeg" /><figcaption>Choosing Uber or any other cab services to visit anywhere.</figcaption></figure><p>Hope you understood the difference between Imperative and Declarative ways of programming.</p><p>Jetpack Compose embodies a declarative approach to building and developing the UI. In this paradigm, <strong>the UI hierarchy is constructed through composition</strong>, differenct from the Views framework, where inheritance was the key building block. With Compose, <strong>you simply declare what you want, and the rest is seamlessly handled by Composable functions.</strong> This shift in methodology allows developers to focus on expressing the desired UI state, freeing them from the complexities of managing UI elements through inheritance.</p><pre>@Composable<br>fun MyName(){<br>  Text(&quot;My name is Abhas Kumar&quot;, color = Color.White)<br>}</pre><blockquote>UI is defined as a function of the current state in compose and it is data dependent.</blockquote><p>Whenever there’s a change in data, <strong>Composable functions are invoked again, ensuring that only the necessary UI elements are rendered.</strong> This dynamic approach optimizes app performance and memory utilization by rendering only the components that require modification. The ability to selectively update UI elements through Recomposition is a powerful aspect of Jetpack Compose, enhancing both efficiency and responsiveness in your application.</p><p>ComponentActivity() is the base class that enables composition in Compose.</p><h4>I am going to discuss three important composable functions that is needed to build any kind of basic layout using Jetpack compose.</h4><ol><li><strong>Column()</strong> — This Composable function facilitates the vertical arrangement of multiple UI composables.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*9wq4fROVJmMJI6qDXuaz5Q.png" /><figcaption>Arrangement &amp; Aligment of items in Column.</figcaption></figure><p>Geometrically, the main axis of Column() is aligned with the Y-axis. This alignment corresponds to the vertical arrangement of composables within the Column(), allowing for a clear definition of their layout in a top-to-bottom manner.</p><p>2. <strong>Row() </strong>— This Composable function is employed to horizontally arrange multiple UI composables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*xZiHCILTFEf-u4SeIBJWkg.png" /><figcaption>Arrangement &amp; Aligment of items in Row.</figcaption></figure><p>Geometrically, the main axis of Row() aligns with the X-axis. This alignment dictates the horizontal arrangement of composables within the Row(), allowing for a straightforward definition of their layout from left to right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*ccNV6l64C2_c8_GJ_wnL2w.jpeg" /><figcaption>Arrangement of items in Row &amp; Column</figcaption></figure><p>3. <strong>Box()</strong> — This Composable function is utilized to stack UI composables on top of each other in a layered fashion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDR3VceQekJ5U3qCrz2_XQ.jpeg" /><figcaption>Official depiction of Row, Column &amp; Box Composables</figcaption></figure><p>While there are numerous aspects left to explore, such as modifiers, state management, alignment, and various layout arrangements, the primary objective of this article is to initiate a deep dive into the realm of Jetpack Compose. This series will keep going on.</p><p>Connect with me on Linkedin — <a href="https://www.linkedin.com/in/abhas-kumar-96872b25b/">https://www.linkedin.com/in/abhas-kumar-96872b25b/</a></p><p>Connect with me on Twitter — <a href="https://twitter.com/heyabhas">https://twitter.com/heyabhas</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4dab18c3ae2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[It’s about delivering promises to a few people. Early stage startup marketing.]]></title>
            <link>https://abhaswrites.medium.com/its-about-delivering-promises-to-a-few-people-early-stage-startup-marketing-d5baf6527f54?source=rss-41fcb4ffb183------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5baf6527f54</guid>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[product-management]]></category>
            <dc:creator><![CDATA[Abhas Kumar]]></dc:creator>
            <pubDate>Sat, 26 Feb 2022 18:46:23 GMT</pubDate>
            <atom:updated>2022-02-26T18:46:23.604Z</atom:updated>
            <content:encoded><![CDATA[<h3>Book Summary -1.</h3><figure><img alt="This is summary of book ‘ This is marketing ‘ by Seth Godins." src="https://cdn-images-1.medium.com/max/600/1*oOvua24FO9Jpg0H450mdVQ.jpeg" /></figure><p>I am working on a side project and in that I am building a SAAS platform for businesses. Me and my friend discussed and decided that we should work on our project and let’s see how much it help businesses! We started working and are almost on the verge of launching our MVP. Now it’s time to think about taking our product into the market. Before moving ahead I want to inform you that I have started sharing startup related content on my <a href="https://www.youtube.com/channel/UCaeMnAe6LAu2NahauBb-teg"><strong>Youtube channel </strong></a><strong>. You can subscribe for following my journey, learnings of technology, marketing &amp; building a startup. </strong>Ok let’s continue:</p><p>I have worked earlier into consumer sales and for some time I have worked for a SAAS startup as well. I knew one thing: it’s not easy to sell a product to an Indian audience. <em>Indian consumers prefer buying the product rather than a product being sold to them.</em> I knew customers don’t care whether my startup is in a very early phase or in a growth phase. They see everything while making a decision to purchase. <strong>And that’s where I think most early stage founders lose, they fail to distribute their product even if their product means something.</strong> I can’t control everything nor can I build everything for now. We have a very limited feature in our software or say only one feature and with very few resources I need to take it into the market and onboard our first 100–200 paid customers. Luckily I knew these all things from my past work. So we need to very vigilant on our :</p><p><strong>1. Messaging</strong></p><p><strong>2. Clarity of goal that customers will achieve if they chose our product</strong></p><p><strong>3. Customer type</strong></p><p>So I decided to read an exceptional book written by ‘ Seth Godins ‘ provided by my friends as a gift on my birthday. I guess they knew my future ;) I read half of the book. And so far this book has lots of marketing wisdom hidden in it.</p><p><strong>I will cover the summary of the first 4 chapters in this article.</strong> So let’s start now.</p><p>First thing first, <strong><em>marketing is not a battle, not a war and not even a contest.</em></strong> Author suggested taking it as <strong>a generous act of helping someone to solve their problem</strong>. It’s a chance to change the culture for the better.</p><p>Author accepted that there are fake marketers who are the reason for shaming of marketing professionals. <strong>Spamming, tricking, coercing are the sign of short term profit-maximizing hustlers and can easily adopt a shameless mind-set.</strong></p><p>The only productive solution is to understand the problem deeply and then derive the solution. In other words find a lock and then fashion a key.</p><p>Author has beautifully explained the impact of marketer. I am quoting the words exactly from the book. “ <strong><em>When our ideas spread, we change the culture. We build something that people would miss if it were gone, something that gives them meaning, connection and possibility</em></strong> “.</p><p>Whereas selfish marketers focus on hype, scams and pressure. It doesn’t work in the long term.</p><p>And after that the author has taken a case study of marketing that is built on trust and empathy. Case study was on a company named “ Penguin Magic “.</p><p>So now we all have got the sense that the author is talking about <strong>marketing from the lens of patience, empathy and respect.</strong> Let’s move further.</p><p>Marketers learn to see how human beings <em>dream, decide and act.</em> 5 steps are brought into consideration for becoming better at marketing.</p><ol><li><strong>Invent a worth making product</strong></li><li><strong>Design and build it in such a way that a few people can be benefited</strong></li><li><strong>Tell a story that matches the built narrative and dreams of those few people.</strong></li><li><strong>Now spread the word</strong></li><li><strong>Show up regularly, consistently and generously</strong></li></ol><p>Marketers don’t use the consumers to solve their company’s problem, rather they use marketing to solve other people’s problems.</p><h4>Persistent, consistent and frequent stories delivered to an aligned audience will earn attention, trust and action.</h4><p>Two things that has ability to change everything and earn the attention of customers:</p><ol><li><strong>Way of story being told</strong></li><li><strong>Promise to be made</strong></li></ol><p>Above mentioned two points are worth putting max of your time into it. Get better at story delivering that resonates and make promises that are achievable and can bring some positive change in the life of customers.</p><p>“ It’s foolish to persuade customers. Better tell them real stories that resonates to them “</p><p>Moving on to the next, the author tells a case study of a company named ‘ VisionSpring ‘. It is interesting. In this case study, the <strong>difference of ‘ Desire for gain vs avoidance of loss ‘ is highlighted</strong>.</p><p>It is never helpful to imagine everyone knows what you know, wants what you want, believes what you believe.</p><p>“ <strong><em>The way marketers make things better is by caring enough about those we serve to imagine the story that they need to hear. Marketers need to be generous enough to share that story, so that they can take action that they will be proud of. </em></strong>”</p><p>The author has explained that no one wants what you make. They want what it will do for them, how it will make them feel.</p><p>Nowadays we see that marketing means Facebook ads, design on new logo, data hacks etc. but the author differs with this view of marketing. Author suggests focusing on ‘ Market driven ‘ not ‘ Marketing driven ‘. <strong>When you are market driven you focus on hopes and dreams of your customers, you listen to their frustrations and invest in changing the culture.</strong></p><p>Play in ‘ Smallest Viable Market ‘. Put all your focus on SMV. Don’t try to hit each and everyone, you can’t!</p><h4>Rectification of Smallest Viable Market starts with rectification of :</h4><p><strong>What changes are you trying to make?</strong> Answer could be anything, just think. It could be like “ Turning non-voters into voters “ or could be anything. Don’t think of nearly impossible change, just think what could be done with the resources you have right now.</p><p><strong>What promises are you making? </strong>When a marketer shows up, it always takes a form of promise. Anything you tell, the customer will take it as a promise. So be very sure and clear about the promises you are making. It can make or break your company. Promises aren’t the same as guarantees but it’s like telling the change customers will see after using your product.</p><p>Promises can be like: I have discussed this in one video of my Youtube Channel <a href="https://www.youtube.com/watch?v=OS_gWIpJWxw"><strong>link</strong></a>.</p><p><em>They laughed when I sat down at the piano…. but when I began to play…” — Promise about status.</em></p><p><em>“Roll tide!” — It’s a promise about dominance.</em></p><p><em>“ The earth needs a good lawyer” — It’s a promise about affiliation and justice.</em></p><p>And lastly, which is one of the most important parts, <strong>Who are you seeking to change?</strong> Very clearly the author have highlighted the importance of changing someone and not everyone.</p><p><strong>“ Once you are clear on “who it’s for,” then doors begin to open for you “. </strong>Here two examples have been given of Dunkin donuts and Starbucks, how both serve different types of customers in the same industry.</p><p>It has been advised by the author that finding a focus group is the most important part of marketing. It can be found based on what people dream of, believe, want. Demographics is not a good idea to find a focus group.</p><p><strong>Choose the people who want what you’re offering.</strong></p><p><strong>Choose the people most open to hearing your message.</strong></p><p><strong>Choose the people who will tell the right other people.</strong></p><p>An inspiring case study of a cafe named ‘ Union square cafe ‘ on finding a focus group.</p><p>Organize everything, your life and your company around the minimum.</p><p>“ Everything gets easier when you walk away from the hubris of everyone. Your work is not for everyone. It’s only for those who signed up for the journey. “</p><h4>A template for making marketing promises has been provided in the book. I am also adding it here:</h4><blockquote>My product is for people who believe ___________</blockquote><blockquote>I will focus on people who want ____________</blockquote><blockquote>I promise that engaging with what I make will help you get _________</blockquote><p><em>Lastly summing up Smallest Viable Market in one line : It is about finding people who will understand you and will fall in love with where you hope to take them.</em></p><p>And then a case study of a company named “ Open heart “ has been told in the book which is a great example of finding a core focus group by a company owner.</p><p><strong>Okay so I have tried to write a summary of the first 4 chapters in a way that helps you to save your time and grab required learning.</strong></p><p>What I learnt till now as a founder who is trying to find his place in market:</p><blockquote>I need to be very clear about what changes we are making with our product?</blockquote><blockquote>Creating a real story that resonates with people, that pushes people to take action.</blockquote><blockquote>Put maximum focus on finding a group of people who share our belief, hopes and are ready to come with us to achieve a goal.</blockquote><blockquote>Promises made should be quantifiable and justifiable.</blockquote><p>I hope you have learned something. If you like reading and listening such startup related content then I think subscribing my <a href="https://www.youtube.com/channel/UCaeMnAe6LAu2NahauBb-teg"><strong>Youtube Channel</strong></a><strong> </strong>would be helpful for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5baf6527f54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Safe Call and Elvis Operator usage in Kotlin]]></title>
            <link>https://proandroiddev.com/safe-call-and-elvis-operator-usage-in-kotlin-d36b1d423ec7?source=rss-41fcb4ffb183------2</link>
            <guid isPermaLink="false">https://medium.com/p/d36b1d423ec7</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[null-safety]]></category>
            <category><![CDATA[androiddev]]></category>
            <dc:creator><![CDATA[Abhas Kumar]]></dc:creator>
            <pubDate>Sat, 31 Jul 2021 19:12:11 GMT</pubDate>
            <atom:updated>2021-08-11T14:46:12.943Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is for those who have a basic understanding of ‘ Nullability ‘. The only reason I am writing this article is because I once faced lots of confusion in their syntax and usage and that’s why I will try to make it understandable in my way. I will specifically talk about two ways of Null checks in Kotlin and that is ‘ <strong>Safe Call Operator</strong> ‘ and ‘ <strong>Elvis Operator</strong> ‘.</p><p>So let’s start with understanding what is ‘ <strong>Safe Call</strong> ‘ and how it is used for null checks.</p><p><strong>A safe call is denoted by the operator( ? ) </strong>— It is used in case you want to check the null condition and if the expression is null then by default it will return null or else it will return the value that is instructed. Let’s understand by example how it’s done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*qvvByzJTYi7_FGmNwKMCuA.png" /><figcaption>Safe Call Operator usage. ( Pic 1 )</figcaption></figure><p>What’s happening in the above program? A variable of type String is declared but wait look at it carefully. That’s not simply String, that is of type nullable String( String? ). It means ‘ name ‘ String can be null. It will tell the compiler to check to do nullability check on ‘ name ‘ String by using ‘ ? ‘ operator also known as Safe Call Operator. Guess the output!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*Yi_Ec8GRhJ8A0JGvLIou6Q.png" /><figcaption>Pic 2. Output using Safe Call Operator</figcaption></figure><p>As you can see output is ‘ null ‘. That’s the benefit of using this operator. If the expression has a null value then it will simply return null without any further manipulation and if the expression isn’t null then it will return the result of operations performed on the variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*ea2uAMaitRfVu8aPb0GqSQ.png" /><figcaption>Pic 3 — Example for Safe Call Operator</figcaption></figure><p>The above program is taken from one of my personal projects. Here you can see that the variable ‘ exerciseTimer ‘ is of type nullable CountDownTimer. If it’s nullable then a check will be done and in this case, I used Safe Call Operator to perform a null check. If it’s not null then exerciseTimer?.cancel() would have returned the result after performing cancel() method on ‘ exerciseTimer ‘ but again in this case variable is null then you can simply guess the returned result will also be ‘ null ‘.</p><p>What will happen if you don’t check for null conditions on the nullable type declaration? Let me show you first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*mXN11SsWm0CIDu-ld_VhKg.png" /><figcaption>Pic 4 — Program for not applying null check on nullable type declaration</figcaption></figure><p>As you can see warning with a <strong>red curly line</strong>. Let’s see what it returns on running the program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*fu-j_bSFsV23BCgXG7onRQ.png" /><figcaption>Pic 5 — Error on not applying null check on nullable type declaration</figcaption></figure><p>It will throw an error or it will simply tell you to check if the value is not null. So you have to be careful when having nullable type declaration.</p><p><strong>Elvis Operator ( ?: )</strong> — Now let’s understand Elvis Operator what is it and when it is used.</p><p>You have seen a different kind of sign here ‘ ?: ‘ here. In Kotlin this operator is known as Elvis Operator. First, let’s see one program in action:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*TZbbYRv18UeNI8gz2Myr5Q.png" /><figcaption>Pic 6 — Program using Elvis Operator.</figcaption></figure><p>You must be giving a thought to what’s different in it than Safe Call Operator. To understand the difference firstly you need to see the result of the above program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*bQpRKfC73ZM1RL9zrc1i5g.png" /><figcaption>Pic 7 — Result of the above program using Elvis Operator.</figcaption></figure><p>As you have noticed result printed is 0. In the case of Safe Operator Call it would have printed ‘ null ‘. And that’s the difference between Safe Operator Call &amp; Elvis Operator.</p><p>Safe Operator Call will return ‘ null ‘ by default if the value is null but using <strong>Elvis Operator in conjunction with Safe Call Operator you can ask for the desired output</strong> other than ‘ null ‘ if the assigned value is null. Instruction right to ‘ ?: ‘ operator will be returned if null is found in nullability check.</p><p>In this case, the value<em> right to ‘ ?: ‘ operator is 0</em>. That’s why it printed 0 not null.</p><p><strong>So Elvis Operator gives you the independence to do more in case express is found null during the check.</strong></p><p>So, there is a lot more we can do using these operators. We can use it on any type of nullable declaration whether it’s String, Array, List, or whatever. I have kept the focus on basic manipulations and tried to clear out the confusion while using these two.</p><p>Thanks a lot!</p><p>You can connect with me on Twitter — <a href="https://twitter.com/lazy_doer">https://twitter.com/lazy_doer</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d36b1d423ec7" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/safe-call-and-elvis-operator-usage-in-kotlin-d36b1d423ec7">Safe Call and Elvis Operator usage in Kotlin</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kotlin Grouping]]></title>
            <link>https://proandroiddev.com/kotlin-grouping-e0b7c216ad9a?source=rss-41fcb4ffb183------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0b7c216ad9a</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[collection]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Abhas Kumar]]></dc:creator>
            <pubDate>Mon, 12 Jul 2021 19:33:37 GMT</pubDate>
            <atom:updated>2021-08-18T00:11:34.145Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qV61z6CwElESfTPs" /><figcaption>Photo by <a href="https://unsplash.com/@universaleye?utm_source=medium&amp;utm_medium=referral">Universal Eye</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Without wasting time let’s move on to understand what actually we want to discuss in this article. As title suggests ‘ Grouping ‘, what is grouping?</p><p>In programming, Grouping is used to group collections on the basis of certain characteristics. Let’s say we have a list of our upcoming tasks to perform in next week. We want to group tasks according to first character in their name.</p><p>In such cases ‘ Grouping ‘ helps a lot. We can group items based on length, type, object category etc.</p><p>Okay so let’s see how it’s done in Kotlin.</p><p>Using <strong>groupBy()</strong> Kotlin extension function. What happens when we use this function:</p><ol><li>It will return a ‘ map ‘ which contains keys and list of groups.</li><li>Keys will be the lambda result and list of groups corresponding to keys will actually be those lists on which result is applied.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WPnjQnmwToIGBAzcdwYCWg.png" /><figcaption>Usage of groupBy()</figcaption></figure><p>3. As we can see in above program, result returned is actually a map with keys which is obtained from lambda argument with groupBy() and values is the lists on which argument result is applied.</p><p><strong><em>Another thing we can do with groupBy()</em></strong> is passing another lambda argument also called as ‘ <strong>Value Transformation Function</strong> ‘. What does it do?</p><p>It transforms the actual values in collection and mapped with keys (obtained from the first lambda argument) into a result map.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xfKxolxi-MVOz3qiEqBTIA.png" /><figcaption>Usage of Value Transformation Function with groupBy()</figcaption></figure><p>Okay so it’s all about grouping a collection based on some criteria.</p><p>Now what if we want to perform an operation for all groups at once. I mean I want the count of tasks grouped according to first character of their name. As you can see I am asking to apply operation on all groups.</p><p>Simply we can think of iterating over resulted map but it adds lot of confusion and even after that it is not clear that we will be able to print first character with the number of items starting with that character.</p><p>So, in such cases Kotlin has provided us a groupingBy() function that allows us to apply operation for all groups at once and return a ‘Grouping’ object. I am again requesting you to focus on its return type. It will not return map, it will return a ‘ Grouping ‘ object. Let’s see it in action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8iE-ZyIH4pcCSbM9-jfmGw.png" /><figcaption>Usage of groupingBy() function</figcaption></figure><p>As we can see, <strong>eachCount()</strong> is used to perform operation on all groups. It will help to obtain the count of lambda argument. There are another operations we can perform as well. You can see the official documentation for the reference “ <a href="https://kotlinlang.org/docs/collection-grouping.html">https://kotlinlang.org/docs/collection-grouping.html</a> “</p><p>I will end this article by showing you difference between the return type of <strong>groupBy()</strong> &amp; <strong>groupingBy()</strong>. Look below into the image, observe the difference between first and second output. First output is the count of type map and another is a grouping object. This is the main difference between groupBy() &amp; groupingBy().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XC2Mlqyy3PvFHMQearwX2w.png" /><figcaption>First output is of groupBy() and second output is of groupingBy()</figcaption></figure><p>So I hope you are now able to understand the basics of grouping of collection and how to perform operations on it.</p><p>PS : I got a good idea by one of the developer I follow on Twitter to include some complex examples to make readers understand the real world usage of Kotlin grouping.</p><p>So as he suggested me to take an example to <strong>group the ‘ Complete ‘ &amp; ‘ Incomplete’ tasks in a Todo list.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WHIu4lhvJPQVYtbXTETvSA.jpeg" /></figure><p>Okay, so let’s understand how it can be done. It’s better idea to <strong>create a Data class</strong> for Task name &amp; Status of task completion. It will be helpful in creating a list of objects of Data class. Now it’s easy to group.</p><p>Now we need to think what are the ways we can group. We have two ways :</p><ol><li><strong>Simple grouping</strong> — It will group the list elements as per lambda argument. Since list elements are data class objects. So it will return Key as per lambda argument &amp; value as data class object.</li><li><strong>Value transformation</strong> — In this case, second lambda argument will transform the data class object the way we require and append as value to the keys obtained by first lambda argument.</li></ol><p>In this case we will use ‘ Value Transformation ‘ and insert two lambda argument so that we can only see the tasks name as per their completion status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gW5M3xKa-bjjiIJwK2uiLw.png" /></figure><p>As we can see in above program we used <strong><em>two lambda arguments</em></strong> to get the neat and desired result. We used ‘ <strong>GroupingBy</strong>&#39; as well to get the count of completed and incompleted tasks.</p><p>This example helped us to get to know about real world application of Grouping and how it can be used for various use cases.</p><p>So it’s all done about ‘ Kotlin Grouping ‘ and special mention to <strong>Matt M</strong> for asking me to include this example.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0b7c216ad9a" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/kotlin-grouping-e0b7c216ad9a">Kotlin Grouping</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>