<?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 Rio Arjuna on Medium]]></title>
        <description><![CDATA[Stories by Rio Arjuna on Medium]]></description>
        <link>https://medium.com/@ri0arjuna?source=rss-23b03f37e5c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RmQLr-uSMf3zwSPWCPXILw.jpeg</url>
            <title>Stories by Rio Arjuna on Medium</title>
            <link>https://medium.com/@ri0arjuna?source=rss-23b03f37e5c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 14:14:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ri0arjuna/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[Jetpack Compose WASM: Write Kotlin UI Once, Run on the Web]]></title>
            <link>https://ri0arjuna.medium.com/jetpack-compose-wasm-a581d6e00721?source=rss-23b03f37e5c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a581d6e00721</guid>
            <category><![CDATA[wasm]]></category>
            <category><![CDATA[compose-multiplatform]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Rio Arjuna]]></dc:creator>
            <pubDate>Fri, 18 Apr 2025 10:38:56 GMT</pubDate>
            <atom:updated>2025-04-19T01:22:00.167Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nrKuOaaqMD5tad2_" /><figcaption>Photo by <a href="https://unsplash.com/@altumcode?utm_source=medium&amp;utm_medium=referral">AltumCode</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Jetpack Compose is Android’s recommended modern toolkit for building native UI. It simplifies and accelerates UI development on Android. Quickly bring your app to life with less code, powerful tools, and intuitive Kotlin APIs.</blockquote><p>Google and JetBrains working together to build efficient ecosystem for Android Engineer — one Kotlin codebase, many platform. Jetpack Compose is just powerful and efficient toolkit to building native, but Compose Multiplatform is another level of genius.</p><p>CMP — stand for Compose Multiplatform — is a sweat spots for engineers. Not every Android Engineer is familiar with build websites using JavaScript, or developing iOS apps with Swift as well as Desktop Platform and so on. CMP helps bridge that gap by allowing Android Developers to build for the following platforms using same language and familiar paradigms.</p><ol><li>Android</li><li>Desktop (Windows, macOS as well as Linux)</li><li>Web (via WebAssembly)</li><li>iOS (experimental)</li></ol><p>Recently I just published <a href="https://rioarj.com/">my own simple site</a> using Kotlin/WASM. I use Github page to host my static site instead of buy personal hosting to reduce cost. So I only claim my own domain to make it clean and easily accessible 😜</p><h4>What is Jetpack Compose WASM? 🤔</h4><p>To run Compose on the web, JetBrains uses WebAssembly (WASM). WebAssembly is a binary instruction format that allows code to run in browsers with near-native performance. Unlike JavaScript, WebAssembly offers better efficiency and higher performance.</p><p>Compose for the Web enables you to write UI in Kotlin and Compose, then compile it into WebAssembly to run in the browser — without writing any JavaScript code.</p><h4>Limitations and challenges 🚧</h4><p>While building my site, I face some obstacles that are worth knowing before you dive in:</p><ol><li><strong>Canvas-Style Rendering</strong><br>Compose WASM doesn’t render actual HTMl elements. This means you can’t inspect specific font, color, size and anything about layout specification for specific elements.</li><li><strong>Advanced Layouts<br></strong>Layout debugging tools like Layout Inspector and Compose Preview don’t work on WASM. Those tools is powerful to inspect elements, view hierarchy and preview its layout without deploy to local environment.</li><li><strong>Dependency Setup is Tricky<br></strong>Managing dependencies can be a bit of a hassle. Since Compose WASM is very new, docs are limited, not every external dependency we used is support for WASM, and breaking changes happen frequently.</li><li><strong>Alpha<br></strong>Along with this article, the status is still Alpha. Consider carefully — definitely not read for production if you want to use this approach for high-traffic professional website or you can just safely-go if you want to exploring more such how fast it’s performance compared to JavaScript and so on.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-r-x8qhiHts5Kl6V_t-K5A.png" /><figcaption><a href="https://kotlinlang.org/docs/wasm-overview.html">https://kotlinlang.org/docs/wasm-overview.html</a></figcaption></figure><p>Despite those limitations Compose WASM is great for simple and static site, prototype and learning projects.</p><h4>The Potential of Compose Multiplatform 💎</h4><p>CMP — including WASM is still in its early stages, but its long-term potential is incredibly exciting. Imagine building a modern UI that run natively with minimal effort because you can share business logic, part of UIs and its logic across platform like Android, Desktop and Web using <strong>single codebase</strong>. That dream is becoming more realistic with Compose Multiplatform.</p><h4>Last but not least ⚠️</h4><p>If you curious about building your own apps using CMP, simply 1–2–3 and go!</p><ol><li>Visit <a href="https://kmp.jetbrains.com/?_gl=1*mi30sm*_gcl_au*MTI3NDk3NjE1OS4xNzQxNDE0OTE0*_ga*MTEwODk2MTc4NS4xNzEwNTY2OTkz*_ga_9J976DJZ68*MTc0NDk2Nzk2NS4xMy4xLjE3NDQ5NzE4MzcuNTEuMC4w#newProject">Kotlin Multiplatform Wizard</a>, check projects you need, and click Download</li><li>Open you IDE and open the project</li><li>Once task completes, hit ./gradlew wasmJsBrowserDevelopmentRun -t to run your project</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a581d6e00721" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Static Code Analysis Using Detekt — Kotlin Lang]]></title>
            <link>https://ri0arjuna.medium.com/static-code-analysis-using-detekt-in-kotlin-lang-bba27beaf4a3?source=rss-23b03f37e5c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/bba27beaf4a3</guid>
            <category><![CDATA[refactoring]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[detekt]]></category>
            <category><![CDATA[convention]]></category>
            <dc:creator><![CDATA[Rio Arjuna]]></dc:creator>
            <pubDate>Sun, 01 Sep 2024 13:17:48 GMT</pubDate>
            <atom:updated>2024-09-01T13:24:49.906Z</atom:updated>
            <content:encoded><![CDATA[<h3>Static Code Analysis Using Detekt — Kotlin Lang</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m_Thn08eA7iCK5wF" /><figcaption>Photo by <a href="https://unsplash.com/@trommelkopf?utm_source=medium&amp;utm_medium=referral">Steve Harvey</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Ughhhh.. What Smell Is That?</h3><p>Have you ever heard about Code Smell? It is refers to violation of code design fundamentals that could eventually lead to poor code quality and ginormous technical debt in the future.</p><blockquote>A code smell is a surface indication that usually corresponds to a deeper problem in the system.<br> — <a href="https://martinfowler.com/bliki/CodeSmell.html">Martin Fowler</a></blockquote><p>There are set of categories — based on <a href="https://refactoring.guru/refactoring/smells">refactoring.guru</a> website — about code smells, such as Bloaters, Object-Orientation Abuser and so on.</p><p>Before we do refactor, the first step is analyze the code smell itself.<br>We have to set of rules and let <strong>detekt</strong> do the rest.</p><h3>Getting To Know The Tools 🕵🏼</h3><blockquote><a href="https://github.com/detekt/detekt"><em>detekt</em></a>, a static code analysis tool for the Kotlin language.</blockquote><p>Some powerful features which are offered by detekt:</p><ol><li>Analyze code smells</li><li>Complexity report (based on LOC, cyclomatic complexity and number of code smells)</li><li>Highly configurable rule sets</li><li>Support different report formats (HTML, Markdown, SARIF and even custom reports)</li></ol><p>5. <a href="https://detekt.dev/docs/intro#features">And so on</a>.</p><h3>Integration ⛓️</h3><p>The first straightforward-step is to add gradle plugin on :app level or :another-module level.</p><pre>plugins {<br>    id(&quot;io.gitlab.arturbosch.detekt&quot;) version(&quot;1.23.3&quot;)<br>}<br><br>repositories {<br>    mavenCentral()<br>}</pre><p>Sync you project. Then run detekt by using the following command.</p><pre>./gradlew detekt</pre><p>Once finished, let’s take a look on terminal result.</p><pre>FAILURE: Build failed with an exception.<br><br>* What went wrong:<br>Execution failed for task &#39;:uikit:detekt&#39;.<br>&gt; Analysis failed with 17 weighted issues.</pre><p>Result above indicate 17 issues that have to address as soon as possible before big problem come to the surface.</p><p>If you scroll terminal log you will see complete log. Including path and function, line number and description about what rule you are violated.</p><pre>&gt; Task :uikit:detekt FAILED<br>../uikit/ToolbarUiKit.kt:33:5: The function ToolbarUiKit is too long (68). The maximum length is 60. [LongMethod]<br>../uikit/ToolbarUiKit.kt:33:5: Function names should match the pattern: [a-z][a-zA-Z0-9]* [FunctionNaming]</pre><p>You may feel annoyed to read plain text log. <br>Don’t worry, detekt come with different format reports to make it readable and understandable. Once detekt finished, take a look the following image to see a readable format report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*1alFyVMHCqDtVJuzlo4h6Q.png" /><figcaption>detekt Report Files</figcaption></figure><h3>We Have To Know 🤔</h3><p>Basically, ./gradlew detekt command is enough in small project. In the “<strong>Real World</strong>” project, you may encounter some issues when using Jetpack Compose for instance.</p><pre>../uikit/ToolbarUiKit.kt:33:5: Function names should match the pattern: [a-z][a-zA-Z0-9]* [FunctionNaming]</pre><p>In <a href="https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-api-guidelines.md#compose-baseline-naming-unit-composable-functions-as-entities-do-1">API Guideline for Jetpack Compose</a> we have to write function using PascalCaseLikeThisExample, it’s opposite with detekt rule. That’s why we need generate our own config file.</p><p>Use the following gradle command to generate config file.</p><pre>./gradlew detektGenerateConfig</pre><p>Take a look detekt.yml on the root directory:</p><pre>...<br>config<br>|-detekt<br>|--detekt.yml<br>...</pre><p>Add the following snippet code on build.gradle :</p><pre>android {<br>  ...<br><br>  detekt {<br>    config.setFrom(&quot;$rootDir/config/detekt/detekt.yml&quot;)<br>  }<br><br>  ...<br>}</pre><p>To handle PascalCaseLikeThisExample issue on the Jetpack Compose convention, first open detekt.yml file.</p><p>Search FunctionNaming rule and add ignoreAnnotated: [&#39;Composable&#39;].<br>So the complete rule should look like this👇🏽</p><pre>  FunctionNaming:<br>    ...<br>    ignoreAnnotated: [&#39;Composable&#39;]</pre><p>Now, run detekt gradle command and we will never encounter FunctionNaming issue in Compose function anymore.</p><h3>Thanks to detekt! 🫶🏼</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bba27beaf4a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open Source Vulnerability (OSV) Scanner on Github Action — Android]]></title>
            <link>https://ri0arjuna.medium.com/osv-scanner-2a960f0824f3?source=rss-23b03f37e5c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a960f0824f3</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Rio Arjuna]]></dc:creator>
            <pubDate>Mon, 22 Jul 2024 03:20:49 GMT</pubDate>
            <atom:updated>2024-07-22T03:20:49.599Z</atom:updated>
            <content:encoded><![CDATA[<h3>Open Source Vulnerability (OSV) Scanner on Github Action — Android</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_zVVj00IhuPGXJro" /><figcaption>Photo by <a href="https://unsplash.com/@josenothose?utm_source=medium&amp;utm_medium=referral">Jose Fontano</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Security is one of the most critical thing when we crafting an application. Best practice implementation is beneficial to reduce security issues.</p><p>A lot of implementation approach in android such as Obfuscation, ensure secure communication between Client and Server using SSL/TLS, data encryption using EncryptedSharedPreferences/DataStore, enabled root detection or Play Integrity and many more.</p><p>In this article we want to talk about OSV — Open Source Vulnerability Scanner.</p><blockquote>A distributed vulnerability database for Open Source.<br>An open, precise, and distributed approach to producing and consuming vulnerability information for open source.</blockquote><blockquote>OSV enables developers to identify known third-party open source dependency vulnerabilities that pose genuine risk to their application and its environment, so they can focus remediation efforts on the vulnerabilities that matter and sustainably manage vulnerabilities that do not affect them.</blockquote><p>A lot of ecosystem covered by OSV database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xa6S0Abps9EMOx1aqzy5MA.png" /><figcaption>Ecosystems</figcaption></figure><p>We will integrate OSV and use Vulnerability Scanner in 2 environment:</p><ol><li>Local Machine</li><li>Github Actions</li></ol><h3>Things OSV can do?</h3><ol><li><a href="https://google.github.io/osv-scanner/supported-languages-and-lockfiles/#supported-lockfiles">.lock file scanning</a> with various languages</li><li>Transitive Dependency Scanning for Maven pom.xml.</li><li><a href="https://google.github.io/osv-scanner/experimental/guided-remediation/">Remediation Tools</a></li><li>Further more read <a href="https://google.github.io/osv.dev/">here</a> and <a href="https://google.github.io/osv-scanner/">here</a></li></ol><h3>Local Machine 📠</h3><p>I use macos and using Homebrew to install OSV. <br>If you use Linux or Windows just take a look <a href="https://google.github.io/osv-scanner/installation/#installation">right here</a>.</p><p>Installing OSV Scanner use the following command</p><pre>brew install osv-scanner</pre><p>Once installation finished without any error, we can use osv-scanner actually. But we must to write the path where osv-scanner installed.</p><pre>/Users/{username}/go/bin/osv-scanner --help</pre><p>Too verbose, isn’t it?</p><p>To execute directly, we have to insert script below using the following command — I use zshrc.</p><pre>echo &quot;export PATH=$PATH:/go/bin&quot; -&gt; ~/.zshrc</pre><p>It’s command above is actually just extract the installation directory of osv-scanner installation which ../go/bin. <br>After that, type source ~/.zshrc to execute ~/.zshrc on current environment.</p><p>Now, just scan a directory like the following example</p><pre>$ osv-scanner -r /path/to/your/dir<br>Scanning dir /path/to/your/dir<br>Scanning /path/to/your/dir at commit 3abf70c6a4c3756805a31b9t41a2dfs8074c2bf<br>No issues found</pre><p>There is No issues found as a result when no vulnerability on your apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MmysBsp2QvRPwOdC.png" /><figcaption><a href="https://securitycipher.com/wp-content/uploads/2023/01/Screenshot-2023-01-28-at-1.21.39-AM.png">Vulnerability Found Example</a></figcaption></figure><h3>Github Actions</h3><p>Create new file with YAML format such as osv-scanner.yml.</p><p>The following script is the simple example to scan the project.<br>You can do with your own customization such as do schedule scan, scan on every push, and <a href="https://google.github.io/osv-scanner/github-action/#customization">more</a>.</p><pre>name: OSV-Scanner PR Scan<br><br>on:<br>  pull_request:<br><br><br>permissions:<br>  # Required to upload SARIF file to CodeQL. See: https://github.com/github/codeql-action/issues/2117<br>  actions: read<br>  # Require writing security events to upload SARIF file to security tab<br>  security-events: write<br>  # Only need to read contents<br>  contents: read<br><br>jobs:<br>  scan-pr:<br>    uses: &quot;google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@v1.8.2&quot;</pre><p>And that’s it!</p><ul><li><a href="https://github.com/Rarj/cardx/">GitHub - Rarj/CardX</a></li><li><a href="https://osv.dev/">OSV - Open Source Vulnerabilities</a></li><li><a href="https://google.github.io/osv-scanner/github-action/">GitHub Action</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a960f0824f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[First Project — Magic Mirror² Using Raspberry 5]]></title>
            <link>https://ri0arjuna.medium.com/magic-mirror-2-raspi5-9756dff2dbfc?source=rss-23b03f37e5c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/9756dff2dbfc</guid>
            <category><![CDATA[smart-mirror]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[raspberry-pi-5]]></category>
            <category><![CDATA[projects]]></category>
            <category><![CDATA[magic-mirror]]></category>
            <dc:creator><![CDATA[Rio Arjuna]]></dc:creator>
            <pubDate>Mon, 15 Jul 2024 06:10:34 GMT</pubDate>
            <atom:updated>2024-07-15T06:10:34.589Z</atom:updated>
            <content:encoded><![CDATA[<h3>First Project — Magic Mirror² Using Raspberry 5</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qNhadQGA7DWDh7Kh" /><figcaption>Photo by <a href="https://unsplash.com/@alex_lopez00?utm_source=medium&amp;utm_medium=referral">Alex Lopez</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Project Goals 🎯</h3><p>A lot of articles that discussing a 10 top-“simple” project for raspberry pi. One of the most voted by Raspberry Community is <a href="https://magicmirror.builders/">Magic Mirror²</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*JFzX8sodD7rROtWNqCcqhA.png" /><figcaption>Winner Badge</figcaption></figure><p>I did a small research before jump in to the project. Videos and articles, a lot of them discussing Magic Mirror². I instantly falling in love when I watched most of DIY project and saw the results.</p><p>That’s why I’am curious about this project and try to create one.</p><p>Without any further ado, let’s get started! 🚀</p><h3>DIY Preparations</h3><ol><li>The first of all is make sure you have well installed operating system on raspberry pi</li><li>Acrylic (cheaper for prototyping) or Glass (better)</li><li>Window tint film</li><li>Cutter</li><li>Water spray</li><li>Scrapper (better) or Plastic card (easy way to find and cheaper)</li></ol><blockquote>Note: Acrylic or Glass size must be exactly same with the monitor size.</blockquote><h3>The DIY-Steps 🖼️</h3><p>Unfortunately, I don’t have a step-by-step pictures😞<br>I will explain a crystal-clear steps and hope you will understand.</p><ol><li>Cut the window tint film to the size of the Acrylic.</li><li>Put the acrylic and spray the acrylic surface to prevent the adhesive side of the windows file sticking right away to the surface.</li><li>Peel the plastic layer of the window film completely. Then lay the adhesive side on to the acrylic surface.</li><li>Rub out the bubbles using Scrapper tool start from center of the surface then slide to the another side (left or right).<br>Be careful when you do this because you might scratch the surface.</li><li>After the surface was clean from the bubbles, trim the edges of the window film to fit in to your acrylic.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2vUKO43Bm7G6iqXPgc8kg.jpeg" /></figure><h3>The “Magic” Step 🪄</h3><p>Make sure you “comply” <a href="https://docs.magicmirror.builders/getting-started/requirements.html">the requirements</a> before getting started.</p><p>Open your terminal and type the following instructions</p><ol><li><a href="https://github.com/nodesource/distributions?tab=readme-ov-file#using-debian-as-root-nodejs-22"><strong>Install Node.js</strong></a><br>We will using version 22 and installed on Debian Bookworm (Raspberry Pi 5 default OS)</li><li>Ensure git is also well installed on your machine</li><li>Clone Magic Mirror² repository usinggit clone https://github.com/MagicMirrorOrg/MagicMirror</li><li>Change to directory usingcd MagicMirror/</li><li>Install the application using npm run install-mm → Take a long time (~10 or ~25 minutes), brew your loved coffee and take a break for a while😄</li><li>Make a copy of the config sample file using cp config/config.js.sample config/config.js</li><li>Start the application using npm run start</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*gQZjoWHJiYhI3LiSzpChLg.png" /><figcaption>Magic Mirror² Installation Note</figcaption></figure><p>Now put your DIY-Acrylic-Mirror to the front of your monitor and Voilà! 🎊</p><blockquote>Mirror, mirror on the wall, who’s the fairest of them all? 👑</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*JHcWScGZFrNXkxBILannZQ.png" /><figcaption>The Result</figcaption></figure><h3>Customizations 🛠️</h3><p>You can also create your own module and using it to magic mirror application such as Spotify Player, connecting certain censors to dim the backlight, integrating face recognition and any other complex feature.</p><p>Here is the following 3rd party modules list that you can integrate to express yourself! 🤩</p><ul><li><a href="https://github.com/MagicMirrorOrg/MagicMirror/wiki/3rd-Party-Modules">3rd Party Modules</a></li><li><a href="https://docs.magicmirror.builders/development/introduction.html">Introduction | MagicMirror² Documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9756dff2dbfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Straight-forward Steps to Connect Raspi 5 Remotely Using Raspberry Connect — Beta Version]]></title>
            <link>https://ri0arjuna.medium.com/remote-access-raspi5-0949a21c7311?source=rss-23b03f37e5c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/0949a21c7311</guid>
            <category><![CDATA[raspberry-pi-connect]]></category>
            <category><![CDATA[remote-access]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Rio Arjuna]]></dc:creator>
            <pubDate>Wed, 03 Jul 2024 08:37:37 GMT</pubDate>
            <atom:updated>2024-07-05T09:22:40.198Z</atom:updated>
            <content:encoded><![CDATA[<h3>Straight-forward Steps to Connect Raspi 5 Remotely Using Raspberry Connect — Beta Version</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nhpdv9RtczCVQ5Mb" /><figcaption>Photo by <a href="https://unsplash.com/@jainath?utm_source=medium&amp;utm_medium=referral">Jainath Ponnala</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Announcement 📆</h3><p>Recently — 17th May 2024 on raspberry’s news website announced the beta release version of <a href="https://www.raspberrypi.com/news/raspberry-pi-connect/">Raspberry Pi Connect</a> service.</p><blockquote>A secure and easy-to-use way to access your Raspberry Pi remotely, from anywhere on the planet, using just a web browser.</blockquote><p>Before RPi Connect was released, we were able to access our raspi from SSH or VNC. Its accessible using external software such as Open Real VNC Viewer, TigerVNC and so on.</p><h3>Secure and Powerful? 🔐</h3><p>As Paul Mucur explained how Raspberry Pi Connect works under the hood.</p><blockquote>… we establish a secure peer-to-peer connection between the two using WebRTC: the same real-time communication technology that underpins the in-browser clients for Zoom, Slack, Microsoft Teams, and Google Meet.</blockquote><blockquote>Our “rpi-connect” daemon for Raspberry Pi OS is responsible for listening out for new screen sharing sessions from the Raspberry Pi Connect website, and negotiating the best possible (i.e. lowest latency) connection between the in-browser VNC client and a VNC server running on your device.<br>…</blockquote><p>Its interesting approach pointed out by Paul about secure P2P connection using WebRTC and lowest latency.</p><p>Bear in mind that you might come across the occasional limitations and imperfection due to Raspberry Pi Connect service is running in beta version while this article written.</p><p>Check this link out the Known Issues section</p><p><a href="https://www.raspberrypi.com/documentation/services/connect.html#known-issues">https://www.raspberrypi.com/documentation/services/connect.html#known-issues</a></p><p>Without any further ado, let’s get started!</p><h3>Prerequisites 🔢</h3><ol><li>Raspberry Pi ID was created → Go to<a href="https://id.raspberrypi.com/sign-up">Raspberry Pi ID website</a> if you don’t have one.</li><li>Enabled SSH and VNC (fo Sharing Screen feature) access on your raspberry configuration</li><li>Raspi running a 64-bit distribution of Raspberry Pi OS Bookworm that uses the Wayland window server — RPi 5, RPi 4, RPi 400.</li></ol><h3>First of All</h3><p>Open a terminal, then write the following command line to updates the package index files and upgrade the actual packages installed on your system,</p><pre>$ sudo apt update</pre><pre>$ sudo apt upgrade</pre><p>Make sure there is no error on your terminal log.</p><p>Install rpi-connect service and reboot after successfully installed on your machine.</p><pre>$ sudo apt install rpi-connect</pre><blockquote>Note: If you want to use remote secure shell only, install <a href="https://www.raspberrypi.com/documentation/services/connect.html#connect-lite">rpi-connect-lite</a> instead</blockquote><h3>Link a Raspi with Raspberry Pi ID 🔗</h3><p>Use the following command line to generate verification URL that will connect your raspi with your Raspberry Pi ID,</p><pre>$ rpi-connect signin</pre><p>Command above should print something like the following:</p><pre>Complete sign in by visiting https://connect.raspberrypi.com/verify/XXXX-XXXX</pre><p>Click generated URL above to finished linking your raspi to Raspberry Pi ID.</p><h3>Raspberry Pi Connect Dashboard</h3><p>Visit <a href="https://connect.raspberrypi.com/">https://connect.raspberrypi.com/</a> with your own loved browser and sign in. After signing in, linked devices will available on your dashboard.</p><p>Click Connect Via at the right-corner on your browser and click either Sharing Screen or Remote Shell.</p><h3>Screen Sharing 🖥️</h3><p><a href="https://www.raspberrypi.com/documentation/services/connect.html#screen-sharing">https://www.raspberrypi.com/documentation/services/connect.html#screen-sharing</a></p><h3>Remote Shell 🐚</h3><p><a href="https://www.raspberrypi.com/documentation/services/connect.html#remote-shell">https://www.raspberrypi.com/documentation/services/connect.html#remote-shel</a>l</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0949a21c7311" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Golden Testing Your Compose Library with Paparazzi]]></title>
            <link>https://ri0arjuna.medium.com/golden-testing-your-compose-library-with-paparazzi-81a0248fa7c0?source=rss-23b03f37e5c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/81a0248fa7c0</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[snapshot-testing]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[golden-tests]]></category>
            <dc:creator><![CDATA[Rio Arjuna]]></dc:creator>
            <pubDate>Wed, 26 Jun 2024 01:11:25 GMT</pubDate>
            <atom:updated>2024-06-26T01:11:25.032Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VC0BbaJeCsbnAL_U" /><figcaption>Photo by <a href="https://unsplash.com/@javardh?utm_source=medium&amp;utm_medium=referral">Javardh</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Background Story ⏮️</h3><p>One of hundred challenges of component or library development is ensuring of UI’s consistency. When we talk about UI component , I mean the whole of behavior such as <strong>margin</strong>, <strong>padding</strong>, <strong>text size</strong>, <strong>typography</strong>, <strong>color </strong>and every-single-thing about detail of the UI component itself.</p><p>Most of engineer is not good enough to see the difference between similar UI. Now take a look the following image and say out loud “YOU WRONG!” to me. 😝</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*8Z8vWtDqQP2wULlivsf86Q.png" /></figure><p>Imagine you have 10 component and each component have 3 different types Most of the time we have to assure any changes — even tiny changes haven’t break any functionality.</p><p>Golden Test come to the rescue! 🧑‍🚒</p><h3>What is Golden Testing, anw? 🤔</h3><p>Golden Test also known as <strong>Snapshot Testing </strong>is a technique for ensuring the current component with a “golden” reference or correct version of UI’s component.</p><h3>Libraries 📦</h3><p>There is certain screenshot testing library like <a href="https://github.com/cashapp/paparazzi?tab=readme-ov-file#paparazzi">Paparazzi</a>, <a href="https://github.com/airbnb/Showkase">Showkase</a>, <a href="https://github.com/pedrovgs/Shot?tab=readme-ov-file#what-is-this">Shot </a>and <a href="https://github.com/takahirom/roborazzi?tab=readme-ov-file#roborazzi">Roborazzi</a>.</p><p>In this article we focus on using Paparazzi developed by CashApp. Paparazzi is one of popular screenshot testing library, robust, doesn’t need physical or an emulator, conciseness and also open source.</p><h3>Tasks 🖋️</h3><ol><li><strong>Record </strong>: Saves snapshot as a golden reference.</li><li><strong>Verify </strong>: Tests and verifies against previously-recorded golden reference.</li></ol><blockquote>Notes:<br>1. Failures generate diffs at &lt;module&gt;/build/paparazzi/failures.<br>2. <a href="https://github.com/cashapp/paparazzi?tab=readme-ov-file#git-lfs">It is recommended you use Git LFS (Large File System)</a></blockquote><h3>Setting Up⚙️</h3><p>I’ve created a simple library on Github. Take a look the following link if you interested.</p><p><a href="https://github.com/Rarj/CardX">GitHub - Rarj/CardX</a></p><p>Using DSL</p><pre>plugins {<br>  id &#39;app.cash.paparazzi&#39; version &#39;1.3.4&#39;<br>}</pre><p>Using TOML</p><pre>[versions]<br>paparazzi = &quot;1.3.4&quot;<br><br>[plugins]<br>paparazzi = { id = &quot;app.cash.paparazzi&quot;, version.ref = &quot;paparazzi&quot; }</pre><pre>plugins {<br>  alias(libs.plugins.paparazzi)<br>}</pre><p>Sync your gradle and makesure if you got no error.</p><h3>Implementation 🎢</h3><p>Add @get:Rule like the following snippet</p><pre>class XComponentTest {<br>  <br>  @get:Rule<br>    val paparazzi = Paparazzi(<br>        deviceConfig = PIXEL_5,<br>        theme = &quot;android:Theme.Material.Light.NoActionBar&quot;,<br>    )<br><br>}</pre><pre>class XComponentTest {<br>  ...<br><br>  @Test<br>  fun front_card_component() {<br>    paparazzi.snapshot {<br>      FrontCard(<br>        titleCard = &quot;Visa&quot;,<br>        iconCard = R.drawable.ic_visa,<br>        numberCard = &quot;1234 1234 1234 1234&quot;,<br>        nameCard = &quot;Big Smoke&quot;,<br>        validDate = &quot;01/28&quot;,<br>        frontAnimation = 1f<br>      )<br>    }<br>  }<br><br>}</pre><p>Generate snapshot by recordPaparazziDebug using gradle wrapper to saves a snapshots into src/test/snapshots.</p><pre>./gradlew &lt;your_module&gt;:recordPaparazziDebug</pre><p>After task above finished, you will notice there is a new image-component file on src/test/snapshots</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*6XOLV1zFRPFerOQFSJr5Mw.png" /><figcaption>Generated Snapshot File</figcaption></figure><p>File name structure → &lt;packagename&gt;_&lt;classname&gt;_&lt;functionname&gt;.png.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*BkKFu2WXks6Rde8VOdMzRA.png" /><figcaption>Golden-Component Result</figcaption></figure><p>Commit the generated image file.</p><p>Now, try to make a tiny changes on the component let’s say Font size and then verify by using verifyPaparazziDebug.</p><pre>./gradlew &lt;your_module&gt;:verifyPaparazziDebug</pre><p>You will see a failed assertion on console and take a look a delta image file on &lt;module&gt;/build/paparazzi/failures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2an_Tx1hDQVhMfdHcFi3mg.png" /><figcaption>Delta Snapshot Result</figcaption></figure><h3>Explanations🎨</h3><ol><li><strong>Expected (Left)</strong> : Golden reference or correct version of UI’s component</li><li><strong>Actual (Right)</strong> : Your broken-tiny changes result</li><li><strong>Delta (Mid)</strong> : The diffs between Expected and Actual</li></ol><p>You can integrate through CICD and do verify on each Pull Request.</p><p>Just do you own explorations! 🪜</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*4ha18Ark3jV24FbNwQhm8g.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81a0248fa7c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Efficient App Distribution: Automating AAB Deployment to Firebase with Fastlane]]></title>
            <link>https://ri0arjuna.medium.com/automating-aab-deployment-to-firebase-with-fastlane-727810d3b378?source=rss-23b03f37e5c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/727810d3b378</guid>
            <category><![CDATA[fastlane-android]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[deployment-automation]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Rio Arjuna]]></dc:creator>
            <pubDate>Sat, 22 Jun 2024 03:02:41 GMT</pubDate>
            <atom:updated>2024-06-22T03:02:41.769Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1biOZaLoopK14Ibr" /><figcaption>Photo by <a href="https://unsplash.com/@austris_a?utm_source=medium&amp;utm_medium=referral">Austris Augusts</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Preface?</h3><p>You were here is at least you have 2 reasons.</p><ol><li>You are in the small team and you want to distribute an AAB on each build</li><li>Your SRE or DevOps s*ucks! Back to point number 1 then 🤣</li></ol><h3>Prerequisites</h3><ol><li><a href="https://github.com/rbenv/rbenv?tab=readme-ov-file#installation">rbenv</a> installed</li><li><a href="https://github.com/rbenv/rbenv?tab=readme-ov-file#installation">bundler</a> installed</li><li>Uploaded apps into Play Console → <a href="https://firebase.google.com/docs/app-distribution/android/distribute-fastlane?apptype=aab#aab-upload-required-permissions">Required permission</a> to distribute AABs</li></ol><p>Without any further ado, let’s get started!</p><h3>Fastlane Step ️🏎️</h3><p>First thing first is installing fastlane using your terminal using brew.</p><pre>brew install fastlane</pre><p>You have to make everything sure that fastlane was successfully installed on your machine by typing the following command.</p><pre>fastlane --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*YWjEd8nt2nt1wuVAJG3m1A.png" /><figcaption>Fastlane Version</figcaption></figure><p>After that, we need to initialized fastlane into the project.</p><pre>fastlane init</pre><p>Then input your package name.</p><p>Then Enter or leave blankfor path to the json secret file and type n for download existing metadata and setup metadata management question.</p><p>And follow the instruction till fastlane successfully initialized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e_9fU_jyerlZQzdl0_HD0Q.png" /><figcaption>Fastlane Initialized</figcaption></figure><p>Last but not least, test it using the following command.</p><pre>bundle exec fastlane test</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*ZUNqKaJ7aTKmEWy2jpPLLg.png" /><figcaption>Fastlane Test Finished Successfully</figcaption></figure><h3>Firebase Integration 🔥</h3><p>First thing first, navigate to project and select App Distribution then click Get Started to start using it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*r1bpk5n4feXjcO2dvyIiCg.png" /><figcaption>App Distribution panel</figcaption></figure><h4>Preparing Private Key 🔑</h4><p>Goto your Firebase Project Setting and select Users and Permissions. Take a look at the bottom of the page, click <a href="https://console.cloud.google.com/iam-admin/iam?authuser=0&amp;project=fastlane-b363e&amp;hl=en">Advance permission settings</a> to open IAM and Admin.</p><p>Click Service Accounts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*CWzpQpCCA55nV_Y6GO1biQ.png" /><figcaption>Service Accounts</figcaption></figure><p>Click CREATE SERVICE ACCOUNT</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gxy8w2irAGvFDxtoCbW7jA.png" /><figcaption>Create Service Account</figcaption></figure><p>Fill Service account name and Service account ID and click CREATE AND CONTINUE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P5cLBf41_GXWDuN3L9EYpQ.png" /><figcaption>Service Account Details</figcaption></figure><p>Select role as Firebase App Distribution Admin and click CREATE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VzsP_yaA9nNwNIzCcDbvQA.png" /><figcaption>Service Account Access</figcaption></figure><p>Click on the service account that you just created and select KEYS tab, then ADD KEY</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xVcFDIwLDhGvfi2RuXrm2Q.png" /><figcaption>Add Key</figcaption></figure><p>Select JSON then Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_wFNiJhO22FHWnbFJ7cCcg.png" /><figcaption>JSON Private Key</figcaption></figure><p>Add JSON Private Key into android project — root level.</p><h3>Fastlane Configuration 🚀</h3><p>Once private key created successfully, we need to install firebase plugin before using it</p><pre>fastlane add_plugin firebase_app_distribution</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*RqEbrqkCx9Ks6hvlrADGQQ.png" /><figcaption>Successfully installed plugins</figcaption></figure><p>After that, insert the following snippet into Fastfile.</p><pre>platform :android do<br><br>    desc &quot;Distributing AAB to Firebase&quot;<br>    lane :distribute_aab do<br>        gradle(task: &quot;clean bundleDebug&quot;)<br>        firebase_app_distribution(<br>            app: &quot;1:69281762661561:android:6160eb2asdhu2hj1khc2fc2122&quot;,<br>            service_credentials_file: &quot;fastlane/pc-api-2879878918-973-29aj8qh2.json&quot;,<br>            release_notes: &quot;Lots of amazing new features to test out!&quot;,<br>            android_artifact_type: &quot;AAB&quot;<br>        )<br>    end<br>    <br>    ...<br>end</pre><h3>Almost done, just driving the lane! 🏎️💨</h3><pre>bundle exec fastlane android distribute_aab</pre><p>If you get the configuration done correctly, <strong>VOILÀ! 🎉</strong></p><h3>References 🔗</h3><ul><li><a href="https://docs.fastlane.tools/getting-started/android/setup/">Setup - fastlane docs</a></li><li><a href="https://github.com/rbenv/rbenv?tab=readme-ov-file#installation">GitHub - rbenv/rbenv: Manage your app&#39;s Ruby environment</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=727810d3b378" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[(Maven Series — 3) Publishing android library to Maven Central]]></title>
            <link>https://ri0arjuna.medium.com/maven-series-3-publishing-android-library-to-maven-central-045b4d30a3ec?source=rss-23b03f37e5c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/045b4d30a3ec</guid>
            <category><![CDATA[maven]]></category>
            <category><![CDATA[sonatype]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Rio Arjuna]]></dc:creator>
            <pubDate>Sat, 01 Jun 2024 07:44:09 GMT</pubDate>
            <atom:updated>2024-06-01T07:44:09.480Z</atom:updated>
            <content:encoded><![CDATA[<h3>(Maven Series — 3) Publishing android library to Maven Central</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uwGY4F1N4lTUbbzS" /><figcaption>Photo by <a href="https://unsplash.com/@spacex?utm_source=medium&amp;utm_medium=referral">SpaceX</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this time we will create simple project and integrate with 3rd party library to generate POM with metadata, javadocs and sources with checksum files.</p><p>POM file itself is used by Apache Maven to define our project and its build.</p><h3>What’s inside POM file?</h3><p>Depend on <a href="https://central.sonatype.org/publish/requirements/#sufficient-metadata">Central Sonatype documentation</a>, we need to provide metadata such as:</p><ol><li>Coordinates: groupId , artifactId and version</li><li>Project Name, Description, URL</li><li>License Information</li><li>Developer Information</li><li>SCM Information</li><li>Dependencies used on our project</li></ol><p>Without any further ado, let’s get started!</p><p>Open your loved IDE (in this case we use Android Studio), then create new project as usual.</p><p>Once gradle indexing was done, then create new library module like the following example.</p><blockquote>Right click on your Project -&gt; select New-&gt; select Module</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ktcwLeFILPi60M5D3H9YuA.png" /></figure><p>Select Android Library and fill the form like the following example, then Finish.</p><p>Take a look a Package name field, fill with the correct one of yours.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V5fTkDGpZao8F6RKTbR4Aw.png" /></figure><p>In this step, we will using 3rd party by <a href="https://vanniktech.github.io/gradle-maven-publish-plugin/central/">Niklas Baudy</a> to simplify generating a metadata.</p><p>Add plugin into library module that you want to published then sync project.</p><pre>plugins {<br>  id(&quot;com.vanniktech.maven.publish&quot;) version &quot;0.28.0&quot;<br>}</pre><p>After that, add the following snippet to select host and enabled GPG signing.</p><p>In this case we use SonatypeHost.CENTRAL_PORTAL.</p><pre>import com.vanniktech.maven.publish.SonatypeHost<br><br>mavenPublishing {<br>  publishToMavenCentral(SonatypeHost.DEFAULT)<br>  // or when publishing to https://s01.oss.sonatype.org<br>  publishToMavenCentral(SonatypeHost.S01)<br>  // or when publishing to https://central.sonatype.com/<br>  publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)<br><br>  signAllPublications()<br>}</pre><h4>Configure Coordinates and POM metadata 📦</h4><pre>mavenPublishing {<br>  coordinates(&quot;io.github.username&quot;, &quot;logr&quot;, &quot;0.1.0&quot;)<br><br>  pom {<br>    name.set(&quot;My Library&quot;)<br>    description.set(&quot;A description of what my library does.&quot;)<br>    inceptionYear.set(&quot;2020&quot;)<br>    url.set(&quot;https://github.com/username/mylibrary/&quot;)<br>    licenses {<br>      license {<br>        name.set(&quot;The Apache License, Version 2.0&quot;)<br>        url.set(&quot;http://www.apache.org/licenses/LICENSE-2.0.txt&quot;)<br>        distribution.set(&quot;http://www.apache.org/licenses/LICENSE-2.0.txt&quot;)<br>      }<br>    }<br>    developers {<br>      developer {<br>        id.set(&quot;username&quot;)<br>        name.set(&quot;User Name&quot;)<br>        url.set(&quot;https://github.com/username/&quot;)<br>      }<br>    }<br>    scm {<br>      url.set(&quot;https://github.com/username/mylibrary/&quot;)<br>      connection.set(&quot;scm:git:git://github.com/username/mylibrary.git&quot;)<br>      developerConnection.set(&quot;scm:git:ssh://git@github.com/username/mylibrary.git&quot;)<br>    }<br>  }<br>}</pre><p>Take a look a coordinates(…) , it will provide groupId, artifactId and version. If you want to publish SNAPSHOT version, you can simply add suffix such as 0.1.0-SNAPSHOT.</p><h4>Configure Credentials</h4><p>In this step we can provide Sonatype and GPG credential.</p><p>Open gradle.properties file, and add the following example configurations</p><pre>mavenCentralUsername=username<br>mavenCentralPassword=the_password<br><br>signing.keyId=12345678<br>signing.password=some_password<br>signing.secretKeyRingFile=/Users/yourusername/.gnupg/secring.gpg</pre><p>To provide several credentials above, do the following steps.</p><p>1. mavenCentralUsername and mavenCentralPasswordGo to <a href="https://central.sonatype.com/">Central Sonatype</a> and Login. Then click your Profile icon at the top-right and select View Account. And you will see the following page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vos8In_0pnNA_YsGwKvEIA.png" /></figure><p>Click Generate User Token. Copy-paste Username to mavenCentralUsername and Password to mavenCentralPassword.</p><p>2. signing.keyId : last 8 characters of the public GPG key<br>3. signing.password : passphrase when you creating a GPG key<br>4. signing.secretKeyRingFile : path to your secring.gpg file</p><p>Sync Project and if you see no error happened, it’s a good to go!</p><p>Open your loved terminal, then type the following gradle wrapper command to upload your library into Maven Repository.</p><pre> ./gradlew publishToMavenCentral</pre><p>If you got a BUILD SUCCESSFUL on your terminal, you will see a deployment detail of your component.</p><p>Click the blue Publish button and wait till your component ready to use.</p><h3>What’s Next? Try it and GOTCHA!</h3><pre>implementation(&quot;groupId:artifactId:version&quot;)</pre><p>That’s it! Clap if you found this article useful! 👏🏼</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=045b4d30a3ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[(Maven Series — 2) Generate GPG and Publish]]></title>
            <link>https://ri0arjuna.medium.com/publishing-android-library-to-maven-central-part2-7664b5386e99?source=rss-23b03f37e5c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/7664b5386e99</guid>
            <category><![CDATA[maven]]></category>
            <category><![CDATA[sonatype]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Rio Arjuna]]></dc:creator>
            <pubDate>Sat, 01 Jun 2024 07:43:17 GMT</pubDate>
            <atom:updated>2024-06-01T07:46:52.085Z</atom:updated>
            <content:encoded><![CDATA[<h3>(Maven Series — 2) Generate GPG and Publish</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x__K3ccoaH9y3V94" /><figcaption>Photo by <a href="https://unsplash.com/@dtopkin1?utm_source=medium&amp;utm_medium=referral">Dayne Topkin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the previous article, we talk about registering Sonatype account. Generate GPG and publishing into keyserver.ubuntu.com is the topic we were going talking about at this time.</p><h3>First Thing First!</h3><p>Install GPG on your loved terminal.</p><p>Check your GPG version to make sure you’ve well installed on your loved terminal</p><pre>gpg --version</pre><p>Type gpg --full-gen-key to generate new key and you will see like the following image</p><pre>gpg --full-gen-key</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*Te66EYIQl9RrMv-_tT9tsg.png" /></figure><p>Type 1 to choose RSA and RSA and enter,</p><p>Type 4096 keysize and enter,</p><p>Specify how long the key should be valid depend on instruction, in this case I type 0 to set key doesn’t have expired date.</p><p>Type Y and enter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*UQdsHxnkI0EL-9ZLJ-kPSg.png" /></figure><p>At this step, we need to input a user ID to identify the key like Real Name, Email Address and Comment. And type O when our information was correct.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*A7WFlCm0vGs24gk96A-uIw.png" /></figure><p>After GPG was generated, we need to add Passphrase to protect key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*TrZWIHq_Iga_c8pO0yZtBg.png" /></figure><p>GOTCHA!</p><p>Copy the public key characters and publish it into keyserver.ubuntu.com and enter.</p><pre>gpg --keyserver keyserver.ubuntu.com --send-keys &lt;your_public_key&gt;</pre><p>Open <a href="https://keyserver.ubuntu.com/">Ubuntu Keyserver</a>, copy-paste public key and Search Key to make everything was ready to use.</p><p>Export GPG using the following syntax and you will see a very-loooooonnngg key</p><pre> gpg --armor --export-secret-keys &lt;your_public_key&gt; | pbcopy</pre><p>At this step, we need to create security key ring file using following syntax</p><pre>echo &quot;copy the key here from syntax above&quot; | gpg --dearmor &gt; your_path/secring.gpg</pre><p>Then you will see secring.gpg on your path. Save it for later!</p><p>The next step is create new simple project and integrate 3rd party libs using gradle to help us generate certain requirements for uploading to Maven Central!</p><p>Take a look <a href="https://ri0arjuna.medium.com/maven-series-3-publishing-android-library-to-maven-central-045b4d30a3ec">Part 3</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7664b5386e99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[(Maven Series — 1) Setting up Sonatype Account]]></title>
            <link>https://ri0arjuna.medium.com/publishing-android-library-to-maven-central-part1-6037b215fff1?source=rss-23b03f37e5c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6037b215fff1</guid>
            <category><![CDATA[maven]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[sonatype]]></category>
            <dc:creator><![CDATA[Rio Arjuna]]></dc:creator>
            <pubDate>Sat, 01 Jun 2024 07:42:14 GMT</pubDate>
            <atom:updated>2024-06-01T07:46:16.079Z</atom:updated>
            <content:encoded><![CDATA[<h3>(Maven Series — 1) Setting up Sonatype Account</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vxkj6HcYiP1geTcX" /><figcaption>Photo by <a href="https://unsplash.com/@namu_attic?utm_source=medium&amp;utm_medium=referral">Yury Nam</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Recently, I interested to know how dependencies publish and consume by Android project like androidx, compose and so forth.</p><p>I got some trouble and spent more time to publishing than crafting the libs itself! After trying a week debugging and finally succeeded to publish library to Maven Central.</p><p>The idea behind this article is I want to create a documentation about step and lesson that I learnt.</p><h3>Overview 🗒️</h3><ol><li>Registering and setting up a Sonatype account</li><li>Generating GPG and publishing key</li><li>Creating new android project and library</li><li>Consume the library on Android project! 🚀</li></ol><h3>Prerequisites ⚙️</h3><ol><li>GPG installed (using terminal — macOS, Windows or Linux)</li><li>Android Studio installed</li></ol><p>I will create this documentation into 4 parts. Let’s begin Part 1!</p><h3>Registering and Setting up Sonatype 🏁</h3><p>First thing first, go to <a href="https://central.sonatype.com/">Sonatype</a>, click Sign In either usingGoogle or Github.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xGZfD6v4ST1IxL4yZBTqNg.png" /><figcaption>Sonatype Dashboard</figcaption></figure><p>After successful to Signed In, click Publish then choose Namespace tab and click Add Namespace.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QVFDSqSSojvYM91xsEZHig.png" /><figcaption>Sonatype — Namespace</figcaption></figure><blockquote>In this step we must to reverse the domain to comply naming convention. For example:<br>1. Github Service =&gt;io.github.&lt;username&gt; <br>2. Your own domain =&gt; example.com to com.example <br>Read for more explanations <a href="https://central.sonatype.org/register/namespace/#for-dns">here</a>!</blockquote><p>Input reverse DNS — in this case using github service, then click Submit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GzNXuEp6DEVE43o0pv0X8w.png" /><figcaption>Sonatype — DNS</figcaption></figure><p>Copy Verification Key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U0F2JCYOVM5r6mFKSq0-HQ.png" /><figcaption>Namespace — Verification</figcaption></figure><p>After steps above, open <a href="https://github.com/">Github</a>, Sign in to your account. Then click Create repository at the bottom of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qapNFyFzkXeBV01GQOWfRw.png" /><figcaption>Github — Create Repository</figcaption></figure><p>Back to Sonatype, and click Verify Namespace at the bottom-right of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gAX2mZ9wQAOoRKSfHDWR_Q.png" /></figure><p>If namespace verified it would looks like the following screenshot and its up to you to delete Github Repository that was previously created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yIGXrdcyk3LR3BFB2wQTVg.png" /></figure><p>At this step, we have successfully to create a Sonatype account.</p><p>The next step is create and publish GPG key. Take a look <a href="https://ri0arjuna.medium.com/publishing-android-library-to-maven-central-part2-7664b5386e99">Part 2</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6037b215fff1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>