<?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 Paul Akhamiogu on Medium]]></title>
        <description><![CDATA[Stories by Paul Akhamiogu on Medium]]></description>
        <link>https://medium.com/@paulakhamiogu?source=rss-216a9029469d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*xFIPJp3zj3N_1V5t.</url>
            <title>Stories by Paul Akhamiogu on Medium</title>
            <link>https://medium.com/@paulakhamiogu?source=rss-216a9029469d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 14:15:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@paulakhamiogu/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[Gradle CLI Tips: Run specific unit test]]></title>
            <link>https://medium.com/@paulakhamiogu/gradle-cli-tips-run-specific-unit-test-499cab933414?source=rss-216a9029469d------2</link>
            <guid isPermaLink="false">https://medium.com/p/499cab933414</guid>
            <dc:creator><![CDATA[Paul Akhamiogu]]></dc:creator>
            <pubDate>Thu, 02 Jun 2022 21:27:03 GMT</pubDate>
            <atom:updated>2022-06-02T21:28:27.864Z</atom:updated>
            <content:encoded><![CDATA[<h3>Gradle CLI Tips: Run specific unit test</h3><p>Gradle allows us to automate many tasks. In java and android projects, one might want to run specific unit tests from the CLI. I have struggled to get this to work for a long time as against using the GUI tools of IntelliJ and Android Studio.</p><p>Going through the <a href="https://docs.gradle.org/current/userguide/java_testing.html#test_filtering">Gradle</a> docs, one can achieve this using the test filtering feature, using the --tests option. Here are some of the commands for specific use-cases based on an Android project:</p><p>It is important in the various cases to not forget to input the <strong>quotes ‘’</strong> around the filters. it won’t work without them and this was the part I missed for a long time.</p><p>Gradle allows us to use camel-cased <a href="https://docs.gradle.org/current/userguide/command_line_interface.html#sec:name_abbreviation">shorthand</a> for long task names. In the cases below, tDUT means testDebugUnitTest.</p><h3>Running test in a specific class</h3><pre>./gradlew tDUT --tests &#39;com.some.package.ClassToTest&#39;</pre><h3>Running tests in a specific package</h3><pre>./gradlew tDUT --tests &#39;com.some.package*&#39;</pre><h3>Running tests in a specific module</h3><pre>./gradlew :moduleName:tDUT --tests &#39;com.some.package.ClassToTest&#39;</pre><p>We could leverage the Gradle task shorthand and simplify this to</p><pre>./gradlew :mN:tDUT --tests &#39;com.some.package.ClassToTest&#39;</pre><p>Hope this helps others probably having errors using the Gradle test filters.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=499cab933414" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some pros of Moshi over Gson when using Kotlin for Android]]></title>
            <link>https://medium.com/@paulakhamiogu/some-pros-of-moshi-over-gson-when-using-kotlin-for-android-3d1b22d009b3?source=rss-216a9029469d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d1b22d009b3</guid>
            <category><![CDATA[moshi]]></category>
            <category><![CDATA[songs]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Paul Akhamiogu]]></dc:creator>
            <pubDate>Sat, 30 Apr 2022 11:06:50 GMT</pubDate>
            <atom:updated>2022-05-03T09:22:28.086Z</atom:updated>
            <content:encoded><![CDATA[<p>In the JVM world, <a href="https://github.com/square/moshi/">Moshi</a> and <a href="https://github.com/google/gson/">Gson</a> are both libraries for serialisation and deserialisation, converting JSON to objects and vice versa. Gson is written in Java, while Moshi is written in Java and Kotlin.</p><p>Since Google announced Kotlin as the first language for Android app development, many developers have switched to using Kotlin. Gson was first released publicly in 2008 and a lot of projects used Gson in the past. Moshi was released first in <a href="https://github.com/square/moshi/">2015</a> and introduced support for Kotlin in <a href="https://github.com/square/moshi/">2017</a>. Since then, we hear a lot of developers preaching the use of Moshi.</p><p>So what are really the advantages of Moshi over Gson as of today?</p><h4>1. Moshi is more <a href="https://zacsweers.github.io/json-serialization-benchmarking/">performant</a> than Gson</h4><p>Moshi is faster and uses less memory than Gson. It uses <a href="https://github.com/square/okio">Okio</a> under the hood. Moshi is created by <a href="https://github.com/square">Square</a>, the same company that created <a href="https://github.com/square/retrofit/">Retrofit</a>, so if you use Moshi with Retrofit, they <a href="https://github.com/square/retrofit/blob/master/retrofit-converters/moshi/src/main/java/retrofit2/converter/moshi/MoshiResponseBodyConverter.java#L35-L46">share the same buffer</a>, using even less memory.</p><h4>2. Moshi respects Kotlin’s non-null and <a href="https://github.com/square/moshi/#default-values--constructors">default values</a></h4><p>When reading JSON that is missing a field, Moshi would assign the specified default values, so we would not get accidental null pointer exceptions at runtime.</p><h4>3. Moshi provides Kotlin code generation support for adapters so you do not have to use reflection.</h4><p>Moshi has a feature that uses an annotation processor to generate adapter code at build time, without this, we would have to use the reflection alternative, which is less performant and also adds 2.5MB to the app’s binary file.</p><h4>Add Moshi to your project</h4><p>To use Moshi in your projects, follow the instructions on their <a href="https://github.com/square/moshi/#kotlin">README</a> on Github.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d1b22d009b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>