<?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 Eljo Prifti on Medium]]></title>
        <description><![CDATA[Stories by Eljo Prifti on Medium]]></description>
        <link>https://medium.com/@elioprifti?source=rss-b2f01f3e5c09------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*jjMA2KcQi7HIq0DeILvUjw.png</url>
            <title>Stories by Eljo Prifti on Medium</title>
            <link>https://medium.com/@elioprifti?source=rss-b2f01f3e5c09------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 18:30:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@elioprifti/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[Escrow pallet build on top of Substrate Framework]]></title>
            <link>https://medium.com/@elioprifti/escrow-pallet-build-on-top-of-substrate-framework-6f941c28b6fd?source=rss-b2f01f3e5c09------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f941c28b6fd</guid>
            <dc:creator><![CDATA[Eljo Prifti]]></dc:creator>
            <pubDate>Thu, 22 Sep 2022 19:34:55 GMT</pubDate>
            <atom:updated>2022-09-22T19:34:55.652Z</atom:updated>
            <content:encoded><![CDATA[<p>Before starting to describe the Escrow pallet I would like to give a short definition of what an Escrow is:</p><p>Escrow is <strong>a legal arrangement in which a third party temporarily holds money or property until a particular condition has been met</strong> (such as the fulfillment of a purchase agreement).</p><p>Both parties have to trust the third party entity but what happens if the trusted entity releases the money without the agreement of both parties?</p><p>What about if the third-party entity does not release all the funds?</p><p>There is room for corruption and manipulation.</p><p>Blockchain technology is really good when it’s about to get rid of third-party entities and trust no one, except the system.</p><p>Using Blockchain we can trust the decentralized systems instead of a third party.</p><p>From this, I had the idea to build an Escrow pallet on Substrate Framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QsVbvceNWiisvScVUXMwow.png" /></figure><p>I would like to explain my solution by giving a real example.</p><p>A developer wants to fix/develop a bug/feature. He requested some funds and his proposal got approved. Both of the parties (for ex: the web3 community and contributor) sign an Escrow contract by defining the Web3 community address, the contributor address, the amount, the expiry date, and “take action days”. “Take action days” would be some supplement time after the contract has ended for the Web3 to test/check if the bug/feature has been delivered correctly. Once the contract is signed the Web3 funds will be locked into another address. During the take action days Web3 can decide to: 1-Send the funds manually to the contributor 2-Withdraw the funds because nothing was delivered 3-Do not take any action during the “take action days” and when these additive days are expired the contributor can withdraw the funds by himself. (This option would reduce the releasing fund steps by giving additional work to the contributor)</p><p>In the future, we may have several senders instead of one and we can also do that during “take action days” if 51% of senders do not want to release funding then the funds can be withdrawn.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f941c28b6fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flexbox for Android Developers]]></title>
            <link>https://medium.com/android-news/flexbox-for-android-developers-89ccbf9bfb36?source=rss-b2f01f3e5c09------2</link>
            <guid isPermaLink="false">https://medium.com/p/89ccbf9bfb36</guid>
            <category><![CDATA[austria]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[constraintlayout]]></category>
            <dc:creator><![CDATA[Eljo Prifti]]></dc:creator>
            <pubDate>Wed, 15 May 2019 19:59:47 GMT</pubDate>
            <atom:updated>2019-06-25T19:26:10.941Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9HqAbriyA5NJn9CcJaXPdA.png" /></figure><p>Hello friends, it’s been a while since the last time I wrote here. I have actually been waiting for Google I/O event to be held so that I would have a lot to write on.</p><p>Google ended its presentation on Thursday, May 9, and to be quite frankly I haven’t seen all of the videos from the event.</p><p>Lately, I have been putting my hands on React Native and I have been loving it. The thing that struck the most is how easily you could build views in React Native and how unfair is the world to Android developers, in that they have to put too much work in building a view. What made the process of building view easy in React Native was Flexbox. And of course, the immediate thought was “what a better place would be this world to live in if Android had Flexbox”.</p><p>Watching the videos from the conference I encountered the word “Flow”, and I realized that Flow has a lot of similar qualities with Flexbox.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*wqyL_0iRvDsgm8VwE8u2Mw.png" /></figure><p>Recently Google has released Flow beta version.</p><p>Being that we are gonna talk about ConstrantLayout, I’ve lately written an article about that.</p><p>Take a look over there because it is really interesting: <a href="https://medium.com/mindorks/constraint-layout-for-different-screen-sizes-247ff7b4d890"><strong>LINK</strong></a></p><p>Today we are talking about one of ConstraintLayout 2.0 beta1 features that Google released on this Google I/O.</p><p>Let&#39;s start by introducing some new terms, shall we?</p><p><strong>What is a Virtual Layout?</strong></p><p>Virtua Layout is a helper that would come in hand to do things that we would need to do manually, such as to set some constraints.</p><p><strong>What is Flow?</strong></p><p>Flow is a Virtual Layout that allows us to maintain a flat hierarchy on our views and it helps us to position widgets.</p><p>In other words, Flow is a Virtual Layout that will help us to automate some work.</p><p><strong>How to use Flow?</strong></p><p>First of all, we should import the library:</p><pre>implementation ‘com.android.support.constraint:constraint-layout:2.0.0-beta1’</pre><p>Let’s take a look at this example:</p><pre>&lt;android.support.constraint.helper.Flow<br> android:layout_width=”wrap_content”<br> android:layout_height=”wrap_content”<br> android:background=”#F8BA00&quot;<br> app:constraint_referenced_ids=”btn1, btn2, btn3&quot;<br> app:layout_constraintBottom_toBottomOf=”parent”<br> app:layout_constraintEnd_toEndOf=”parent”<br> app:layout_constraintStart_toStartOf=”parent”<br> app:layout_constraintTop_toTopOf=”parent”&gt;&lt;/android.support.constraint.helper.Flow&gt;</pre><p>If we look into it, it’s like a normal widget. It has a width, height, color as a background and all the constraints with parent view, so it is a familiar pattern. The only difference is this row:</p><blockquote>app:constraint_referenced_ids=”btn1, btn2, btn3&quot;</blockquote><p>It determines which IDs will be chained.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*nrrcGFkpAXuu6SicoUlTkg.gif" /></figure><p>What is new is the wrap behavior editor akin to flexbox layout where you know if you do not have the space before you can offer another space you come to anything else but now we will create an extra chain for you by default we are using the same type of chain for all the different chains but you can actually specify the front chain between your first chain and the rest of chains.</p><p>In the gif below we see the line:</p><blockquote>app:flow_wrapMode=&quot;aligned&quot;</blockquote><p>If the screen width is not enough a new row gets to build and the elements get set in the order that has been previously defined as referenced id.a</p><p>If we take a look in the gif above, there are devices with different screen sizes and notice how well the elements get positioned on the screen on their own.</p><p>If that’s not amazing, I don’t know what is.</p><p>If we were to chose :</p><blockquote>app:flow_wrapMode=”chain”</blockquote><p>Then the elements would get symmetrically positioned on the interface. (see image below)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*MBYfhgRSJKxltVIilrkSFA.png" /></figure><p>Imagine how long it would take us only to build the layout for different screen sizes to get to this.</p><p><strong>Is there a way to connect this button with other widgets?</strong></p><p>Yes, absolutely. All the buttons can be connected to other widgets via constraints without any problem.</p><p>In fact here is a code that does exactly this:</p><pre>&lt;TextView<br> android:id=”@+id/textView”<br> android:layout_width=”wrap_content”<br> android:layout_height=”wrap_content”<br> android:text=”Eljo Prifti”<br> app:layout_constraintBottom_toTopOf=”@+id/btn1&quot;<br> app:layout_constraintEnd_toStartOf=”@+id/btn3&quot;<br> app:layout_constraintHorizontal_bias=”0.117&quot;<br> app:layout_constraintStart_toStartOf=”@+id/btn1&quot;<br> app:layout_constraintTop_toTopOf=”parent”<br> app:layout_constraintVertical_bias=”0.938&quot; /&gt;</pre><p><strong>Conclusion:</strong></p><p>Even though the flow is still in beta version, being that it has been out there only a couple of days, I hope that very soon we will be able to have a more stable version of it. And when that moment arrives this feature will be a valuable asset in the hands of an Android Engineer that for sure would have to use.</p><h4>If you like this post and it was helpful, please click the clap 👏 button multiple times to show the support, thank you.</h4><p><a href="http://eljoprifti.me/"><strong>Hire me, I’m Cool</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89ccbf9bfb36" width="1" height="1" alt=""><hr><p><a href="https://medium.com/android-news/flexbox-for-android-developers-89ccbf9bfb36">Flexbox for Android Developers</a> was originally published in <a href="https://medium.com/android-news">AndroidPub</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Constraint layout for different screen sizes]]></title>
            <link>https://medium.com/mindorks/constraint-layout-for-different-screen-sizes-247ff7b4d890?source=rss-b2f01f3e5c09------2</link>
            <guid isPermaLink="false">https://medium.com/p/247ff7b4d890</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[constraintlayout]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Eljo Prifti]]></dc:creator>
            <pubDate>Fri, 08 Mar 2019 16:09:36 GMT</pubDate>
            <atom:updated>2019-06-25T19:27:14.121Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W36nFea4DECdSGDxurLR7A.jpeg" /></figure><p>In my beginnings, as Android Developer I have learned to use Linear Layouts and Relative Layouts. At the time I thought the Android Developers do not need anything else related to views because everything seemed perfect in my eyes. Next, to me, I had a colleague doing iOS. With the time I realized that he was faster at creating views when we had to build the same view. He was not a magician, so asked him to learn more. He explained to me that he uses Constraint layouts for views and he could use only one view for all different screen sizes. Instead, I had to create different views to make the view to look good on different screens. Sometime later I learned that Google I/O introduced C.L.</p><p><strong><em>How could we create a single view that can look good on different devices?</em></strong></p><p>Well, let’s start.</p><p>As first, we need to import constraint-layout at grandle:</p><pre>compile ‘com.android.support.constraint:constraint-layout:1.0.2’</pre><p>Also, we are going to use Guidelines.</p><p>At any view that I create, I add four guidelines at every corner of the view like the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-Ovl5cHK9zD7NA1-" /></figure><p>Then let’s add a button which gets constraint by our four guidelines.</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;android.support.constraint.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;&gt;<br><br>    &lt;android.support.constraint.Guideline<br>        android:id=&quot;@+id/guidelineTop&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:orientation=&quot;horizontal&quot;<br>        app:layout_constraintGuide_percent=&quot;0.02&quot;/&gt;<br><br>    &lt;android.support.constraint.Guideline<br>        android:id=&quot;@+id/guidelineLeft&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:orientation=&quot;vertical&quot;<br>        app:layout_constraintGuide_percent=&quot;0.02&quot;/&gt;<br><br>    &lt;android.support.constraint.Guideline<br>        android:id=&quot;@+id/guidelineRight&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:orientation=&quot;vertical&quot;<br>        app:layout_constraintGuide_percent=&quot;0.98&quot;/&gt;<br><br>    &lt;android.support.constraint.Guideline<br>        android:id=&quot;@+id/guidelineBottom&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:orientation=&quot;horizontal&quot;<br>        app:layout_constraintGuide_percent=&quot;0.98&quot;/&gt;<br><br>    &lt;Button<br>        android:id=&quot;@+id/btnHappy&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:layout_marginEnd=&quot;8dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        android:text=&quot;Happy Button :)&quot;<br>        app:layout_constraintBottom_toTopOf=&quot;@+id/guidelineBottom&quot;<br>        app:layout_constraintEnd_toStartOf=&quot;@+id/guidelineRight&quot;<br>        app:layout_constraintStart_toStartOf=&quot;@+id/guidelineLeft&quot;<br>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;<br><br>&lt;/android.support.constraint.ConstraintLayout&gt;</pre><p>The example above was a little taste.</p><p>Let’s create a login view:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KS90Kqki59KohsjY" /></figure><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;android.support.constraint.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;&gt;<br><br>    &lt;android.support.constraint.Guideline<br>        android:id=&quot;@+id/guidelineTop&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:orientation=&quot;horizontal&quot;<br>        app:layout_constraintGuide_percent=&quot;0.3&quot;/&gt;<br><br>    &lt;android.support.constraint.Guideline<br>        android:id=&quot;@+id/guidelineLeft&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:orientation=&quot;vertical&quot;<br>        app:layout_constraintGuide_percent=&quot;0.2&quot;/&gt;<br><br>    &lt;android.support.constraint.Guideline<br>        android:id=&quot;@+id/guidelineRight&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:orientation=&quot;vertical&quot;<br>        app:layout_constraintGuide_percent=&quot;0.8&quot;/&gt;<br><br>    &lt;android.support.constraint.Guideline<br>        android:id=&quot;@+id/guidelineBottom&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:orientation=&quot;horizontal&quot;<br>        app:layout_constraintGuide_percent=&quot;0.8&quot;/&gt;<br>    <br>    &lt;android.support.constraint.ConstraintLayout<br>        android:id=&quot;@+id/consraintLayoutLoginView&quot;<br>        android:layout_width=&quot;0dp&quot;<br>        android:layout_height=&quot;0dp&quot;<br>        android:layout_marginBottom=&quot;8dp&quot;<br>        android:layout_marginEnd=&quot;8dp&quot;<br>        android:layout_marginStart=&quot;8dp&quot;<br>        android:layout_marginTop=&quot;8dp&quot;<br>        app:layout_constraintBottom_toTopOf=&quot;@+id/guidelineBottom&quot;<br>        app:layout_constraintEnd_toStartOf=&quot;@+id/guidelineRight&quot;<br>        app:layout_constraintHorizontal_bias=&quot;0.0&quot;<br>        app:layout_constraintStart_toStartOf=&quot;@+id/guidelineLeft&quot;<br>        app:layout_constraintTop_toTopOf=&quot;@+id/guidelineTop&quot;<br>        app:layout_constraintVertical_bias=&quot;0.0&quot;&gt;<br>        <br>        &lt;android.support.constraint.Guideline<br>            android:id=&quot;@+id/guidelineLoginView1&quot;<br>            android:layout_width=&quot;wrap_content&quot;<br>            android:layout_height=&quot;wrap_content&quot;<br>            android:orientation=&quot;horizontal&quot;<br>            app:layout_constraintGuide_percent=&quot;0.2&quot; /&gt;<br><br>        &lt;android.support.constraint.Guideline<br>            android:id=&quot;@+id/guidelineLoginView2&quot;<br>            android:layout_width=&quot;wrap_content&quot;<br>            android:layout_height=&quot;wrap_content&quot;<br>            android:orientation=&quot;horizontal&quot;<br>            app:layout_constraintGuide_percent=&quot;0.4&quot; /&gt;<br><br>        &lt;android.support.constraint.Guideline<br>            android:id=&quot;@+id/guidelineLoginView3&quot;<br>            android:layout_width=&quot;wrap_content&quot;<br>            android:layout_height=&quot;wrap_content&quot;<br>            android:orientation=&quot;horizontal&quot;<br>            app:layout_constraintGuide_percent=&quot;0.6&quot; /&gt;<br><br>        &lt;android.support.constraint.Guideline<br>            android:id=&quot;@+id/guidelineLoginView4&quot;<br>            android:layout_width=&quot;wrap_content&quot;<br>            android:layout_height=&quot;wrap_content&quot;<br>            android:orientation=&quot;horizontal&quot;<br>            app:layout_constraintGuide_percent=&quot;0.9&quot; /&gt;<br><br>        &lt;EditText<br>            android:id=&quot;@+id/button7&quot;<br>            android:layout_width=&quot;0dp&quot;<br>            android:layout_height=&quot;0dp&quot;<br>            android:layout_marginEnd=&quot;8dp&quot;<br>            android:layout_marginStart=&quot;8dp&quot;<br>            android:hint=&quot;Username&quot;<br>      app:layout_constraintBottom_toTopOf=&quot;@+id/guidelineLoginView2&quot;<br>            app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>            app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>                 app:layout_constraintTop_toTopOf=&quot;@+id/guidelineLoginView1&quot; /&gt;<br><br>        &lt;EditText<br>            android:id=&quot;@+id/button9&quot;<br>            android:layout_width=&quot;0dp&quot;<br>            android:layout_height=&quot;0dp&quot;<br>            android:layout_marginEnd=&quot;8dp&quot;<br>            android:layout_marginStart=&quot;8dp&quot;<br>            android:hint=&quot;Password&quot;<br>              app:layout_constraintBottom_toTopOf=&quot;@+id/guidelineLoginView3&quot;<br>            app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>            app:layout_constraintHorizontal_bias=&quot;1.0&quot;<br>            app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>            app:layout_constraintTop_toTopOf=&quot;@+id/guidelineLoginView2&quot; /&gt;<br><br>        &lt;Button<br>            android:id=&quot;@+id/button10&quot;<br>            android:layout_width=&quot;0dp&quot;<br>            android:layout_height=&quot;0dp&quot;<br>            android:layout_marginBottom=&quot;8dp&quot;<br>            android:layout_marginEnd=&quot;8dp&quot;<br>            android:layout_marginStart=&quot;8dp&quot;<br>            android:layout_marginTop=&quot;8dp&quot;<br>            android:text=&quot;Login&quot;<br>            app:layout_constraintBottom_toTopOf=&quot;@+id/guidelineLoginView4&quot;<br>            app:layout_constraintEnd_toEndOf=&quot;parent&quot;<br>            app:layout_constraintStart_toStartOf=&quot;parent&quot;<br>            app:layout_constraintTop_toTopOf=&quot;@+id/guidelineLoginView3&quot; /&gt;<br><br>    &lt;/android.support.constraint.ConstraintLayout&gt;<br>&lt;/android.support.constraint.ConstraintLayout&gt;</pre><p>I have used the same techniques as in the earlier example. This time I have created a container for the login items and inside of it I have also added three horizontal guidelines.</p><p>This is how the login view looks on different screens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B9s1Tf_21LlocR1isIjhqA.png" /></figure><p><strong><em>Conclusion</em></strong></p><p>Constraint layout gives the possibility to build the views faster in Android and with the help of guidelines this feature becomes more powerful.</p><h4>If you like this post and it was helpful, please click the clap 👏 button multiple times to show the support, thank you.</h4><p><a href="http://eljoprifti.me/"><strong>Hire me, I’m Cool</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=247ff7b4d890" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mindorks/constraint-layout-for-different-screen-sizes-247ff7b4d890">Constraint layout for different screen sizes</a> was originally published in <a href="https://medium.com/mindorks">MindOrks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firebase remote config on Android]]></title>
            <link>https://proandroiddev.com/firebase-remote-config-on-android-55a27f578505?source=rss-b2f01f3e5c09------2</link>
            <guid isPermaLink="false">https://medium.com/p/55a27f578505</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[firebase-remote-config]]></category>
            <dc:creator><![CDATA[Eljo Prifti]]></dc:creator>
            <pubDate>Mon, 17 Sep 2018 08:29:26 GMT</pubDate>
            <atom:updated>2019-06-25T19:28:25.438Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*FWKlTH81wWQ39-5fWujA3g.png" /></figure><p>Firebase has become very necessary for Android developers today. All the features of the firebase are super. Real-time Databases, Cloud Messaging, Crashlytics are common in the Android world. One of the features I had never used from Firebase is Firebase Remote Config. At first, it seemed like a feature that is not necessary and without any value. During the development of a project, the question arises of how we can update the app without having to publish a new version of Playstore and making it possible for all users to have this change. In our case, we had to change the icons for Christmas and the color in some parts should be red. I said to the manager’s project that I read about a feature that firebase has for free(Project Managers love free services) but did not know if it was something ideal for the case since I had not received any feedback until I had to use it by myself.</p><p><strong><em>What does Firebase Remote Configuration do?</em></strong></p><p>Firebase Remote Config is a cloud service that lets you change the behavior and appearance of your app without requiring users to download an app update. When using Remote Config, you create in-app default values that control the behavior and appearance of your app. Then, you can later use the Firebase console or the Remote Config REST API to override in-app default values for all app users or for segments of your user base. Your app controls when updates are applied, and it can frequently check for updates and apply them with a negligible impact on performance.</p><p><strong><em>How to use it?</em></strong></p><p>First of all, we should import the library:</p><pre>compile ‘com.google.firebase:firebase-config:11.8.0’</pre><p>Or using Firebase Assistant, just click on the text: “<strong><em>Set Up Remote Config</em></strong>” and the above-mentioned library will be automatically added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*S3BpQu8yYdzN7cGuVK1QLQ.png" /></figure><p>Add the parameters in Firebase Console.</p><p>Once we’ve opened the Firebase console, we’ll see two text fields:</p><p><strong><em>“Parameter key”</em></strong> and <strong><em>“Default value”</em></strong> which we have to fill in and finally we should not forget to make “<strong><em>PUBLISH “</em></strong>to save our changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1bLcPyx5e6Iamla7ep5IsQ.png" /></figure><p>The Remote Config has recently added the option to save a value-by-key list by saving it to a json format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*CtofOqzY8ynfNjNbnz10Dg.png" /></figure><p><strong>Implement remote configuration in your app…</strong></p><p>Now it is the time to implement Firebase Remote configuration in our application. First we need to build a .xml file in the XML folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IU14LvYE_V8zSyiX9xGbqw.png" /></figure><p>If you look at it carefully the key is the same key that is in the console at the firebase. After we’ve set up everything we need to fetch the data from the firebase console.</p><p><em>The following class does this:</em></p><pre>public class FirebaseConfig {</pre><pre>FirebaseRemoteConfig mFirebaseRemoteConfig;</pre><pre>FirebaseRemoteConfigSettings configSettings;</pre><pre>long cacheExpiration = 43200;</pre><pre>String imgUrl = &quot;&quot;;</pre><pre>public FirebaseConfig() {</pre><pre>mFirebaseRemoteConfig = FirebaseRemoteConfig.<em>getInstance</em>();</pre><pre>configSettings = new FirebaseRemoteConfigSettings.Builder()</pre><pre>.setDeveloperModeEnabled(BuildConfig.<em>DEBUG</em>)</pre><pre>.build();</pre><pre>mFirebaseRemoteConfig.setConfigSettings(configSettings);</pre><pre>mFirebaseRemoteConfig.setDefaults(R.xml.<em>remote_config_defaults</em>);</pre><pre>}</pre><pre>public String fetchNewImage(Context context){</pre><pre>mFirebaseRemoteConfig.fetch(getCacheExpiration())</pre><pre>.addOnCompleteListener((Activity) context, new OnCompleteListener&lt;Void&gt;() {</pre><pre>@Override</pre><pre>public void onComplete(@NonNull Task&lt;Void&gt; task) {</pre><pre>// If is successful, activated fetched</pre><pre>if (task.isSuccessful()) {</pre><pre>mFirebaseRemoteConfig.activateFetched();</pre><pre>} else {</pre><pre>Log.<em>d</em>(&quot;&quot;,&quot;&quot;);</pre><pre>}</pre><pre>imgUrl = mFirebaseRemoteConfig.getString(&quot;new_image&quot;);</pre><pre>}</pre><pre>});</pre><pre>return imgUrl;</pre><pre>}</pre><pre>public long getCacheExpiration() {</pre><pre>// If is developer mode, cache expiration set to 0, in order to test</pre><pre>if (mFirebaseRemoteConfig.getInfo().getConfigSettings().isDeveloperModeEnabled()) {</pre><pre>cacheExpiration = 0;</pre><pre>}</pre><pre>return cacheExpiration;</pre><pre>}</pre><pre>}</pre><p>In case we want to fetch a new image we just need to change the URL in the Firebase Console.</p><p><strong><em>Conclusion</em></strong></p><p><em>“Remote config”</em> is very useful because we can make quick changes to the app without making an update on Playstore, I suggest to use it. We can also build mechanisms to make these types of changes in the app but I do not think we need to reinvent the wheel.</p><h4>If you like this post and it was helpful, please click the clap 👏 button multiple times to show the support, thank you.</h4><p><a href="https://medium.com/mindorks/constraint-layout-for-different-screen-sizes-247ff7b4d890">Constraint layout for different screen sizes</a></p><p><a href="http://eljoprifti.me/"><strong>Hire me, I’m Cool</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55a27f578505" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/firebase-remote-config-on-android-55a27f578505">Firebase remote config on Android</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[How I changed my mind to switch from Java to Kotlin]]></title>
            <link>https://medium.com/mindorks/how-i-changed-my-mind-to-switch-from-java-to-kotlin-b6ec8e58024d?source=rss-b2f01f3e5c09------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6ec8e58024d</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Eljo Prifti]]></dc:creator>
            <pubDate>Mon, 27 Aug 2018 17:35:35 GMT</pubDate>
            <atom:updated>2018-10-22T12:41:39.085Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/244/1*T2jPmlrn4KtMGF1wER8BVw.jpeg" /></figure><p>Hello to everyone. After several years as an Android developer, I decided to give my contribution by writing. This is my first post, so do not prejudge.</p><p>Long ago, Google stated that Kotlin would be the official language for Android, and they say that Java can convert 100% to Kotlin. All developers were enthusiastic about this. I did not agree because I thought as long as JAVA works well and the code could be converted to the Kotlin then why should we write our apps in the Kotlin?!</p><p>At that time I was skeptical and I continued with java. But today, I have another thought for the choice of Kotlin.</p><p>Here are some reasons why we shouldn’t write Java code anymore:</p><p>1. Less of code, so that means it is easier to read, maintain and modify</p><p>2. Kotlin is a very simple language to learn and has a simple syntax.</p><p>3. Kotlin provides null safety.</p><p>We all know that the main cause of our crash application is null pointer exceptions. Less crashes with Kotlin means that our applications will be of better quality.</p><p>4. Smart cast</p><p>In Java we have to manually convert variables. Kotlin compiler tracks your logic and auto-casts types if possible.</p><p>5. Model Objects</p><p>For building a model class in java we need to have constructors, get and set methods, making a class with many rows of code. In Kotlin, if we build a class model, just one line of code.</p><p>6. Removal of findByViewId Boilerplate</p><p>With Kotlin we don’t need to declare our object and then apply the “findViewById“ method. We can write the direct id of the widget. In this way we eliminate using a library such as butterknife.</p><p>7. The “when” expression</p><p>In Kotlin, the “when” expression replaces the switch statement, thereby making the code shorter.</p><p>Above I have written some of the reasons why we should write all our application in Kotlin.</p><p>Any feedback is welcome.</p><p><strong>If you would like to get in touch, ping me via </strong><a href="https://github.com/herou"><strong>Github</strong></a> or <a href="https://al.linkedin.com/in/elioprifti"><strong>LinkedIn</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6ec8e58024d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mindorks/how-i-changed-my-mind-to-switch-from-java-to-kotlin-b6ec8e58024d">How I changed my mind to switch from Java to Kotlin</a> was originally published in <a href="https://medium.com/mindorks">MindOrks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>