<?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 Omar Altamimi on Medium]]></title>
        <description><![CDATA[Stories by Omar Altamimi on Medium]]></description>
        <link>https://medium.com/@omar.tamimid1?source=rss-71352656054b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*x_6yz0XcYIDojhgM6CY3Ig.jpeg</url>
            <title>Stories by Omar Altamimi on Medium</title>
            <link>https://medium.com/@omar.tamimid1?source=rss-71352656054b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 08:54:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@omar.tamimid1/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[Building a cross-platform step tracker with Compose Multiplatform]]></title>
            <link>https://proandroiddev.com/my-experience-building-with-compose-multiplatfom-4403f266843a?source=rss-71352656054b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4403f266843a</guid>
            <category><![CDATA[compose-multiplatform]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Omar Altamimi]]></dc:creator>
            <pubDate>Sun, 28 Sep 2025 17:43:30 GMT</pubDate>
            <atom:updated>2025-10-06T17:31:55.102Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wc-FxPF-ju_buBdmgsjQMg.png" /></figure><p>When I set out to build <strong>Steps Share, </strong>a social pedometer that lets friends compare and share steps, I wanted more than just another fitness tracker. The idea was simple: most pedometer apps only track you, but motivation comes when your progress connects with others. That meant building a cross-platform experience from day one, so friends on Android and iOS could stay in sync.<br>Compose Multiplatform (CMP) made that vision possible. Here’s what I learned.</p><p>Full source code : <a href="https://github.com/tamtom/StepsShare-oss">https://github.com/tamtom/StepsShare-oss</a></p><h3>Why Compose Multiplatform?</h3><p>Steps Share combines <strong>step tracking, social sharing, and premium charts</strong> in one app. From the start, I had two goals:</p><ol><li><strong>Feature parity across platforms</strong>: friends shouldn’t get a weaker experience just because they’re on iOS or Android.</li><li><strong>Consistent UI</strong> : charts, progress comparisons, and paywalls should feel the same everywhere, without duplicating effort.</li></ol><p>CMP gave me exactly that. I could share not just business logic, but the <strong>entire UI layer</strong>, while still using expect/actual for platform-specific services like pedometer data, background sync, and deep links.</p><p>Tech stack:</p><ol><li>Koin for DI</li><li><a href="https://github.com/ehsannarmani/ComposeCharts">ComposeCharts</a> for animated CMP charts</li><li><a href="https://github.com/russhwolf/multiplatform-settings">multiplatform-settings</a> for key value persistent data</li><li><a href="https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-navigation.html">Jetbrains navigation-compos</a> for navigation</li><li>SensorManager for Android steps data source &amp; CMPedometer for iOS steps datasource</li><li><a href="https://github.com/mirzemehdi/KMPAuth">KMPAuth</a> for Firebase (Google signing, Apple signing)</li><li><a href="https://github.com/RevenueCat/purchases-kmp">purchases-kmp</a> RevenucCat ( in-app purchase server with cross-platform support)</li><li><a href="https://github.com/Foso/Ktorfit">Ktorfit</a> (HTTP client generator / KSP plugin for Kotlin Multiplatform)</li></ol><h3><strong>Challenges:</strong></h3><p><strong>Steps data source:<br></strong>One of the main challenges was selecting the appropriate steps data source, as this is a platform-specific decision. Initially, I chose HealthKit for iOS and Health Connect for Android. However, after conducting competitive research, I discovered that most pedometer apps on the market rely on CMPedometer for iOS and SensorManager for Android.</p><p>To avoid potential review rejection on iOS, I decided not to request heavy permissions like those required by HealthKit. Instead, I opted for CMPedometer, which provides 14 days of step history upon the initial permission grant.</p><p>On Android, feeling confident with the platform, I initially implemented Health Connect. However, during testing, it returned <strong>0 steps, </strong>even after walking. I found out that Health Connect only works if other connected apps or devices are writing step data to it. It’s designed as a central hub for sharing health and fitness data, not as a tracker itself.</p><p>Due to this limitation, I switched to using SensorManager. While it doesn&#39;t provide any historical data and only starts counting after the initial grant, it begins accumulating data after the last device boot. To handle this, I implemented a caching mechanism that stores the results of the last query, allowing me to append it to the next one to avoid losing any step history.</p><p>We then created a StepsRepository in the common code using expect. On each platform, we implemented the actual StepsRepository that reads from the respective platform-specific data source.</p><p><strong>Background Syncing:<br></strong>Steps Share is both the name and the core functionality of the app — sharing your friends’ steps. To support this, step data needs to be synced with the backend multiple times per day.</p><p>On Android, this was an easy task. Using WorkManager with PeriodicWorkRequestBuilder&lt;StepsSyncWorker&gt;(60, TimeUnit.MINUTES), I was able to trigger the sync task every hour.</p><p>On iOS, however, using BGTaskScheduler doesn’t guarantee that the app will be able to launch or execute the scheduled task reliably. So far, the easiest workaround has been to schedule a daily reminder notification prompting the user to open the app. This reminder is reset each time the user opens the app, ensuring it remains active if the user hasn’t launched the app recently.</p><p>The best solution on iOS is to use HealthKit as the data source, which allows for periodic background syncing by enabling the com.apple.developer.healthkit.background-delivery entitlement.</p><p><strong>IAP with Kotlin Multiplatform<br></strong>One of the trickiest parts of a cross-platform app is handling in-app purchases (IAP) and subscriptions without duplicating billing logic. For Steps Share, <strong>RevenueCat KMP</strong> turned out to be a lifesaver.</p><ul><li>RevenueCat provides a <strong>backend + unified SDK</strong> that wraps StoreKit (iOS) and Play Billing (Android), so you don’t have to build and maintain all that yourself.</li><li>Their <strong>purchases-kmp</strong> library offers the core functionality (fetching offerings, making purchases, checking entitlements) in a shared module.</li><li>Even better: they offer <strong>purchases-kmp-ui</strong>, a Compose Multiplatform UI layer that lets you embed paywall screens via composables in your shared UI code. This means you can design a paywall once and run it on both iOS and Android.</li><li>Because of this setup, you hardly needed any platform-specific purchase logic. Instead of writing two separate paywall UIs or worrying about receipt validation, most of it lived in shared code, saving effort, avoiding duplication, and reducing bugs.</li></ul><p>From my experience, integrating RevenueCat via KMP involved less friction than I expected, it felt like plugging a module into your app, rather than inventing everything from scratch.</p><h3>Biggest Surprise 😮</h3><ul><li>TL;DR: Sharing the UI is a game changer.</li></ul><h3>The Verdict ✨</h3><p>KMP + Compose isn’t just about code sharing, it’s about delivering feature parity and a consistent user experience without compromise. Building a social fitness app with real-time data visualization, friend interactions, and premium features that feels genuinely native on both iOS and Android from a single codebase still feels like magic. Strong community and ecosystem support turned this from “possible” into “pleasant.”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4403f266843a" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/my-experience-building-with-compose-multiplatfom-4403f266843a">Building a cross-platform step tracker with Compose Multiplatform</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Automate Pull Request Creation on Github with Jira Projects]]></title>
            <link>https://medium.com/tech-tajawal/how-we-automate-pull-request-creation-on-github-with-jira-projects-ce2753c3d4af?source=rss-71352656054b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce2753c3d4af</guid>
            <category><![CDATA[jira]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Omar Altamimi]]></dc:creator>
            <pubDate>Fri, 12 Aug 2022 06:45:06 GMT</pubDate>
            <atom:updated>2022-08-14T08:46:03.690Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-upP3IaEaYPQ_ADmV8_NPA.png" /></figure><p>Pull requests are one of the most common actions in the day-to-day work of a developer. Pull requests manage communication, edits, and debugging of requested changes so that they can be merged into a more significant project. Sometimes you receive feedback and learn something new; other times, you add something of value to the reviewer to allow them to learn from it.</p><h3>Pain points of creating pull requests manually</h3><p>Creating a pull request manually is a time-consuming task. To do so, the mobile team at Seera group follows a process of creating a Github branch with the same name as the task id on Jira.</p><p>For example, our Android project on Jira is named Apollo. Every task or story created has the prefix APL to ensure it’s quickly identified.</p><p>So a typical task id will look like this: APL-[auto increment number] after creating the branch.</p><p>Once you’ve completed the requested changes, to push it to Github you have to:</p><ol><li>Click create a pull request on the changed branch through Github</li><li>Select the target branch you want to merge the changes into</li><li>Copy the task name of the Jira ticket as the title of your pull request</li><li>Add the link of the Jira ticket to your pull request description</li><li>Describe your changes and the implementation details</li><li>Add the reviewers of the pull request and finally</li><li>Add a label to categorize your pull request as a bug, task, release task..etc.</li></ol><p>Those seven steps, over and over again. You can see how it can be mind-numbing and reduce creativity and productivity.</p><p>Now imagine all the steps above can be automated with one line!🤯</p><p>It’s possible, and our iOS developer <a href="https://github.com/Latyntsev"><strong>Aleksandr Latyntsev</strong></a><strong> </strong>has written<strong> </strong>a bash script to automate all the actions above. In this article, we’ll share this script with you and explain how to use it for your own processes.</p><h3>Setup The Environment</h3><p>For this batch script automation, we will be using GitHub CLI called <a href="https://github.com/github/hub">hub</a> for extra git command lines, and <a href="https://stedolan.github.io/jq/">jq</a> for parsing the response from JIRA API.<br>So before you can use the script, you’ll need to install both. Click the links below to learn how to install them quickly:</p><p><a href="https://hub.github.com/">How to install hub?</a></p><p><a href="https://stedolan.github.io/jq/download/">How to install jq?</a></p><p>After installing hub, you’ll need to update its settings. First, you’ll need to generate a Github Oath token:</p><p><a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token">How to create Github OathToken?</a><br>Settings<strong>→</strong>Developer settings<strong>→</strong>Personal access tokens<strong>→</strong>Generate new token.</p><p>You can then update the settings by executing the following commands:</p><pre>git config --global hub.protocol https<br>git config --global hub.user [your github username]<br>git config --global hub.token [your github token]</pre><h3><strong>The Script:</strong></h3><p>With the environment set up, you can now execute the script to automate your pull.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/340612c7409fe4e381dd9fe02415422a/href">https://medium.com/media/340612c7409fe4e381dd9fe02415422a/href</a></iframe><p>When reading the comments in the script file, you’ll notice that it just executes the same manual task step by step. However, this script makes the process 100x faster than the manual process.<br> To use the script, you’ll first need to <a href="https://gist.github.com/tamtom/b3fa4119cbaebe444c750938782d8b52/archive/526bc00499f06b1221a190691728290228fba6a8.zip">download it</a>.</p><p>To make the script more dynamic and be able to run locally or remotely, we are passing the variables as environment variables:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d757b458672195ded6b8aa68dedc231/href">https://medium.com/media/1d757b458672195ded6b8aa68dedc231/href</a></iframe><p>You need to append these variables to your environment variables within your ~/.bash_profile or the ~/.zshrc<strong> </strong>file</p><p>In our script, we will use the variables above.,<br>The alias is just a fancy way to execute it. <br>To get the jira_access_token:<br><a href="https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/">How to create Jira API token?</a></p><p><strong>Note</strong> You need to check your terminal type!</p><ul><li>If it’s bash, you can continue with <strong>~/.bash_profile</strong>.</li><li>If it’s Zsh you need to write <strong>~/.zshrc</strong> instead of <strong>~/.bash_profile</strong>.</li></ul><p>You can identify which to choose by the title of your terminal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DGLs6rizg_IPtw1Lis3-4A.png" /><figcaption>zsh terminal type</figcaption></figure><p>Thankfully, the process of editing both files is the same — you simply need to watch the name of the file.</p><p>In some cases, these files may not exist by default, so you will have to create them after determining your terminal type. Here’s how you can see if your files exist and what to do if they don’t:</p><p><strong>1- Check if the File Exists<br></strong>First, check if the file exists. To do so, run these commands:</p><pre><strong>open</strong> ~/.bash_profile<br>or <br><strong>open</strong> ~/.zshrc</pre><p>If it exists, simply edit the values above, and paste them into the file. Then press “Save.”</p><p>2- <strong>If the Files aren’t Found, Create Them<br></strong>Use the following commands to create the right file:</p><pre><strong>touch</strong> ~/.bash_profile<br>or <br><strong>touch</strong> ~/.zshrc</pre><p>After you’ve created the file, simply open it with the command above and add the values above to it.</p><p>3. <strong>Load the File<br></strong>Once you are done, you will need to load the file with this command:</p><pre><strong>source</strong> ~/.bash_profile<br>or <br><strong>source</strong> ~/.zshrc</pre><p>Read <a href="https://medium.com/macoclock/how-to-create-delete-update-bash-profile-in-macos-5f99999ed1e7">How to edit your bash profile</a> for a detailed explanation,</p><p>If you decided to skip this you can inject your values into the script directly (not secure)</p><p>4. <strong>Execute the Script<br></strong>With the environment set up and the script loaded, you can execute the script using this line:</p><blockquote>pr [target branch]</blockquote><p>In some cases, you may get a permission denied error. If so, execute one of the following commands:</p><pre>chmod +x pr <br><strong>or</strong><br>chmod +x path of the script.sh</pre><p><strong>Enhance Your Workflow Precision<br></strong>With this simple batch automation, you can handle multiple minor pull requests at a greater capacity than ever before. This means greater workflow precision and less time spent in manual processes.</p><p>Traditionally, more requests equal more time to initiate the process for review and merging. With this script, we’ve drastically reduced this aspect of production time with this script — and now you can implement those same changes for your own system.</p><p>I hope this article has been helpful for you!</p><p>Remember to share this blog post with those who may benefit — and your comments are always welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce2753c3d4af" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-tajawal/how-we-automate-pull-request-creation-on-github-with-jira-projects-ce2753c3d4af">How We Automate Pull Request Creation on Github with Jira Projects</a> was originally published in <a href="https://medium.com/tech-tajawal">tajawal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 5 lessons learned from building a fully JetPack Compose production app]]></title>
            <link>https://medium.com/tech-tajawal/top-5-lessons-learned-in-fully-compose-production-app-9a2a3bd99913?source=rss-71352656054b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a2a3bd99913</guid>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Omar Altamimi]]></dc:creator>
            <pubDate>Thu, 03 Feb 2022 13:16:15 GMT</pubDate>
            <atom:updated>2022-06-20T06:04:55.487Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I will be highlighting our journey exploring Jetpack compose for the first time and deploying it to production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0agfWibUP7W2XOhUfvkKMA.png" /><figcaption>Almosafer Hosts</figcaption></figure><p>September 2021 we had the opportunity to start a new Android project for our new product Almosafer Hosts, The new app under the umbrella of Almosafer, the leading travel brand in the Middle East, was designed to be used by hosts of chalets (alternative accommodations in KSA) to manage their chalets property listings, pricing and availability., which gave us a clean playground to experiment with new technology such as Jetpack Compose, In this article, I’m highlighting the top things that we learned and the problems we faced in this journey and how we solved them.</p><h3>1- Getting started</h3><p>Android studio is well known for not running successfully after adding a new dependency/upgrading Gradle/plugins and so on... it’s inconvenient and you have to open 10 StackOverflow tabs to find the solution for the unhuman stack trace.</p><p>Thankfully Android documentation came to the rescue by listing what you need to configure your project with the required settings and dependencies.<br><a href="https://developer.android.com/jetpack/compose/interop/adding">Adding Jetpack Compose to your app</a>.</p><p>To summarize things in the documentation:</p><ol><li>You should have the <a href="https://developer.android.com/studio">Android Studio Arctic Fox</a> or a newer version to support Compose.</li><li>Build tool Gradle minimum 7.0.0</li></ol><pre>buildscript {<br>    ...<br>    dependencies {<br>        classpath &quot;com.android.tools.build:gradle:7.0.0&quot;<br>        ...<br>    }<br>}</pre><p>3. Kotlin version minimum</p><pre>plugins {<br>    id &#39;org.jetbrains.kotlin:android&#39; version &#39;1.5.31&#39;<br>}</pre><p>4. You need to set your app’s minimum API level to 21 or higher</p><p>5. Add Jetpack Compose toolkit dependencies</p><pre>dependencies {<br>    // Integration with activities<br>    implementation &#39;androidx.activity:activity-compose:1.3.1&#39;<br>    // Compose Material Design<br>    implementation &#39;androidx.compose.material:material:1.0.5&#39;<br>    // Animations<br>    implementation &#39;androidx.compose.animation:animation:1.0.5&#39;<br>    // Tooling support (Previews, etc.)<br>    implementation &#39;androidx.compose.ui:ui-tooling:1.0.5&#39;<br>    // Integration with ViewModels<br>    implementation &#39;androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha07&#39;<br>    // UI Tests<br>    androidTestImplementation &#39;androidx.compose.ui:ui-test-junit4:1.0.5&#39;<br>}</pre><p>Well, not everything is that simple, so, there is still one issue happening even following the step by step guideline above</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mCMqoPNG2zZUzfTZhkUBkw.png" /><figcaption>Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8</figcaption></figure><p>Solution: Preferences -&gt; Build, Execution, Deployment -&gt; build Tools -&gt; Gradle</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0fO3aZnZsyNG87yz3CgrhA.png" /><figcaption>solution</figcaption></figure><h3>2- Theming</h3><p>Jetpack Compose offers an implementation of <a href="https://material.io/design/introduction">Material Design</a>, A Material Theme contains <a href="https://material.io/design/color/">color</a>, <a href="https://material.io/design/typography/">typography</a>, and <a href="https://material.io/design/shape/">shape</a> attributes. When you customize these attributes, your changes are automatically reflected in the components you use to build your app.</p><p>Jetpack Compose implements these concepts with the <a href="https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#MaterialTheme(androidx.compose.material.Colors,androidx.compose.material.Typography,androidx.compose.material.Shapes,kotlin.Function0)">MaterialTheme</a> composable:</p><pre>MaterialTheme(<br>    colors = …,<br>    typography = …,<br>    shapes = …<br>) {<br>    // app content<br>}</pre><p>Colors are modelled in Compose with the <a href="https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color">Color</a> class, a simple data-holding class.</p><pre>val Red = Color(0xffff0000)<br>val Blue = Color(red = 0f, green = 0f, blue = 1f)</pre><p>Material Design comes designed with built-in, baseline colors that can be used as-is, straight out of the proverbial box.</p><ul><li>Primary and secondary colors</li><li>Variants of primary and secondary colors</li><li>Additional UI colors, such as colors for backgrounds, surfaces, errors, typography, and iconography.</li></ul><p>But in some cases, you need to add an extra color that is sometimes out of the material design guidelines, we faced this issue while developing Almosafer hosts so after digging we found two solutions, first one</p><p>is straightforward, since Color class Kotlin class we can have an extension with the color name</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2019568fbd283cbc1279d75a806a7850/href">https://medium.com/media/2019568fbd283cbc1279d75a806a7850/href</a></iframe><p>or for advanced usage, and the more sustainable solution you can use the <a href="https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocal">CompositionLocal</a> I’ve found this article very helpful how to extend your material theme using CompositionLocal</p><p><a href="https://gustav-karlsson.medium.com/extending-the-jetpack-compose-material-theme-with-more-colors-e1b849390d50">https://gustav-karlsson.medium.com/extending-the-jetpack-compose-material-theme-with-more-colors-e1b849390d50</a></p><p>But in short, the steps are:</p><ul><li>Create your own MyColors the class that holds a reference to Colors as well as your new colors.</li><li>Create a CompositionLocal that holds a MyColor instance.</li><li>Create your theme and wrap the MaterialTheme in a CompositionLocalProvider where the CompositionLocal provides MyColors. Make sure to also assign the Colors instance from MyColors to the MaterialTheme.</li><li>Create an extension property MaterialTheme that refers to the CompositionLocal holding MyColors. This is how you refer to your new colors.</li></ul><h3>3-Navigation</h3><p>Navigation in Compose was the most ambiguous part for us because you are not dealing with Activities or Fragments, from the first thought you are replacing functions, but when you think of the composable as a content screen it start making more sense</p><p>The compose is using Navigation component architecture for navigation but instead of the old XML way it’s composable</p><h3>Setup</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a7f243bdda70004623abaac913e1544/href">https://medium.com/media/0a7f243bdda70004623abaac913e1544/href</a></iframe><p>As the navigation component, you need to create the navigation graph</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86a797bd58ef218fffbe0c2d06b54905/href">https://medium.com/media/86a797bd58ef218fffbe0c2d06b54905/href</a></iframe><p>Creating NavHost composable. The NavHost links the NavController with a navigation graph that specifies the composable destinations that you should be able to navigate between. As you navigate between composables, the content of the NavHost is automatically <a href="https://developer.android.com/jetpack/compose/mental-model#recomposition">recomposed</a>. Each composable destination in your navigation graph is associated with a <em>route</em>.</p><pre>NavHost(navController = navController, startDestination = &quot;profile&quot;) {<br>    composable(&quot;profile&quot;) { Profile(/*...*/) }<br>    composable(&quot;friendslist&quot;) { FriendsList(/*...*/) }<br>    /*...*/<br>}</pre><p>One of the best practices in my opinion is to have a centralized file that contains the whole graph of your app and you pass the navigation actions to your composable with state hoisting instead of passing the navigation controller</p><h3>Navigate with arguments</h3><p>The example below shows how we are passing arguments to composable</p><p>from the first sight you got a feeling of a URL path that contains the information for querying the page</p><pre>NavHost(startDestination = &quot;profile/{userId}&quot;) {<br>    ...<br>    composable(&quot;profile/{userId}&quot;) {...}<br>}<br></pre><p>To pass the argument to the destination, you need to add the value to the route in place of the placeholder in the call to navigate:</p><pre>navController.navigate(&quot;profile/user1234&quot;)</pre><p><strong>Caution:</strong> Passing complex data structures over arguments is considered an anti-pattern. Each destination should be responsible for loading UI data based on the minimum necessary information, such as item IDs. This simplifies process recreation and avoids potential data inconsistencies.</p><p>The note you should consider is that with this type of navigation you should not pass a complex object like Parcelable or serializable here <br>the best explanation for this issue is answered <a href="https://stackoverflow.com/a/69060224/3321991">here</a></p><h3><strong>4- Hidden infinite composition</strong></h3><p>You can easily make mistakes when you are coming from the XML world and stepping into the declarative UI world for the first time, one of the mistakes that can be very harmful is the infinite composition because it may lead to out of memory exceptions, for example, the following scenario for VisualTransformation state</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MkjxSdic5ZrghAYRGjivqw.gif" /><figcaption>custom visual transformer</figcaption></figure><p>To achieve the above behavior we need to have a UI state for the visualTransformation based on specific criteria we switch between our custom visual transformer or the default transformer, since every time we change the text of the TextField the composable will recompose every time we change the text, we wanted to add a country code prefix whenever the phone number is focused or not empty otherwise we put an empty transformer so we ended up with a visualTransformation state that change based on the above condition</p><pre>if (phoneNumber.<em>isNotBlank</em>()) visualTransformation=PrefixTransformation()</pre><p>the above code looks innocent from the first look but it’s actually an infinite composition bug, so once the user enters a text, the composable will recompose and check if the phone number is not empty and that’s true leading to change visualTransofrmation, but since visualTransformation is a UI state and whenever it changes a recomposition will happen and because every time we assign a new PrefixTransformation() it will be a different object from the old one an infinite recomposition occurred, The scary part is that the app was working smoothly and no warning logs about this issue, we found it by coincidence debugging in the same area for a different bug, so watch out your states!.</p><h3>5- states are only for UI</h3><p>Since we are controlling the Ui with our UI state models you may fall into trap of UI state for everything let’s see the following example: <br>You have a login button when you click on it it becomes loading and on success, you navigate to a new screen, so you will create the following code</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5c35a87af937537071d5193be35ef0af/href">https://medium.com/media/5c35a87af937537071d5193be35ef0af/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f5b9939fa8752036651e1ae6cfb4803/href">https://medium.com/media/1f5b9939fa8752036651e1ae6cfb4803/href</a></iframe><p>As you can see here we used the isScucess as UI state the above code will have infinite navigation to the home screen because when you navigate to a new compose using the navigation component, the navigation will trigger a default animation which will trigger a recomposition for the current composable leading to go through the isSuccess check again which is true and trigger the navigation again, yes you are right, infinite loop, the solution for this is how we should consume events in Compose, by having a consumable reactive stream to be consumed, Handling single events in Compose</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/404aea713596788e12a6400621867fa7/href">https://medium.com/media/404aea713596788e12a6400621867fa7/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/31cc71b1d3eca9eeeeac260fca8007a4/href">https://medium.com/media/31cc71b1d3eca9eeeeac260fca8007a4/href</a></iframe><p>Creating this application with Jetpack Compose from scratch has been a very interesting journey and made it easier to learn how Jetpack Compose is working and what its capabilities and its limitations are.</p><p>I hope this article is useful for you.</p><p>Remember to share this blog post, your comments are always welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a2a3bd99913" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tech-tajawal/top-5-lessons-learned-in-fully-compose-production-app-9a2a3bd99913">Top 5 lessons learned from building a fully JetPack Compose production app</a> was originally published in <a href="https://medium.com/tech-tajawal">tajawal</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tagging a release for your Android App using git]]></title>
            <link>https://medium.com/@omar.tamimid1/tagging-a-release-for-your-android-app-using-git-8fd1938d5bdc?source=rss-71352656054b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fd1938d5bdc</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Omar Altamimi]]></dc:creator>
            <pubDate>Sat, 10 Feb 2018 11:47:04 GMT</pubDate>
            <atom:updated>2018-02-10T12:20:40.768Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*tALVhDoxwljdW0YU7IItDQ.png" /></figure><p>The most problem we are facing is <strong>backward compatibility for the app </strong>when upgrading the app, checking that the local database are ok and the old users from old versions wont hit the store with screaming 1 star review about your crashing update.</p><p>so lets assume that you’ve just released the version number 110 and your product team activated the force update for the users who has version 50 or less and a bomb of crashes happened and if you don’t know about tagging you will lose your job or your memory is super enough to know what type of code on your version 50 and fix the problem.</p><p>so here where the tagging come, git Tagging basically<br><strong> is the ability to tag specific points in history as being important. Typically people use this functionality to mark release points (v1.0, and so on).</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*AKSMzPHvnZ80BKZaFNo6jg.png" /></figure><p>so how you can start tagging? <br>tagging technically is super easy you just write this command after releasing a new update .</p><pre>git tag [version number here]<br>git push origin — tags</pre><p>to checkout to that that tag simply using the checkout command</p><pre>git checkout [version number here]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*S4hsVPDfzBoXEtN8d3MLMA.png" /></figure><p><em>(by the way, with Medium’s new clapping feature, if you liked the article, you can actually press the “clap” button </em>multiple <em>times to express how much you liked it!)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fd1938d5bdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>