<?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[Android Developers Nepal — MDN - Medium]]></title>
        <description><![CDATA[Android development stories from the Himalayas. The publication is a part of Mobile Developers Nepal (MDN) with it’s core focus on, you guessed it, Android. - Medium]]></description>
        <link>https://medium.com/android-developers-nepal-mdn?source=rss----120de779ce7d---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Android Developers Nepal — MDN - Medium</title>
            <link>https://medium.com/android-developers-nepal-mdn?source=rss----120de779ce7d---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 16:13:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/android-developers-nepal-mdn" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Reducing noise in your database operations with Kotlin on Android]]></title>
            <link>https://medium.com/android-developers-nepal-mdn/reducing-noise-in-your-database-operations-with-kotlin-on-android-7561b48a7f26?source=rss----120de779ce7d---4</link>
            <guid isPermaLink="false">https://medium.com/p/7561b48a7f26</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Rakeeb Rajbhandari]]></dc:creator>
            <pubDate>Mon, 25 Dec 2017 09:44:57 GMT</pubDate>
            <atom:updated>2017-12-21T16:26:15.522Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9SWZmy4Ct4XnSAtjPmuejw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/QdEn9s5Q_4w?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Abigail Keenan</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Kotlin has the capability to be the Pied Piper for your creativity. For me personally, <a href="https://kotlinlang.org/docs/reference/extensions.html">Extensions</a> and <a href="https://kotlinlang.org/docs/reference/lambdas.html">Higher Order Functions</a> are the features that’s made programming in Kotlin delightful. It’s made me think about problems differently.</p><p><a href="https://kotlinlang.org/docs/reference/extensions.html">Extensions</a> allows us to extend a class, without the overhead of initializing constructors, or implementing methods. It keeps us focused on building custom function(s) on top of the class of our choice, altogether eliminating the need for Utility classes.</p><p>For e.g., Suppose we have a variable where names of our users are stored as comma separated values of first and last names. How can we use Extensions so that String variable(s) will be able to fetch our users?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/52190ca8b24c31f23430b0280aa884e4/href">https://medium.com/media/52190ca8b24c31f23430b0280aa884e4/href</a></iframe><p><strong><em>getUser()</em></strong> is the Extension function. The function name’s prefix tells us that we’re extending the String object allowing us to use the String’s split method inside our function body. Additionally, all String objects are allowed to call this method.</p><p><a href="https://kotlinlang.org/docs/reference/lambdas.html">Higher Order Functions</a> allows us to write a function that takes a function as a parameter. This makes writing *insert logic here* easy, especially useful when defining a repetitive pattern which used to be cumbersome (👋 Interfaces!).</p><p>For e.g., An Employee is to be evaluated to get a promotion. The employee will be evaluated by the HR department and his/her manager. Evaluators will have their own evaluation scores and criteria with a common threshold to determine if the employee is promoted or not.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b859351572509932de967f4f11d7d224/href">https://medium.com/media/b859351572509932de967f4f11d7d224/href</a></iframe><p><strong><em>isPromotableEmployee()</em></strong> is not bothered with the scoring implementation since it has delegated the responsibility to <strong><em>evaluate</em></strong>. However it is focused on comparing the evaluation score with a threshold allowing the function to nominate an employee as promotable.</p><p>We can further improve this by introducing Extensions; Extension Functions and <a href="https://kotlinlang.org/docs/reference/lambdas.html#function-literals-with-receiver">Function Literals with Receivers</a>. Functions Literals with Receivers are the same as Extension Functions with a key distinction on their level of abstraction. An Extension Function requires you to have a concrete definition of the function, while the latter lets you define a Higher Order function for the class you’re building upon.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/24ef9686bd991e0a14b2882e9a48e3e6/href">https://medium.com/media/24ef9686bd991e0a14b2882e9a48e3e6/href</a></iframe><p>The code feels fluid now. You can clearly see evaluators deciding whether employee is promotable by scoring them across different criteria.</p><p>Consequently higher order functions lets you write code avoiding any inherent dependency, i.e., i<a href="https://martinfowler.com/bliki/InversionOfControl.html">nversion of control</a>.</p><p>Getting to the meat of our discussion; the <a href="https://developer.android.com/training/basics/data-storage/databases.html">Database API</a> on Android is verbose especially the <a href="https://developer.android.com/training/basics/data-storage/databases.html#ReadDbRow">Cursor</a>. If you think about it we are essentially doing the same thing while querying for data, with minor differences.</p><p>Each database transaction follows these steps:</p><ol><li>Initialize your database instance,</li><li>Write your database query,</li><li>Fetch the corresponding Cursor,</li><li>Iterate over Cursor; while checking the size of the Cursor,</li><li>Mapping information from the Cursor onto an Object,</li><li>Closing the Cursor, and</li><li>Closing the database.</li></ol><p>Only steps 2 and 5 will have varying implementations throughout the application. The big question now is can we write a general purpose, reusable function with Kotlin to solve this problem?</p><p>Let’s see what <a href="https://kotlinlang.org/api/latest/jvm/stdlib/index.html">Kotlin’s standard library</a> has to offer in <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/use.html">use</a>, which is an extension function for the <a href="http://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html">Closable</a> interface. <strong><em>use</em></strong> takes a higher order function as a parameter to *insert logic* while ensuring that the Closable object closes and the method returns our desired result.</p><p>Coincidentally both the <a href="https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html">SQLiteDatabase</a> and <a href="https://developer.android.com/reference/android/database/Cursor.html">Cursor</a> are Closable implementations. With <strong><em>use</em></strong><em> </em>our database queries could look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e349e7721edada60493e53e1e18c2948/href">https://medium.com/media/e349e7721edada60493e53e1e18c2948/href</a></iframe><p>We don’t have to worry about closing neither the Cursor nor the Database; <strong><em>use</em></strong> does that for us. In contrast, there’s this weird <strong><em>it</em> </strong>in our code now. This <strong><em>it</em></strong> refers to the parameter inside our Higher Order Function. When we first <strong><em>use</em></strong> the database, <strong><em>it</em></strong> refers to the database; when we <strong><em>use</em></strong> the cursor, <strong><em>it</em></strong> refers to the cursor. However why use <strong><em>it</em></strong> when we can add in receivers?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0838c4b4fd5a8326027c002fe76e2306/href">https://medium.com/media/0838c4b4fd5a8326027c002fe76e2306/href</a></iframe><p>You really start to appreciate the impact receivers have on code fluidity. Gone are the <strong><em>it</em></strong>s; method access is now frictionless.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*5SrwVwY9B337Fo12gxlosA.gif" /></figure><p>Our focus now is to create an abstract implementation of what we just did. Let’s start with step 5; Mapping information from the Cursor onto an Object. You would expect to either have an Object or a List of Objects returned to you.</p><p>The mapping logic will be a Higher Order Function here, leaving only the iteration logic for the Cursor to be defined.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7fb623d17b602102151352a25daa8657/href">https://medium.com/media/7fb623d17b602102151352a25daa8657/href</a></iframe><p>The function is <a href="https://kotlinlang.org/docs/reference/inline-functions.html">inlined</a> to ease the impact of memory allocations resulting from the use of Higher Order Functions.</p><p>Moving onto step 2; Write your database query, which is a fairly easy task.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/851414aa694bbf85a8b616544cc0eb4a/href">https://medium.com/media/851414aa694bbf85a8b616544cc0eb4a/href</a></iframe><p>This implementation is complementary to step 5; it gives you your Object or Objects.</p><p>Finally, our database calls are filtered from all the noise. Altogether we have a focused and fluid syntax now.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/13ab1a40ce420e8940d4e4b009f85229/href">https://medium.com/media/13ab1a40ce420e8940d4e4b009f85229/href</a></iframe><p>This was just a small demonstration of how you can leverage Kotlin to enrich your development experience. It’s made me rekindle my love for Android and much more.</p><p>Get out there and <em>Kotlin all things </em>😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7561b48a7f26" width="1" height="1" alt=""><hr><p><a href="https://medium.com/android-developers-nepal-mdn/reducing-noise-in-your-database-operations-with-kotlin-on-android-7561b48a7f26">Reducing noise in your database operations with Kotlin on Android</a> was originally published in <a href="https://medium.com/android-developers-nepal-mdn">Android Developers Nepal — MDN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[1st Android meetup —The beginning of a wonderful journey]]></title>
            <link>https://medium.com/android-developers-nepal-mdn/1st-android-meetup-the-beginning-of-a-wonderful-journey-2cc759e4070f?source=rss----120de779ce7d---4</link>
            <guid isPermaLink="false">https://medium.com/p/2cc759e4070f</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[meetup]]></category>
            <category><![CDATA[community]]></category>
            <dc:creator><![CDATA[Umesh Basnet]]></dc:creator>
            <pubDate>Sat, 14 Oct 2017 12:47:39 GMT</pubDate>
            <atom:updated>2017-10-14T13:57:07.576Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pLWRronTOw1itZKF-OGx5Q.png" /></figure><p>Human beings are social animals. We need each other to survive. Same is true for things like study and work. Consequently this is where most communities thrive. Sharing knowledge and supporting each other will never fail. With these things in mind some of the developers came together for the 1st Android Meetup as the first step towards this long journey.</p><p>During the meetup the participants recalled their humble beginnings into the platform. They shared challenges they faced along the way; everyone had unique experiences and knowledge to impart. The participants agreed on the lack of an Android community; expressing the potential for growth in collaboration if present. The meetup ended on a consensus of forming an Android community being a necessity and anyone contributing to its growth in any way, shape or form is most welcome.</p><p>Here’s what the participants had to say about the meetup:</p><blockquote>It was great to see people enthusiastic about the meetup and sharing sentiments regarding forming a community around Android. I am hoping the steps we planned during our meetup will encourage people the join the community and be a part of this movement. — <a href="https://medium.com/u/34f272d67281">Rakeeb Rajbhandari</a></blockquote><blockquote>This meetup was a new experience for me. It was informative and helpful. I had a great time sharing my experiences and it felt good to listening to the experiences from fellow developers as well.</blockquote><blockquote>Since this was the first meetup we were short in number; just the four of us, regardless it was a chance to for fellowship. We had a lot of to talk about and I felt comfortable while having the conversation. We discussed on forming a community in Nepal so that we can share our work and in the process help guide each other out.</blockquote><blockquote>Besides the formal meet up we had some casual talks and of course cracked some jokes and took few pictures together. It’s great that <a href="https://medium.com/u/34f272d67281">Rakeeb</a> dai has taken this initiative and is working on this, Hats off to him and lets make an effort from all of us to form and run this community. — <strong><em>Rishab Maharjan</em></strong></blockquote><blockquote>Loved spending some time discussing all things related to Android with fellow Android developers.. hope the community grows even larger :) — <strong><em>Prajwal Maharjan</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7I5Np_z--UF6mN_-c_efmA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iGzWp_GR6_e4iYC4XgUcyQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8RCtSupLhG4GVzVQA5Q90w.jpeg" /><figcaption>Glimpses of 1st Android meetup from Android Developers Nepal (AndDevNepal)</figcaption></figure><p>We plan to take the following course of action to bring the Android community together —</p><ul><li>Invite people onto <a href="https://join.slack.com/t/androiddev-np/shared_invite/enQtMjE2NTgxMDU4OTMzLTgyMTI5NDBmYTY5NjA1NjlmNmE2OTg0NjZiNWRiZTA5M2FiM2Q1OGZkMDNkNmY0NzBkNTUyY2NkYTc2OWFlMDk">Slack</a> where we can discuss on all things Android. We have dedicated channels for sharing links, resources and other Android magic ;)</li></ul><p><a href="https://androiddev-np.slack.com/">Slack</a></p><ul><li>Start a <a href="https://medium.com/android-developers-nepal-mdn">publication in the medium (Android Developers Nepal)</a> and post stories from the Android community here. Do follow and collaborate with us.</li></ul><p><a href="https://medium.com/android-developers-nepal-mdn">Android Developers Nepal — MDN</a></p><ul><li>Create a <a href="https://github.com/AndDevNepal">Github organization Android Developers Nepal</a> and start open source projects powered by the community for the community!</li></ul><p><a href="https://github.com/AndDevNepal">Android Developers Nepal - MDN</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*GCxdtNJtcQDl2GVW_snvPQ.png" /><figcaption>Android Developers Nepal (AndDevNepal in short)</figcaption></figure><p>Android Developers Nepal (AndDevNepal in short) is the outcome of the meetup and is a sub division of the <a href="https://www.facebook.com/groups/258590104205293/">Mobile Developers Nepal </a>community which falls under the family tree of <a href="https://www.facebook.com/groups/officialdevelopersnepal/">Developers Nepal</a>.</p><h3>This is an open invitation to anyone and everyone to help AndDevNepal build a strong foundation by collaborating with us on <a href="https://join.slack.com/t/androiddev-np/shared_invite/enQtMjE2NTgxMDU4OTMzLTgyMTI5NDBmYTY5NjA1NjlmNmE2OTg0NjZiNWRiZTA5M2FiM2Q1OGZkMDNkNmY0NzBkNTUyY2NkYTc2OWFlMDk">Slack</a>, <a href="https://medium.com/android-developers-nepal-mdn">Medium</a>, or <a href="https://github.com/AndDevNepal">Github</a>.</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FAD-oCSoI9OQ%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DAD-oCSoI9OQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FAD-oCSoI9OQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1929b8e5ace8bf2893d896595bbed14b/href">https://medium.com/media/1929b8e5ace8bf2893d896595bbed14b/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cc759e4070f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/android-developers-nepal-mdn/1st-android-meetup-the-beginning-of-a-wonderful-journey-2cc759e4070f">1st Android meetup —The beginning of a wonderful journey</a> was originally published in <a href="https://medium.com/android-developers-nepal-mdn">Android Developers Nepal — MDN</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>