<?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[MAKERS channel - Medium]]></title>
        <description><![CDATA[Stories from the @wearemakery team #development #design #growth - Medium]]></description>
        <link>https://medium.com/we-are-makery?source=rss----b575a2d874fb---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>MAKERS channel - Medium</title>
            <link>https://medium.com/we-are-makery?source=rss----b575a2d874fb---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 07:35:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/we-are-makery" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Eliminate dead code with Kotlin 1.1.4]]></title>
            <link>https://medium.com/we-are-makery/eliminate-dead-code-with-kotlin-1-1-4-4356ffe9c730?source=rss----b575a2d874fb---4</link>
            <guid isPermaLink="false">https://medium.com/p/4356ffe9c730</guid>
            <category><![CDATA[google-developer-group]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[hellokotlin]]></category>
            <dc:creator><![CDATA[Makery]]></dc:creator>
            <pubDate>Tue, 29 Aug 2017 11:14:06 GMT</pubDate>
            <atom:updated>2017-08-29T11:13:37.105Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5pzGSqzIrBhS54mrtic1g.jpeg" /></figure><h4>by: <a href="https://twitter.com/gyula_voros">Gyula Vörös</a> The post first appeared ✍🏼 on the <a href="https://www.kotlindevelopment.com/eliminate-dead-code-kotlin/">Kotlin Development</a> blog</h4><h3>Context</h3><p>Recently JetBrains released <a href="https://blog.jetbrains.com/kotlin/2017/08/kotlin-1-1-4-is-out/">Kotlin 1.1.4</a> and the JavaScript compiler/tooling got some exciting new features. One of them is a new Gradle plugin called kotlin-dce-js (dce stands for dead code elimination).</p><p>According to the <a href="https://kotlinlang.org/docs/reference/javascript-dce.html">documentation</a>:</p><blockquote>This tool allows to strip out unused properties, functions and classes from the generated JS. There are several ways you get unused declarations:</blockquote><blockquote>- Functions can be inlined and never get called directly (which happens always except for few situations).</blockquote><blockquote>- You are using a shared library which provides much more functions than you actually need. For example, standard library (kotlin.js) contains functions for manipulating lists, arrays, char sequences, adapters for DOM, etc, which together gives about 1.3 mb file. A simple “Hello, world” application only requires console routines, which is only few kilobytes for the entire file.</blockquote><p>Not long ago, I gave a talk about Kotlin and how to use it for web development. For demo purposes, I’ve implemented an example full-stack TodoMVC application:<a href="https://github.com/gyulavoros/kotlin-todomvc"> https://github.com/gyulavoros/kotlin-todomvc</a>.</p><p>One of the first questions from the audience were: <em>“What is the footprint of using Kotlin in the browser?”, “Would you recommend to use Kotlin for real-world projects?”</em> The answers back then were: <em>“Quite heavy.”</em> and <em>“Maybe?”</em> After reading about the new code elimination tool I was curious about its performance, so I took it for a test drive.</p><p>If you are not familiar with Kotlin.js, I recommend that you take a look at the following resources before you continue reading:</p><ul><li><a href="https://kotlinlang.org/docs/reference/js-overview.html">https://kotlinlang.org/docs/reference/js-overview.html</a></li><li><a href="https://kotlinlang.org/docs/tutorials/javascript/kotlin-to-javascript/kotlin-to-javascript.html">https://kotlinlang.org/docs/tutorials/javascript/kotlin-to-javascript/kotlin-to-javascript.html</a></li><li><a href="https://kotlinlang.org/docs/tutorials/javascript/getting-started-gradle/getting-started-with-gradle.html">https://kotlinlang.org/docs/tutorials/javascript/getting-started-gradle/getting-started-with-gradle.html</a></li></ul><h3>Setup</h3><p>Integrating the DCE tool is super easy. You simply add a new plugin to the Gradle build script:</p><pre>apply {<br>  plugin(&quot;kotlin2js&quot;)<br>  plugin(&quot;org.jetbrains.kotlin.frontend&quot;)<br>  plugin(&quot;kotlin-dce-js&quot;)<br>}</pre><p>Unfortunately for now, the org.jetbrains.kotlin.frontend and kotlin-dce-js plugins don&#39;t play nice together, so I had to customize the webpack configuration. The issue is that by default, webpack will resolve kotlin and kotlinx-html-js dependencies from the node_modules folder, so the final bundle won&#39;t include the minified resources. I added a new dce.js config file to the webpack.config.d folder with the following content:</p><pre><strong>var</strong> path = require(&quot;path&quot;);<br>config.resolve.modules.unshift(path.resolve(&quot;./js/min&quot;));</pre><p>Making sure that webpack will pick up files from the js/min folder first, where kotlin-dce-js is generating its output.</p><h3>Results</h3><p>The original version of the TodoMVC app weighted around 2 megabytes. After eliminating dead code and minifying the bundle the app now is 208 kilobytes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gzZrRI1PTOUWV2tP-2vgow.png" /></figure><p><a href="https://twitter.com/intent/tweet?url=https://www.kotlindevelopment.com/?p=1104&amp;text=After%20gzip%20compression%2C%20the%20final%20size%20is%2047%20KB%2C%20which%20is%20quite%20reasonable.&amp;via=HelloKotlin&amp;related=HelloKotlin">After gzip compression, the final size is 47 KB, which is quite reasonable.</a></p><p>I’m happy to see how Kotlin is evolving to be a viable alternative for targeting JavaScript. I very much like what Scala.js became over the years, it would be nice to see a just as live ecosystem around Kotlin.js one day.</p><p>Check out <a href="https://www.kotlindevelopment.com/"><strong>Kotlin Development.com</strong></a> for more interesting stories and code snippets written by real Kotlin devs from all around the globe! <em>#hellokotlin</em></p><p>🌐 <a href="https://www.kotlindevelopment.com/">www.kotlindevelopment.com</a> <br>🐤 Twitter: <a href="https://www.twitter.com/hellokotlin">@hellokotlin </a><br>📧 hello@kotlindevelopment.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4356ffe9c730" width="1" height="1" alt=""><hr><p><a href="https://medium.com/we-are-makery/eliminate-dead-code-with-kotlin-1-1-4-4356ffe9c730">Eliminate dead code with Kotlin 1.1.4</a> was originally published in <a href="https://medium.com/we-are-makery">MAKERS channel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling search with RxJava2 and Kotlin]]></title>
            <link>https://medium.com/we-are-makery/handling-search-with-rxjava2-and-kotlin-5ca91d0001a4?source=rss----b575a2d874fb---4</link>
            <guid isPermaLink="false">https://medium.com/p/5ca91d0001a4</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[hellokotlin]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[rxjava]]></category>
            <dc:creator><![CDATA[Makery]]></dc:creator>
            <pubDate>Wed, 23 Aug 2017 15:19:45 GMT</pubDate>
            <atom:updated>2017-08-29T11:11:56.512Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nCrl3O_a5jccxdmYHsGfLw.png" /></figure><h4>by: <a href="https://medium.com/u/58bbf10fde14">Somodi Karoly Akos</a> The post first appeared ✍🏼 on the <a href="https://www.kotlindevelopment.com/handling-search-rxjava2-kotlin/">Kotlin Development</a> blog</h4><p>Presume we have to solve search in an Android app.We just need an EditText and query data based on the input, right? Sounds easy…</p><p>Let’s take a look at how would we implement with Kotlin and Reactive Extensions!</p><h3>Basic solution</h3><p>Before we jump in and start coding, let’s make sure all the necessary libraries are added to the Gradle file. Also, we’ll add a simple EditText to the activity layout, and subscribe to the textChanges observable. Up until this point, this looks like the simplest task ever.</p><p><strong>build.gradle(module.app)</strong></p><pre><em>// RxJava2</em><br>compile &quot;io.reactivex.rxjava2:rxjava:2.1.2&quot;<br>compile &quot;io.reactivex.rxjava2:rxandroid:2.0.1&quot;<br><em>// RxBindig</em><br>compile &quot;com.jakewharton.rxbinding2:rxbinding:2.0.0&quot;<br>compile &quot;com.jakewharton.rxbinding2:rxbinding-kotlin:2.0.0&quot;</pre><p><strong>activity_layout.xml</strong></p><pre>&lt;android.support.v7.widget.AppCompatEditText<br>  android:id=&quot;@+id/mainSearchText&quot;<br>  android:layout_width=&quot;match_parent&quot;<br>  android:layout_height=&quot;match_parent&quot;/&gt;</pre><p><strong>onCreate subscription</strong></p><pre>RxTextView.textChanges(mainSearchText)<br>  .subscribe(<br>    { Log.d(&quot;MainActivity&quot;, &quot;$it&quot;) },<br>    { Log.e(&quot;MainActivity&quot;, &quot;$it&quot;) }<br>  )</pre><h3>Kotlin ❤ You</h3><p>Why are we using the RxTextView utility class to observe the text change events? Can’t we apply some Kotlin magic to make our life easier? Maybe Jake Wharton asked the same question when he made the RxBinding Kotlin module. It adds extension functions to the view types, making it easier for the IDE to suggest possible functions.</p><pre>mainSearchText  <br>  .textChanges()<br>  .subscribe({<br>    Log.d(&quot;MainActivity&quot;, it.toString())<br>  }, { <br>    Log.e(&quot;MainActivity&quot;, it.toString())<br>  })</pre><p>One can easily see how gorgeous the whole stream is without the anonymous classes, thanks to Kotlin language features and lambda syntax. Less code means less time spent on maintenance.</p><h3>Let’s upgrade the UI</h3><p>We’ll add a couple of shiny and good looking features to our layout. Add two drawables into the EditText, configure the keyboard to display a search icon, add a hint inside the input field, and a progress bar above the content. It’s super important to indicate progress, because without these UI feedback, the users wouldn’t know that they need to be patient.</p><p><strong>Extended EditText</strong></p><pre>&lt;android.support.v7.widget.AppCompatEditText  <br>  android:id=&quot;@+id/mainSearchText&quot;<br>  android:layout_width=&quot;match_parent&quot;<br>  android:layout_height=&quot;match_parent&quot;<br>  android:layout_marginEnd=&quot;16dp&quot;<br>  android:background=&quot;@android:color/transparent&quot;<br>  android:drawableEnd=&quot;@drawable/main_close_white_24dp&quot;<br>  android:drawableStart=&quot;@drawable/main_search_white_24dp&quot;<br>  android:hint=&quot;@string/main_search_hint&quot;<br>  android:imeOptions=&quot;actionSearch&quot;<br>  android:inputType=&quot;text&quot;<br>  android:lines=&quot;1&quot;<br>  android:maxLines=&quot;1&quot;/&gt;</pre><p><strong>Content body</strong></p><pre>&lt;FrameLayout  <br>  android:layout_width=&quot;match_parent&quot;<br>  android:layout_height=&quot;match_parent&quot;&gt;</pre><pre>  &lt;TextView<br>    android:id=&quot;@+id/mainContent&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;wrap_content&quot;<br>    android:layout_gravity=&quot;center&quot;<br>    android:gravity=&quot;center&quot;<br>    android:textColor=&quot;@color/colorAccent&quot;<br>    android:textSize=&quot;24sp&quot;<br>    android:textStyle=&quot;bold&quot;/&gt;</pre><pre>  &lt;ProgressBar<br>    android:id=&quot;@+id/mainProgressbar&quot;<br>    android:layout_width=&quot;96dp&quot;<br>    android:layout_height=&quot;96dp&quot;<br>    android:layout_gravity=&quot;center&quot;<br>    android:indeterminate=&quot;true&quot;<br>    android:visibility=&quot;gone&quot;/&gt;<br>&lt;/FrameLayout&gt;</pre><p>As an extra, let’s add an extension function to the EditText which will handle the onTouch event of the drawable on the right, so we can clear our input based on a touch of the right drawable if it is clicked.</p><p><strong>Extension function for EditText</strong></p><pre><strong>fun</strong> AppCompatEditText.<strong>setRightDrawableOnTouchListener</strong>(func: <strong>AppCompatEditText</strong>.() -&gt; Unit) {<br>  setOnTouchListener { _, event -&gt;<br>    <strong>var</strong> consumed = false<br>    <strong>if</strong> (event.action == MotionEvent.ACTION_UP) {<br>      <strong>val</strong> drawable = compoundDrawables[2]<br>      <strong>if</strong> (event.rawX &gt;= (right - drawable.bounds.width())) {<br>        func()<br>        consumed = true<br>      }<br>    }<br>    consumed<br>  }<br>}</pre><p><strong>Handling the ‘clear’ touch event</strong></p><pre>mainSearchText.setRightDrawableOnTouchListener {  <br>  text.clear()<br>}</pre><p><strong>To the internet and beyond</strong></p><p>Until now we did nothing of the extreme, but here comes true magic. Let’s connect our search EditText to a query service — it can be anything from a database to a server, depending on the requirements.</p><pre>.flatMap { searchService.search(it).subscribeOn(Schedulers.io()) }<br>  .observeOn(AndroidSchedulers.mainThread())</pre><p>We’re doing work on the IO thread as specified by subscribeOn, but at the end of the day we need to mutate the state of views based on the results. This is what the observeOn method specifies, we select the thread which will deal with the subscription and the side effects.</p><p>Showing that the app is working in the background is always a good idea, so we’re displaying a progress bar until our work is finished, with the doOnNext and doOnEach functions.</p><p><strong>before </strong>flatMap</p><pre>.doOnNext {<br>    mainProgressbar.visibility = View.VISIBLE<br>    mainContent.visibility = View.GONE<br>  }</pre><p><strong>after </strong>observeOn</p><pre>.doOnEach {<br>    mainProgressbar.visibility = View.GONE<br>    mainContent.visibility = View.VISIBLE<br>  }</pre><p>As a finishing touch, we’ll add an extra line to our subscription mainContent.text = it.text and the result will be displayed on the UI. Beautiful, isn&#39;t it?</p><h3>Where we are going, we don’t need error handling</h3><p>If something can go wrong, it will — a good developer always keeps an eye out for possible errors.</p><p>We handled visibility in doOnEach, so no matter if the stream throws an exception, or finishes correctly, the progress bar will be hidden, and the content will be visible.</p><p>Every time something subscribes to the EditText, the content will be emitted immediately. To avoid this behavior, simply skip the first element:</p><pre>.skip(1)</pre><p>If you look at the server/database log, you will see that we are doing a query each time the user hits a character, meaning we’re burning CPU and network resources when we wouldn’t have to. Add a little debounce timer between doOnNext and flatMap to avoid this.</p><pre>.debounce(800, TimeUnit.MILLISECONDS)</pre><p>Moving on to the query, what if it fails? What if our service can’t process the search phrase? onError will be triggered, making the app unsubscribe from textChanges(), and the EditText will no longer be emitting anything. Sounds bad, right? Just because a request is not finished properly, I don&#39;t want to lose my UI logic inside my activity. We’ll inform our users about errors with doOnError, and use theretry to resubscribe to the textChanges observable.</p><pre>.doOnError {<br>    Snackbar.make(main_coordinator, &quot;Error while searching&quot;, Snackbar.LENGTH_SHORT).show()<br>  }<br>  .retry()</pre><h3>RxBinding knowledge</h3><p>If we’ve read the documentations before implementing anything — what we always do before starting to write code — we would saw the warning for the textChange event:</p><blockquote>Create an observable of character sequences for text changes on View<br>Warning: Values emitted by this observable are mutable and owned by the host</blockquote><p>That means every value passed down the stream can be changed by the system if the value is delayed or debounced on an another thread. Which we definitely do, so to avoid mutability simply map the value to a new object after skip</p><pre>.map { it.toString() }</pre><h3>Final code</h3><p>See the final version here:</p><pre>searchSubscription = mainSearchText<br>  .textChanges()<br>  .skip(1)<br>  .map { it.toString() }<br>  .doOnNext {<br>    mainProgressbar.visibility = View.VISIBLE<br>    mainContent.visibility = View.GONE<br>  }<br>  .debounce(800, TimeUnit.MILLISECONDS)<br>  .flatMap {<br>    <strong>if</strong> (it.isNotBlank()) {<br>      searchService.search(it).subscribeOn(Schedulers.io())<br>    } <strong>else</strong> {<br>      Observable.just(SearchResult.empty())<br>    }<br>  }<br>  .observeOn(AndroidSchedulers.mainThread())<br>  .doOnEach {<br>    mainProgressbar.visibility = View.GONE<br>    mainContent.visibility = View.VISIBLE<br>  }<br>  .doOnError { Snackbar.make(main_coordinator, &quot;Error while searching&quot;, Snackbar.LENGTH_SHORT).show() }<br>  .retry()<br>  .subscribe({<br>    mainContent.text = it.text<br>    Log.d(&quot;MainActivity&quot;, it.text)<br>  }, { <br>    Log.e(&quot;MainActivity&quot;, it.toString())<br>  })</pre><p>Quite a journey, right? We avoided a couple of harmful bugs in our code and solved plenty of time-consuming mistakes. I hope it helped you.</p><p>Check out <a href="https://www.kotlindevelopment.com/"><strong>Kotlin Development.com</strong></a> for more interesting stories and code snippets written by real Kotlin devs from all around the globe! <em>#hellokotlin</em></p><p>🌐 <a href="https://www.kotlindevelopment.com/">www.kotlindevelopment.com</a> <br>🐤 Twitter: <a href="https://www.twitter.com/hellokotlin">@hellokotlin </a><br>📧 hello@kotlindevelopment.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ca91d0001a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/we-are-makery/handling-search-with-rxjava2-and-kotlin-5ca91d0001a4">Handling search with RxJava2 and Kotlin</a> was originally published in <a href="https://medium.com/we-are-makery">MAKERS channel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Anko Layouts DSL is better than XML layouts]]></title>
            <link>https://medium.com/we-are-makery/why-anko-layouts-dsl-is-better-than-xml-layouts-63f76ef7d25c?source=rss----b575a2d874fb---4</link>
            <guid isPermaLink="false">https://medium.com/p/63f76ef7d25c</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[hellokotlin]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Makery]]></dc:creator>
            <pubDate>Tue, 15 Aug 2017 09:58:37 GMT</pubDate>
            <atom:updated>2017-08-15T09:58:25.158Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vVXicFhmOOyYASuzkM570w.jpeg" /></figure><h4>by: <a href="https://medium.com/u/c85b68565548">Tokaji Peti</a> The post first appeared ✍🏼 on the <a href="https://www.kotlindevelopment.com/why-anko-layouts-dsl-better-xml/">Kotlin Development</a> blog</h4><h3>Introduction</h3><p>In the <a href="https://medium.com/we-are-makery/why-every-android-developer-should-use-anko-f6a816cf6dea">previous post</a>, you got to know the <a href="https://www.kotlinresources.com/library/anko/">Anko</a> Android library and its first module, Commons. This time we will take a closer look at another topic: <strong>Anko Layouts DSL</strong>.</p><h3>Basics</h3><p>In Android development, there are two common ways for building UI. First option is the drag-and-drop UI builder in Android Studio (the design tab), and while it is a great tool for assembling a basic layout, it doesn’t work that good for more complicated stuff — the boilerplate code it generates is difficult to maintain.</p><p>Second, you can build the layout in an XML file by hand. With this approach you have full control, but on the other hand you need to do everything on your own, nothing comes out of the the box. There is a Preview window next to the XML code where it renders the layout on the fly.</p><p><strong>Anko Layouts DSL</strong> is very similar to XML but you can stick with pure Kotlin. Don’t need to switch between languages, context and place, making layout building a breeze.</p><h3>DSL Hello world sample</h3><pre>verticalLayout {<br>  <strong>val</strong> name = editText()<br>  button(&quot;Say Hello&quot;) {<br>    onClick { toast(&quot;Hello, ${name.text}!&quot;) }<br>  }<br>}</pre><h4><strong>Let’s see the benefits</strong></h4><ul><li><strong>Forget</strong> findViewById()</li><li>No more need for one of the most used lines of code in the history of Android development. IDs, explicit casting, and all the suffering just to get a reference to a View — all gone.</li><li><strong>Type and null-safe</strong></li><li>Saves time, reduces LOC count. In our example, the name variable is an EditText from the the first moment, and you can be sure it won&#39;t throw a NullPointerException or ClassCastException.</li><li><strong>Saves CPU time and battery</strong></li><li>Inflating an XML layout involves the XML Parser, which reads the file and parses its contents. With a complicated layout, or on a low-end phone, this process can take hundreds of milliseconds. This way the Layouts DSL saves both CPU- and battery-resources, a win both for you and the users.</li></ul><h3>More flexibility</h3><h4>Supports existing code</h4><p>Because the DSL is here, it doesn’t mean you have to get rid of your old XML files. You can use them in your DSL layouts with very little effort.</p><p>The magic function looks like this: val name = include(R.id.name)</p><h4>Custom components</h4><p>You created a custom EditText subclass, or you customized a Button for your application? Good news: they are also supported in DSL layouts.</p><pre><strong>inline</strong> <strong>fun</strong> ViewManager.<strong>yourView</strong>() = yourView(theme = 0) {}<br><strong>inline</strong> <strong>fun</strong> ViewManager.<strong>yourView</strong>(init: <strong>YourView</strong>.() -&gt; Unit): YourView {<br>  <strong>return</strong> ankoView({ YourView(it) }, theme = 0, init)<br>}</pre><h3>Listeners</h3><p>A lot of UI elements have listeners for specific events, for example for registering clicks. In the previous post, we demonstrated how simple it is to take care of this with Anko — it takes the same effort with the DSL.</p><p>Of course, you can use the onClick function instead of the nested objected .setOnClickListener(object: OnClickListener{....}) , but there is <strong>more</strong>.</p><p>One of the coolest features is that Anko has built-in subclasses for all default listeners, with all abstract methods overridden by an empty function. Using these you’ll only have to implement the bare necessities.</p><p>A quick comparison:</p><pre>seekBar.setOnSeekBarChangeListener(<strong>object</strong> : OnSeekBarChangeListener {<br>        <strong>override</strong> <strong>fun</strong> <strong>onProgressChanged</strong>(seekBar: <strong>SeekBar</strong>, progress: <strong>Int</strong>, fromUser: <strong>Boolean</strong>) {<br>            <em>// Something</em><br>        }<br>        <strong>override</strong> <strong>fun</strong> <strong>onStartTrackingTouch</strong>(seekBar: <strong>SeekBar</strong>?) {<br>            <em>// Just an empty method</em><br>        }<br>        <strong>override</strong> <strong>fun</strong> <strong>onStopTrackingTouch</strong>(seekBar: <strong>SeekBar</strong>) {<br>            <em>// Another empty method</em><br>        }<br>    })</pre><p><strong>vs.</strong></p><pre>seekBar {<br>        onSeekBarChangeListener {<br>            onProgressChanged { seekBar, progress, fromUser -&gt;<br>                <em>// Something</em><br>            }<br>        }<br>    }</pre><h3>What do you need to know before jumping in</h3><p>We talked about the positive and convenient features of the DSL layouts, but there are trade-offs as well.</p><ul><li><strong>No preview</strong></li><li>At least not in the stable channel. There’s an Anko Support IntelliJ plugin, which can render DSL layouts, but it’s available only in Android Studio 2.4+.</li><li><strong>No ConstraintLayout</strong></li><li>Yes, the “new” layout, introduced at Google I/O 2016 is not supported yet. But there is hope: you can find an issue in their tracker for including the ConstraintLayout, so this might change in the future.</li></ul><h3>DSL 101</h3><p>For the sake of simplicity, let’s create our first DSL layout in the Activity.onCreate function. No need for calling setContentView(...).</p><p>As a good software developer, you know the application logic and the layout needs to be separated, and the DSL has an excellent tool for achieving this. Take a look at the code:</p><pre><strong>class</strong> <strong>My</strong> <strong>Activity</strong> : <strong>AppCompatActivity</strong>() {<br>  <strong>override</strong> <strong>fun</strong> <strong>onCreate</strong> (savedInstanceState: <strong>Bundle</strong>?) {<br>    <strong>super</strong>.onCreate(savedInstanceState)<br>    <strong>val</strong> ui = MyActivityUI()<br>    ui.setContentView(<strong>this</strong>)<br>    ui.name.hint = &quot;Hint&quot;<br>  }<br>}</pre><pre><strong>class</strong> <strong>MyActivityUI</strong> : <strong>AnkoComponent {</strong></pre><pre>  <strong>lateinit</strong> <strong>var</strong> name: EditText</pre><pre>  <strong>override</strong> <strong>fun</strong> <strong>createView</strong>(ui: <strong>AnkoContext</strong>) = with(ui) {<br>    verticalLayout {<br>      name = editText()<br>      button (&quot;Say Hello&quot;) {<br>        onClick { ctx. toast (&quot;Hello, ${name.text} !&quot;) } <br>      }<br>    }<br>  }<br>}</pre><p>Layouts reside in their own separate classes, extended from the AnkoComponent interface, with a function that returns with the layout itself. We&#39;ll need to instantiate these in the activities, and call setContentView() with actual context. As mentioned before, calling findViewById() is not necessary anymore - in the example, the name: EditText variable is declared in the UI class, and is accessible from the Activity whenever you need it.</p><h3>Final words</h3><p>The <a href="https://www.kotlinresources.com/library/anko/">Anko</a> Layouts DSL is a powerful tool, a valid substitute for XML layouts in most cases. It is mature and stable enough for production — we’ve used it in multiple projects, with great satisfaction. Give it a try, and let me know how it goes!</p><p>Check out <a href="https://www.kotlindevelopment.com/"><strong>Kotlin Development.com</strong></a> for more interesting stories and code snippets written by real Kotlin devs from all around the globe! <em>#hellokotlin</em></p><p>🌐 <a href="https://www.kotlindevelopment.com/">www.kotlindevelopment.com</a> <br>🐤 Twitter: <a href="https://www.twitter.com/hellokotlin">@hellokotlin </a><br>📧 hello@kotlindevelopment.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63f76ef7d25c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/we-are-makery/why-anko-layouts-dsl-is-better-than-xml-layouts-63f76ef7d25c">Why Anko Layouts DSL is better than XML layouts</a> was originally published in <a href="https://medium.com/we-are-makery">MAKERS channel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Runtime permissions and Espresso done right]]></title>
            <link>https://medium.com/we-are-makery/runtime-permissions-and-espresso-done-right-bc46501899b0?source=rss----b575a2d874fb---4</link>
            <guid isPermaLink="false">https://medium.com/p/bc46501899b0</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[hellokotlin]]></category>
            <dc:creator><![CDATA[Makery]]></dc:creator>
            <pubDate>Fri, 04 Aug 2017 13:38:23 GMT</pubDate>
            <atom:updated>2017-08-15T09:57:41.545Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1sI9NeaVRMpsZ7pUdleFxw.png" /><figcaption><a href="https://medium.com/u/2053395ac335">Unsplash</a></figcaption></figure><h4>by: <a href="https://medium.com/u/759cce5cc5ae">Andras Kindler</a> The post first appeared ✍🏼 on the <a href="https://www.kotlindevelopment.com/runtime-permissions-espresso-done-right/">Kotlin Development</a> blog</h4><p>UI testing on Android improved a lot last year with Espresso, but it still can cause headaches from time to time. A good example would be the runtime permissions (introduced in Marshmallow), asking the user to grant specific (dangerous) permissions via system dialogs, hence making Espresso loose control over the app under test.</p><blockquote><a href="https://twitter.com/intent/tweet?url=https://www.kotlindevelopment.com/?p=1003&amp;text=Note%20that%20this%20is%20just%20a%20small%20part%20of%20the%20new%20support%20library%2C%20but%20it%20made%20me%20very%20happy&amp;via=HelloKotlin&amp;related=HelloKotlin">Note that this is just a small part of the new support library, but it made me very happy</a></blockquote><p>This is because Espresso can only target the Views inside the app, it can’t interact with other apps or the OS, which also includes system dialogs. So when presenting a permission dialog, the test is stuck — it cannot interact with the underlying views, failing all asserts. Luckily, there was a solution: one could use the <a href="https://developer.android.com/training/testing/ui-automator.html">UIAutomator library</a>, designed for UI testing across apps and the system.</p><p>You probably have a function like this, just to call it in every @Test-annotated method where applicable:</p><pre><strong>fun</strong> <strong>grantPermissionsIfNecessary</strong>() {<br>  <strong>if</strong> (Build.VERSION.SDK_INT &gt;= 23) {<br>    <strong>val</strong> allowPermissions = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()).findObject(UiSelector().text(&quot;ALLOW&quot;))<br>    <strong>if</strong> (allowPermissions.exists()) {<br>      <strong>try</strong> {<br>        allowPermissions.click()<br>      } <strong>catch</strong> (e: UiObjectNotFoundException) {<br>        Timber.e(e, &quot;No permission dialog found.&quot;)<br>      }<br>    }<br>  }<br>}</pre><p>What this snippet does is that it looks for an object on the screen with the text <strong>ALLOW</strong>, and tries to click on it — pretty standard stuff, similar to the way you’d do it with Espresso.</p><h3>Why does this suck:</h3><ul><li>complicated to support multiple languages (<strong>allow</strong> is in English, and there’s no String resource ID — what if the test cases are run on a different locale?);</li><li>using an extra library, just for one feature (at least in our case) — to get the permission dialog out of the way;</li><li>lot of redundant code — you’ll have to call this in every @Test method that involves activities requiring permissions;</li><li>kind of hacky.</li></ul><h3>Enter GrantPermissionRule</h3><p>A couple of days ago Google outed version 1.0.0 of the Android Testing Support library in a <a href="https://android-developers.googleblog.com/2017/07/android-testing-support-library-10-is.html">blog post</a>, containing a simple solution to the problem detailed above, called <a href="https://developer.android.com/reference/android/support/test/rule/GrantPermissionRule.html">GrantPermissionRule</a>. Out with the old, in with the new — switching to the new rule looks like this:</p><pre><strong>@Rule</strong> <strong>@JvmField</strong><br><strong>val</strong> grantPermissionRule: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.ACCESS_FINE_LOCATION)</pre><p>This single line of code grants every permission listed as parameter in the grant method with immediate effect. In other words, the app will be treated like if the permissions were already granted - no more dialogs. Also, no need to stick it into each and every method (just into the classes). Cleaner, simpler, nicer.</p><p>To including the library, just update the dependencies’ version to the following:</p><pre>dependencies {<br>    ...<br>    testImplementation &quot;junit:junit:4.12&quot;<br>    androidTestImplementation &quot;com.android.support.test:runner:1.0.0&quot;<br>    androidTestImplementation &quot;com.android.support.test.espresso:espresso-core:3.0.0&quot;<br>    ...<br>}</pre><p>Note that this is just a small part of the new support library, but it made me very happy — I was utterly annoyed by the way permission management worked before. See the complete release notes <a href="https://developer.android.com/topic/libraries/testing-support-library/release-notes.html">here</a>.</p><p>Check out <a href="https://www.kotlindevelopment.com/"><strong>Kotlin Development.com</strong></a> for more interesting stories and code snippets written by real Kotlin devs from all around the globe! <a href="http://www.twitter.com/@hellokotlin"><em>#hellokotlin</em></a></p><p>🌐 <a href="https://www.kotlindevelopment.com/">www.kotlindevelopment.com</a> <br>🐤 Twitter: <a href="https://www.twitter.com/hellokotlin">@hellokotlin </a><br>📧 hello@kotlindevelopment.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc46501899b0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/we-are-makery/runtime-permissions-and-espresso-done-right-bc46501899b0">Runtime permissions and Espresso done right</a> was originally published in <a href="https://medium.com/we-are-makery">MAKERS channel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why every Android developer should use Anko]]></title>
            <link>https://medium.com/we-are-makery/why-every-android-developer-should-use-anko-f6a816cf6dea?source=rss----b575a2d874fb---4</link>
            <guid isPermaLink="false">https://medium.com/p/f6a816cf6dea</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[hellokotlin]]></category>
            <category><![CDATA[anko]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Makery]]></dc:creator>
            <pubDate>Wed, 26 Jul 2017 14:41:10 GMT</pubDate>
            <atom:updated>2017-08-04T13:47:11.768Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TYtiKJzWtdHZhq9TdIEICA.png" /></figure><h4>by: <a href="https://medium.com/u/5843781daa9f">Adrián Bukros</a> The post first appeared ✍🏼 <a href="https://www.kotlindevelopment.com/why-should-use-anko/">on the Kotlin Development blog</a></h4><p>Anko is an Android library written in Kotlin and maintained by JetBrains. The purpose of it is to speed up Android development with the capabilities of Kotlin, thus making it more convenient. That’s how it got its name. (An)droid (Ko)tlin. Let’s see what nice tools <a href="https://www.kotlinresources.com/library/anko/">Anko</a> has for us!</p><h4>The Anko library has four main modules:</h4><ul><li>Commons</li><li>Layouts</li><li>SQLite</li><li>Coroutines</li></ul><p>The commons module has a wide variety of helper functions and features. Using the layouts part of the library, you can create UI from Kotlin code with a feature called Anko DSL. The SQLite part of the library makes interacting with SQLite databases simpler. Last but not least, Anko provides a few helper functions for one of Kotlin 1.1 biggest feature: Kotlin coroutines.</p><p><strong>Developing applications for the Android platform have never been easier.</strong></p><p>In this article, I will focus exclusively on the Anko commons module.</p><h3>Anko Commons</h3><h4>The most common</h4><p>Let’s start with some basic simplifications! The View.setOnClickListener method is used everywhere in Android projects so it would be nice if we could make it more concise.<br>The longest form we can define a click handler in Kotlin:</p><pre>button.setOnClickListener(object : View.OnClickListener{<br> override fun onClick(v: View) {<br> }<br>})</pre><p>But Anko helps to minimize the effort we have to make:</p><pre>button.onClick { }</pre><h4>The intentional</h4><p>Using intents is one of the first things you will learn as an Android developer, but the API could be more convenient.</p><pre>val intent = Intent(this, MainActivity::class.java)<br>intent.putExtra(“id”, 5)<br>intent.putExtra(“name”, “John”)<br>startActivity(intent)</pre><p>Let’s see how could it be more simple:</p><pre>startActivity&lt;MainActivity&gt;(“id” to 5, “name” to “John”)</pre><p>One LOC instead of five. Not bad.<br>Also Anko has a few helper functions for common use cases regarding Intents:</p><pre>browse(“<a href="https://makery.co/">https://makery.co</a>&quot;)<br>share(“share”, “subject”)<br>email(“<a href="/service/mailto:hello@makery.co">hello@makery.co</a>”, “Great app idea”, “potato”)</pre><h4>Start a conversation with strangers more easily</h4><p>Anko also makes the Android dialogs API more developer-friendly. No need for the builder pattern.</p><pre>val builder = AlertDialog.Builder(this)<br>builder.setTitle(“Java”)<br>builder.setMessage(“Java is… old!”)<br>builder.setPositiveButton(“OK”) { dialog, which -&gt; toast(“Yay!”) }<br>builder.setNegativeButton(“Cancel”) { dialog, which -&gt; toast(“What?”) }<br>builder.show()</pre><pre>alert(Appcompat, “Kotlin”, “Kotlin is so fresh!”) {<br> customView { editText() }<br> positiveButton(“OK”) { toast(“Yay!”) }<br> negativeButton(“Cancel”) { toast(“What?”) }<br>}.show()</pre><h4>Size issues</h4><p>Code size matters, also when doing dpi-maths programatically.<br><strong>The complicated old way:</strong></p><pre>val dpAsPx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10f, getResources().getDisplayMetrics())</pre><p><strong>The dead simple new way:</strong></p><pre>val dpAsPx = dip(10f)</pre><p><strong>Also you can get text sizes</strong></p><pre>sp(15f)</pre><h4>API level 23 (Paladin)</h4><p>Fragmentation is a problem every Android developer has to face. We don’t want to leave anyone with older system versions behind, but we also want to use the cool new features of the latest Android releases.</p><p>What can we do? Branch our code. Usually it looks like this:</p><pre>if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP){ }<br>if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.LOLLIPOP){ }</pre><p>Let’s see what Anko has for us:</p><pre>doIfSdk(Build.VERSION_CODES.LOLLIPOP){ }<br>doFromSdk(Build.VERSION_CODES.LOLLIPOP){ }</pre><h4>I just had a snack at the snack bar.</h4><p>The Android Snackbar API also could be better. Did you ever forget to call .show() after Snackbar.make() function, and then debug it for half an hour why it’s not showing? No? Maybe it’s just me.</p><pre>Snackbar.make(findViewById(android.R.id.content), “This is a snack!”, Snackbar.LENGTH_LONG)<br>.show()</pre><p><strong>You don’t need to call show()!</strong></p><pre>longSnackbar(findViewById(android.R.id.content), “This is a snack!”)</pre><p>If you are big fan of toasts, Anko also has something for you:</p><pre>toast(“Message”)</pre><h4>Threading the needle</h4><p>Handling multiple threads is not easy, but it’s a pretty common pattern in mobile development: most of the time we want to offload work from the UI thread. The way to do it with Anko is pretty straightforward and concise.</p><pre>doAsync {<br> //IO task or other computation with high cpu load<br> uiThread {<br> toast(“async computation finished”)<br> }<br>}</pre><h3>Add Anko to your project</h3><p>If you like the features above, what are you waiting for? It’s time to add Anko to your project!</p><pre>ankoVersion = “0.10.1”<br>dependencies {<br> compile “org.jetbrains.anko:anko-appcompat-v7-listeners:$ankoVersion”<br> compile “org.jetbrains.anko:anko-design-listeners:$ankoVersion”<br> compile “org.jetbrains.anko:anko-design:$ankoVersion”<br> compile “org.jetbrains.anko:anko-sdk15-listeners:$ankoVersion”<br> compile “org.jetbrains.anko:anko-sdk15:$ankoVersion”<br>}</pre><h3>+1 Bye-bye findViewById()</h3><p>Have you heard of the Kotlin Android Extensions Gradle plugin? You can get rid of all the hated findViewById() calls and casting Views by introducing one extra line to your Gradle script:</p><pre>apply plugin: ‘kotlin-android-extensions’</pre><p>Now you can just reference views from your XML files with their id.</p><p>// activity_main.xml</p><pre>&lt;LinearLayout <br> xmlns:android=”<a href="http://schemas.android.com/apk/res/android">http://schemas.android.com/apk/res/android</a>&quot;<br> android:layout_width=”match_parent”<br> android:layout_height=”match_parent”<br> android:orientation=”vertical”&gt;<br> <br> &lt;Button android:id=”@+id/button”<br>  android:layout_width=”wrap_content”<br>  android:layout_height=”wrap_content”<br>  android:text=”OK”/&gt;</pre><pre>&lt;/LinearLayout&gt;</pre><p>// MainActivity.kt</p><pre>import kotlinx.android.synthetic.main.activity_main.*<br>…<br>override fun onCreate(savedInstanceState: Bundle?) {<br> super.onCreate(savedInstanceState)<br> setContentView(R.layout.activity_main)<br> button.onClick { }<br>}</pre><p>Check out <a href="https://www.kotlindevelopment.com/"><strong>Kotlin Development.com</strong></a> for more interesting stories and code snippets written by real Kotlin devs from all around the globe! <em>#hellokotlin</em></p><p>🌐 <a href="https://www.kotlindevelopment.com/">www.kotlindevelopment.com</a> <br>🐤 Twitter: <a href="https://www.twitter.com/hellokotlin">@hellokotlin </a><br>📧 hello@kotlindevelopment.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6a816cf6dea" width="1" height="1" alt=""><hr><p><a href="https://medium.com/we-are-makery/why-every-android-developer-should-use-anko-f6a816cf6dea">Why every Android developer should use Anko</a> was originally published in <a href="https://medium.com/we-are-makery">MAKERS channel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What we learned in April ]]></title>
            <link>https://medium.com/we-are-makery/what-we-learned-in-april-3d0b539df314?source=rss----b575a2d874fb---4</link>
            <guid isPermaLink="false">https://medium.com/p/3d0b539df314</guid>
            <category><![CDATA[design-thinking]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[mobile-development]]></category>
            <dc:creator><![CDATA[Makery]]></dc:creator>
            <pubDate>Wed, 17 May 2017 09:11:02 GMT</pubDate>
            <atom:updated>2017-05-17T09:10:05.722Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*osP-q1IwLT4nYMNOE-AKaA.png" /><figcaption>www.makery.co</figcaption></figure><p>This is a link collection about the topics we liked this month, enjoy!</p><p><em>This post was originally launched at </em><a href="http://www.makery.co/"><em>www.makery.co</em></a></p><p>We usually collect all the intresting stuff from around the web. Let’s learn and grow together!</p><h4>🍏 IOS</h4><ul><li>If somebody loves to listen <a href="https://swiftcoders.podbean.com/">dev related podcasts</a>, this is a great stuff about swift — Interviews with the bests coders.</li><li>Whats new in <a href="https://youtu.be/dAKfprUGzG8">appcode</a>?</li></ul><h4>👾 ANDROID</h4><ul><li>If you have a crash like ‘All subclasses of Fragment must include a public no-argument constructor.’ this effects our ‘<a href="https://developer.android.com/reference/android/app/Fragment.html">PurchaseFragment</a>‘</li><li>You can <a href="https://github.com/grpc-ecosystem/grpc-gateway/blob/master/README.md">transition to GRPC</a> and not, at the same time</li><li><a href="https://blog.jetbrains.com/kotlin/2017/04/kotlinnative-tech-preview-kotlin-without-a-vm/">Kotlin without a VM</a></li><li><a href="https://draculatheme.com/">Dracula</a> all the things!</li><li><a href="https://be5invis.github.io/Iosevka/">Ligature</a> all the things!</li><li><a href="https://www.genymotion.com/blog/2-9-0-android-7-1-new-trial-system/">Genymotion 2.9.0</a> — Android 7.1 and new trial system</li><li>Brilliant post on ~software engineering~ learning: <a href="http://www.daedtech.com/how-developers-stop-learning-rise-of-the-expert-beginner/">the Expert Beginner</a></li><li><a href="http://cr.openjdk.java.net/~briangoetz/amber/pattern-match.html">Pattern match</a></li><li>Introducing <a href="http://get.gitlab.com/gitlab-9/">Gitlab 9.0</a></li><li><a href="https://github.com/aritraroy/UltimateAndroidReference/blob/master/README.md#frameworks">Ultimate Android Reference</a> — Your Road to Become a Better Android Developer</li></ul><h4>🎮 IOT</h4><ul><li>Check the <a href="http://android-developers.googleblog.com/2017/04/android-things-developer-preview-3.html">Android Things Developer Preview 3</a></li><li><a href="https://arstechnica.com/business/2017/04/amazon-opens-up-alexa-voice-and-text-tech-for-developers-to-make-new-chatbots/">Amazon opens up Alexa voice</a> and text tech for developers to make new chatbots.</li><li>Conversational UX Platform for products and services <a href="https://api.ai/">acquired by Google</a></li></ul><h4>✏️ DESIGN</h4><ul><li>Set your <a href="https://slackhq.com/set-your-status-in-slack-28a793914b98">status in Slack</a></li><li><a href="http://picnic.design/">Collaboration in Sketch</a> with ease</li><li>Fucking exciting! <a href="http://www.theverge.com/2017/4/12/15267486/photography-machine-learning-future">The endgame for cameras</a> is having no camera at all.</li><li><a href="https://medium.muz.li/why-gradients-are-the-new-colors-3d8d42a7a6fc">Gradients</a> are the new colors?</li><li><a href="https://www.figma.com/pricing">Figma’s pricing</a> is here!</li><li><a href="http://www.theverge.com/2017/4/18/15332504/facebook-messenger-bot-store-chat-extensions-m">FB chatbot</a> store and extensions are here.</li></ul><h4>📈 LAUNCH AND SCALE</h4><ul><li>adJelly — The ultimate <a href="https://www.adjelly.com/size-guide">social &amp; digital ad size guide</a>.</li><li><a href="https://traffichabits.com/how-to-measure-the-effectiveness-of-mobile-retargeting-567a0b0c822d">How to measure</a> the effectiveness of mobile retargeting</li><li>Building Apps for Mobile Growth: <a href="https://mobilegrowthstack.com/building-apps-for-mobile-growth-tech-layer-choices-986849df053e">Tech Layer Choices</a></li></ul><p>If you think that we missed something important,<a href="http://hello@makery.co/"> let us know</a> ;)</p><p>And hey, don’t forget to follow <a href="https://medium.com/u/3b66bc9c50ab">Makery</a> to get notified about the latest stories and projects of our amazing makers. Or just go behind the scenes and check out our <a href="http://www.instagram.com/wearemakery"><strong>Instagram</strong></a><strong> </strong>✌️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d0b539df314" width="1" height="1" alt=""><hr><p><a href="https://medium.com/we-are-makery/what-we-learned-in-april-3d0b539df314">What we learned in April 🤓</a> was originally published in <a href="https://medium.com/we-are-makery">MAKERS channel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Being a hipster is still in right!]]></title>
            <link>https://medium.com/we-are-makery/your-homescreens-deserve-to-be-beautiful-38da7d2fbaea?source=rss----b575a2d874fb---4</link>
            <guid isPermaLink="false">https://medium.com/p/38da7d2fbaea</guid>
            <category><![CDATA[wallpaper]]></category>
            <category><![CDATA[digital-design]]></category>
            <category><![CDATA[unsplash]]></category>
            <dc:creator><![CDATA[Balazs Zsedely]]></dc:creator>
            <pubDate>Fri, 21 Apr 2017 15:07:39 GMT</pubDate>
            <atom:updated>2017-04-18T11:42:36.527Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eNrqyTC9DS1VR-vqgYXxKg.jpeg" /></figure><p>I’m Balazs from <a href="http://www.makery.co/">Makery</a>, a mobile team from Budapest, Hungary. This story is about one of our lovely side projects called<strong> </strong><a href="http://www.hpstrapp.com/"><strong>HPSTR Wallpaper</strong></a><strong>.</strong></p><p><em>HPSTR provides artistic wallpapers to your iOS and Android devices from the best creative communities like #Unsplash, #500px and #Reddit with hipster shapes, effects and cool filters. With HPSTR you can sync your favourite wallpapers in real-time with your Android watch or OS X homescreen.</em></p><p>Watch this <strong>1 min video</strong> about the app (cool track alert, headphones on ☝️)</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fmkd9BAjOIbQ%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dmkd9BAjOIbQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fmkd9BAjOIbQ%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d3f50a6e045aafd8d1c8f0aef96e50b4/href">https://medium.com/media/d3f50a6e045aafd8d1c8f0aef96e50b4/href</a></iframe><p>Since we are a mobile team, most of our time is spent with our phones, gadgets and computers. We check our screens several times every day. More than normal people usually do. Sorry friends and family. 😅</p><blockquote>We are also in love with beautiful photography, great minimalistic design and all things technology.</blockquote><p>We created <a href="http://www.hpstrapp.com/">HPSTR</a> over 2 years ago because we wanted to express ourselves with a design related project. <a href="https://medium.com/u/2053395ac335">Unsplash</a> made a huge impression on us, soon it’s launched we managed to deliver the first version of HPSTR to Android. It was one of the first apps on the <a href="https://madewith.unsplash.com/categories/app">#madewithunsplash</a> site.</p><p>In the past 2 years we found our like-minded community. Since the first launch<strong> 8 MILLION </strong>wallpapers have been generated on Android, which means a new wallpaper in every 7 minutes. Cool, isn’t it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hp6oGEpIr_Kf332P3oZ8qQ.png" /><figcaption>Homescreens are beautiful.</figcaption></figure><p>We didn’t update the app since its first launch, which we know was a risky move from our side. Lots of you were asking us to do it and we are very grateful that you stayed with us, even if it took longer to adjust your needs.</p><p>Today we are proudly launch:</p><p><strong>📱⌚ a Huge UPDATE of the Android app</strong></p><p>- Sync your favourite wallpaper with your Android watch<br>- Enjoy a bunch of new geometric shapes, cool effects and filters <br>- Try out the 3D parallax motion for a more lively experience<br>- Pick different shapes, effects and filters by hand as you like<br>- Testing a ‘wear-your-background’ concept: simply order a t-shirt or gym bag with your current HPSTR background</p><p><strong>📱💻 a NEW iOS app landed at the AppStore with OS X Sync</strong></p><p><strong>- </strong>Get all the beautiful photos from <a href="https://medium.com/u/2053395ac335">Unsplash</a> enhanced with cool fragment designs, effects, shapes and different filters <br>- Sync your wallpapers in real time with your Mac<br>- Pick different shapes, effects and filters by hand as you like<br>- If you fancy your own photos you can import them from your Camera roll</p><p><strong>Is HPSTR for you?</strong></p><p>Yes, if you caught yourself at least once in your lifetime scrolling endlessly on #Unsplash, #Reddit or #500px just for fun, this app is built for you.</p><p>It’s also built for you if you love to be inspired by the beauty of everyday life like nature, travel, animals, people, the sky and so on.</p><p><strong>Go give it a try for yourself!</strong></p><figure><a href="http://bit.ly/HPSTR-Android-app"><img alt="" src="https://cdn-images-1.medium.com/max/256/1*t6jIAt8VllkmCtVjRa5crw.png" /></a></figure><figure><a href="http://bit.ly/HPSTR-ios-app"><img alt="" src="https://cdn-images-1.medium.com/max/256/1*BGSzu_Y3fw-ZiWGAyJNZig.png" /></a></figure><figure><a href="http://bit.ly/HPSTR-Mac-app-store"><img alt="" src="https://cdn-images-1.medium.com/max/256/1*k8bQv6ds_WoQXo0o7VsrSQ.png" /></a><figcaption>Download the HPSTR app by clicking on the buttons above!</figcaption></figure><p><strong>+1: there’s more for the future!</strong><br>If you want to inspire others, soon you can wear your favourite wallpaper on your new T-shirt and gymbag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*GceyMcezoukKv9jKuhnDqQ.png" /></figure><p>💌 <strong>Send us your thoughts</strong>, recommendations, feedback or anything that popped in your mind — we’d love to hear from you. :)</p><p>📷 Or just<strong> join the community</strong> on Instagram: <a href="http://www.instagram.com/hpstrapp"><strong>@hpstrapp</strong></a> We love to see your favourite designs with the #hpstrapp hashtag.</p><p>✍️ If you’re reading this as a journalist, check <a href="https://medium.com/@wearemakery/press-kit-hpstr-live-wallpaper-2f3c047cd3ed"><strong>this post</strong></a><strong> </strong>for more details and stats from our last 2 years!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*cI7c6zefnOCCbxxCBxSrFw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*ho1l7YFSbeAxsXYZj_dmrw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*a2vfyTI3fv5ApgWWLkOHyg.jpeg" /></figure><p><em>Ps.: Thanks for all the talented photographers, contributors and makers of Unsplash, 500px and Reddit.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38da7d2fbaea" width="1" height="1" alt=""><hr><p><a href="https://medium.com/we-are-makery/your-homescreens-deserve-to-be-beautiful-38da7d2fbaea">Being a hipster is still in right!</a> was originally published in <a href="https://medium.com/we-are-makery">MAKERS channel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Requery — My favorite Android ORM library]]></title>
            <link>https://medium.com/we-are-makery/requery-my-favorite-android-orm-library-c8a9b5d2851?source=rss----b575a2d874fb---4</link>
            <guid isPermaLink="false">https://medium.com/p/c8a9b5d2851</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Adrián Bukros]]></dc:creator>
            <pubDate>Fri, 04 Mar 2016 13:59:06 GMT</pubDate>
            <atom:updated>2016-03-04T14:20:14.190Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ixsW39_MEy_Co_fW2bS7gQ.jpeg" /><figcaption><a href="https://unsplash.com/photos/xiTFENI0dMY">https://unsplash.com/photos/xiTFENI0dMY</a></figcaption></figure><h4>About Requery</h4><p>There are lot of libraries that help you store your data in SQLite database on Android, but Requery makes it a lot more simple. It’s a light but powerful ORM and SQL query generator that supports RxJava, and helps you keep boilerplate code to a minimum. The library itself was built by <a href="https://github.com/npurushe"><strong>Nikhil Purushe</strong>.</a></p><h4>Using Requery</h4><p>The follwing example is written in Kotlin.</p><p>First step is to add the lib to you project by modifying build.gradle:</p><pre>dependencies {<br>  compile ‘io.requery:requery:1.0-SNAPSHOT’<br>  compile ‘io.requery:requery-android:1.0-SNAPSHOT’<br>  kapt ‘io.requery:requery-processor:1.0-SNAPSHOT’<br>}</pre><p>Setup the Kotling Annotation Processor so you can use the generated classes in your code:</p><pre>kapt {<br>  generateStubs = <strong>true<br></strong>}</pre><p>You also need to add a custom repository location. Requery is in development phase so only snapshot version is available:</p><pre>repositories {<br>  jcenter()<br>  maven { url ‘http://oss.jfrog.org/artifactory/oss-snapshot-local&#39;}<br>}</pre><p>Now you can use Requery. Add these lines to your Application class or your dependency injection code to access the SingleEntityStore anywhere from your app.</p><pre><strong>val </strong>source = DatabaseSource(<strong>context</strong>, <strong>entityModel</strong>, <strong>dbVersion</strong>);<br><strong>val </strong>dataStore = RxSupport.toReactiveStore(<br>  EntityDataStore&lt;Persistable&gt;(source.<strong>configuration</strong>)<br>);</pre><p>You can use the auto generated <strong>Model.DEFAULT</strong> for the <strong>entityModel </strong>parameter, which is created after you’ve annotated a class or interface with the necessary requery annotations. Eg. for a simple user class:</p><pre>@Entity<br><strong>public abstract class </strong>User {<br>  @Key @Generated<br>  <strong>int id</strong>;<br>  @Index(name=<strong>”name”</strong>)<br>  String <strong>name</strong>;<br>}</pre><p>(Currently only Java classes supported for model definition.)</p><p>This makes the framework generate the UserEntity class which can be used for further actions, like insert:</p><pre><strong>val </strong>user = UserEntity()<br>user.setName(<strong>“XY”</strong>)</pre><pre><strong>dataStore</strong>.insert(user)<br> .toObservable()<br> .subscribeOn(Schedulers.io())<br> .observeOn(AndroidSchedulers.mainThread())<br> .subscribe{ user -&gt;<br>    Timber.d(<strong>“User inserted: “</strong>+user.getId()+<strong>” “</strong>+user .getName())<br>}</pre><p>Or select:</p><pre><strong>dataStore</strong>.select(UserEntity::<strong>class</strong>.<em>java</em>)<br> .get()<br> .toObservable()<br> .subscribeOn(Schedulers.io())<br> .observeOn(AndroidSchedulers.mainThread())<br> .subscribe{ user -&gt;<br>    Timber.d(<strong>“User from DB: “</strong>+user.getId()+<strong>” “</strong>+user .getName())<br>}</pre><h4>Summary</h4><p>So Requery is a promising solution for persisting your data on Android, taking a lot of weight off of developers. Checkout the project GitHub repo <a href="https://github.com/requery/requery">here</a>, and my example app <a href="https://github.com/wearemakery/requery-android-example">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8a9b5d2851" width="1" height="1" alt=""><hr><p><a href="https://medium.com/we-are-makery/requery-my-favorite-android-orm-library-c8a9b5d2851">Requery — My favorite Android ORM library</a> was originally published in <a href="https://medium.com/we-are-makery">MAKERS channel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CES 2016: best of show]]></title>
            <link>https://medium.com/we-are-makery/ces-2016-best-of-show-707544e61a97?source=rss----b575a2d874fb---4</link>
            <guid isPermaLink="false">https://medium.com/p/707544e61a97</guid>
            <category><![CDATA[ces]]></category>
            <category><![CDATA[ces2016]]></category>
            <category><![CDATA[chevy-bolt-ev]]></category>
            <dc:creator><![CDATA[Andras Kindler]]></dc:creator>
            <pubDate>Sun, 17 Jan 2016 21:58:38 GMT</pubDate>
            <atom:updated>2016-01-17T21:58:24.214Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2x7kvvtfx4bUd9SxU156pA.jpeg" /></figure><p>This was a quiet year, without any groundbreaking new products or announcements, but still, a lot of exciting stuff was going on in Las Vegas. Here are our favourites from the show.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bj8mrDfd5UQ1lzcYiCavrQ.jpeg" /><figcaption><strong>Chevy Bolt EV</strong></figcaption></figure><p><strong>Chevy Bolt EV<br></strong>The Bolt EV looks pretty much`normal` — no gimmicks, nothing special, just a decent car for the masses. It is all-electric, does 200+ miles on one charge, goes 0–60 under 7 seconds, with an infotainment system made by LG. Oh, and is about $30k, less then third of the price of a Tesla Model S — a huge step for the electric car to go mainstream, hopefully starting a stream of affordable EVs.</p><p><strong>The new TECHNICS SL-1200 models<br></strong>As a huge fan of vinyls, I was excited about Technics’ announcement of renewing the SL-1200 line. The new turntables very much resemble the old series, companied by some fancy new tech. Marking the 50th anniversary of the world-renowned decks, Technics is releasing two models, the SL-1200G with aluminium casing a the SL-1200GAE with magnesium casing, making only 1200 pieces of the latter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*r-D-UjA0FnmhyJJCeBaNjA.jpeg" /><figcaption><strong>LG G6 Signature</strong></figcaption></figure><p><strong>LG G6 Signature 4K OLED HDR TV</strong><br>TVs were always a of CES, this didn’t change this year. With a stiff competition, this year the G6 took the cake. LG’s 4K OLED HDR television comes with Ultra HD Premium certification and WebOS 3.0, all this with a stunningly thin (the panel is only 2.57 mm thick) design.</p><p><strong>Huawei Mate 8<br></strong>We had the chance to try out Huawei’s new Android device, using it since the press conference. Although I’m not a fan of third-party customizations and tweeks of the OS, the build quality and the camera performance is astonishing. The most impressive feat however is the battery life — the phone easily lasts two days with one charge, even with heavy usage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*7fEUuicYB6gyjNqERFNn1A.png" /><figcaption>Netflix is now available (almost) worldwide</figcaption></figure><p><strong>Netflix global availability</strong><br>Although it’s not a physical device, the news from the Netflix press conference was a huge deal. The online streaming service is now available worldwide (except for China, Crimea, North Korea and Syria), as the company continues to disrupt the way we watch TV and carries on towards world domination.</p><p><strong>If you like this article, please recommend it to help others find it!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*GUpSW_YyXHfTQUN5fEuUAw.png" /></figure><h4>We are a team of mobile designers, developers, backend specialists and strategists who are ready to make you a product that people will love to use. We can help you build your entire product or we can just round out your team in a particular area.</h4><h3>Got an idea? Drop a <a href="http://hello@mkry.co/">line</a> or <a href="https://twitter.com/wearemakery">tweet</a> us!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=707544e61a97" width="1" height="1" alt=""><hr><p><a href="https://medium.com/we-are-makery/ces-2016-best-of-show-707544e61a97">CES 2016: best of show</a> was originally published in <a href="https://medium.com/we-are-makery">MAKERS channel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android versions distribution in 2015]]></title>
            <link>https://medium.com/we-are-makery/android-versions-distribution-in-2015-cde756c66524?source=rss----b575a2d874fb---4</link>
            <guid isPermaLink="false">https://medium.com/p/cde756c66524</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Makery]]></dc:creator>
            <pubDate>Fri, 08 Jan 2016 14:14:58 GMT</pubDate>
            <atom:updated>2016-01-08T17:24:36.704Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XSJGijFqH-j1MvnwUuOZA.jpeg" /><figcaption>Image source: phonearena.com</figcaption></figure><p>Google just updated the dashboard on the official developer site, containing all sorts of data about the current state of the Android OS. The most interesting one focuses on the distribution of the currently available versions, a valuable information for everyone in the app industry.</p><p>Google releases these numbers at the start of every month, collected through a seven day period. At <a href="http://www.mkry.co/">Makery</a>, we aggregated all of these from last year and made a chart, to visualize the changes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*0mnpGURywAgmjEd9k9JYxA.png" /><figcaption>The original chart is available here: <a href="https://infogr.am/android_version_distribution_2015">https://infogr.am/android_version_distribution_2015</a></figcaption></figure><p>While the winner of 2014 was KitKat (which grew from 1.8% to 39.1%), last year was all about Lollipop. Also known as Android 5.0 and 5.1, although rolled out in November of 2014, only appeared first in the charts last January at 1.6 percent.</p><p>Throughout the last twelve months, this went up to 32,6%, with 5.0 finishing at 16.9%, and 5.1 at 15.7%. The latest version, dubbed Marshmallow, released to the public in October, opened at .3 percent, reaching .7% at the end of 2015.</p><p>And some sad (and almost disturbing) news — we’re yet to see the very end of FroYo and Gingerbread. The two relics of Android past don’t seem to go away, hanging on at .2% and 3%, respectively.</p><p>See the same chart from <a href="http://andraskindler.com/blog/2015/android-distribution-2014/">last year</a> and from <a href="http://9gag.com/gag/aWZLjGn">2013</a>.</p><p><strong>If you like this article, please recommend it to help others find it!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*GUpSW_YyXHfTQUN5fEuUAw.png" /></figure><h4><em>We are a team of mobile designers, developers, backend specialists and strategists who are ready to make you a product that people will love to use. We can help you build your entire product or we can just round out your team in a particular area.</em></h4><h3><strong>Got an idea? Drop a </strong><a href="http://hello@mkry.co/"><strong>line</strong></a><strong> or </strong><a href="https://twitter.com/wearemakery"><strong>tweet</strong></a><strong> us!</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cde756c66524" width="1" height="1" alt=""><hr><p><a href="https://medium.com/we-are-makery/android-versions-distribution-in-2015-cde756c66524">Android versions distribution in 2015</a> was originally published in <a href="https://medium.com/we-are-makery">MAKERS channel</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>