<?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 Muhammad Yaqoob on Medium]]></title>
        <description><![CDATA[Stories by Muhammad Yaqoob on Medium]]></description>
        <link>https://medium.com/@orbitalsonic?source=rss-e5fc16dbbf3b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Ow63EmN5caKhU8pZ6NQy6w.jpeg</url>
            <title>Stories by Muhammad Yaqoob on Medium</title>
            <link>https://medium.com/@orbitalsonic?source=rss-e5fc16dbbf3b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:32:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@orbitalsonic/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[Stop Repeating Yourself to AI: Building Cursor & Claude Rules for Production Android Apps]]></title>
            <link>https://orbitalsonic.medium.com/stop-repeating-yourself-to-ai-building-cursor-claude-rules-for-production-android-apps-2137cf009e7a?source=rss-e5fc16dbbf3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2137cf009e7a</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[cursor-ai]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[ai-rules]]></category>
            <category><![CDATA[cursorrule]]></category>
            <dc:creator><![CDATA[Muhammad Yaqoob]]></dc:creator>
            <pubDate>Tue, 18 Aug 2026 07:36:14 GMT</pubDate>
            <atom:updated>2026-08-18T07:36:14.781Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_cdAqeXjN8yKTqut3nG4w.png" /></figure><p>AI coding assistants can write Android code incredibly fast.</p><p>But there is a problem most Android developers discover after using them for a while:</p><p><strong>AI knows how to write code, but it does not automatically know how <em>your project</em> should be written.</strong></p><p>You may ask an AI assistant to implement a feature and get perfectly valid Kotlin code, but it might introduce Jetpack Compose into an XML project, create another architecture, add unnecessary libraries, put business logic inside a Fragment, ignore lifecycle problems, hardcode strings, or completely redesign an existing screen.</p><p>The solution is simple:</p><p><strong>Give the AI your engineering rules before asking it to write code.</strong></p><p>This article explains how to create project-level rules for AI coding assistants such as Cursor and Claude Code, how to organize them, how to maintain and update them, and how I structured the rules in my AndroidPilot project.</p><p>The examples and concepts in this article are based on the open-source <a href="https://github.com/orbitalsonic/AndroidPilot">AndroidPilot</a> repository.</p><h3>What Are AI Coding Rules?</h3><p>AI coding rules are instructions that tell an AI assistant how it should work inside your codebase.</p><p>Instead of repeatedly saying:</p><blockquote><em>“Use Kotlin.”</em></blockquote><blockquote><em>“Don’t use Compose.”</em></blockquote><blockquote><em>“Use XML.”</em></blockquote><blockquote><em>“Follow MVI.”</em></blockquote><blockquote><em>“Don’t put business logic in Fragments.”</em></blockquote><blockquote><em>“Use ViewBinding.”</em></blockquote><blockquote><em>“Don’t create another utility.”</em></blockquote><blockquote><em>“Check lifecycle before updating the UI.”</em></blockquote><p>You define these requirements once.</p><p>The AI then uses them as project context while implementing features.</p><p>Think of rules as a <strong>developer handbook for your AI teammate</strong>.</p><p>Your project might have rules such as:</p><pre>Language → Kotlin<br>UI → XML + ViewBinding<br>Architecture → MVVM/MVI<br>DI → Koin<br>Navigation → Jetpack Navigation<br>Async → Coroutines<br>State → StateFlow<br>Minimum SDK → 24<br>Target SDK → 37<br>Module → Single :app module</pre><p>You can also define behavioral rules:</p><pre>Never use Compose.<br>Never use findViewById.<br>Never create duplicate helpers.<br>Never put business logic inside Fragment.<br>Never block the main thread.<br>Always consider lifecycle.<br>Always support dark mode.<br>Always use string resources.<br>Always check API compatibility.</pre><p>This changes how AI approaches your project.</p><h3>Why Rules Matter More Than Bigger Prompts</h3><p>A common workflow looks like this:</p><pre>Developer:<br>&quot;Implement a login screen.&quot;<br>AI:<br>&quot;Sure.&quot;<br>Developer:<br>&quot;Use XML.&quot;<br>AI:<br>&quot;Okay.&quot;<br>Developer:<br>&quot;Use ViewBinding.&quot;<br>AI:<br>&quot;Okay.&quot;<br>Developer:<br>&quot;Don&#39;t use Compose.&quot;<br>AI:<br>&quot;Okay.&quot;<br>Developer:<br>&quot;Use our existing BaseFragment.&quot;<br>AI:<br>&quot;Okay.&quot;<br>Developer:<br>&quot;Use StateFlow.&quot;<br>AI:<br>&quot;Okay.&quot;</pre><p>This becomes exhausting.</p><p>And worse, you eventually forget an important instruction.</p><p>Project rules solve this problem.</p><p>Instead of putting all project standards into every prompt, your prompt can simply be:</p><pre>Implement the login feature.<br>Follow the project rules.</pre><p>The AI already knows the rest.</p><h3>Cursor Rules vs Claude Rules</h3><p>Different AI coding tools use different instruction mechanisms.</p><p>For Cursor, project rules commonly live under:</p><pre>.cursor/rules/</pre><p>Cursor supports rule files using the .mdc format. The AndroidPilot repository uses this approach with individual rules such as:</p><pre>.cursor/<br>└── rules/<br>    ├── 01-tech-stack.mdc<br>    ├── 02-architecture.mdc<br>    ├── 03-ui.mdc<br>    ├── 04-kotlin.mdc<br>    ├── 05-performance.mdc<br>    ├── 06-error-handling.mdc<br>    ├── 07-testing.mdc<br>    ├── 08-project-structure.mdc<br>    ├── 09-android-best-practices.mdc<br>    ├── 10-feature-development.mdc<br>    ├── 11-template-conventions.mdc<br>    ├── 12-new-project.mdc<br>    └── 13-updating-project.mdc</pre><p>The repository currently contains 13 rule files covering everything from technology choices to new-project setup and project upgrades.</p><p>Claude Code can use project-level instructions through CLAUDE.md, while other AI coding tools have their own project instruction formats. Some tools can synchronize common rules across multiple AI assistants.</p><p>The important concept isn’t the filename.</p><p>The important concept is:</p><blockquote><strong><em>Keep your engineering standards close to the project and version-control them with the code.</em></strong></blockquote><h3>The Most Important Rule: Define Your Tech Stack</h3><p>The first rule should answer:</p><p><strong>“What technologies are allowed in this project?”</strong></p><p>For example:</p><pre># Tech Stack<br><br>- Kotlin only<br>- XML layouts only<br>- ViewBinding<br>- Single :app module<br>- MVVM baseline<br>- MVI for state-heavy features<br>- Koin for dependency injection<br>- Kotlin Coroutines<br>- StateFlow<br>- Jetpack Navigation<br>- Material Components<br>- Minimum SDK 24<br>- Target SDK 37</pre><p>The AndroidPilot tech-stack rule goes further and defines Java compatibility, AGP/Gradle conventions, dependency management, R8 configuration, and prohibited technologies.</p><p>It explicitly prevents things such as:</p><pre>Java<br>Jetpack Compose<br>modular architecture<br>second DI frameworks<br>unnecessary libraries<br>GlobalScope<br>AsyncTask<br>findViewById</pre><p>This is extremely useful.</p><p>Imagine your project is XML-based.</p><p>Without rules, AI might decide:</p><blockquote><em>“Compose is the modern Android approach, so I’ll implement this screen using Compose.”</em></blockquote><p>Technically reasonable.</p><p>Architecturally wrong.</p><p>A rule prevents that.</p><h3>Don’t Create One Giant Rules File</h3><p>One of the biggest lessons from AndroidPilot is <strong>separation of concerns applies to AI rules too</strong>.</p><p>Instead of creating:</p><pre>android-rules.md</pre><p>with 2,000 lines of instructions, separate your rules by responsibility.</p><p>For example:</p><pre>01-tech-stack.mdc<br>02-architecture.mdc<br>03-ui.mdc<br>04-kotlin.mdc<br>05-performance.mdc<br>06-error-handling.mdc<br>07-testing.mdc<br>08-project-structure.mdc<br>09-android-best-practices.mdc<br>10-feature-development.mdc<br>11-template-conventions.mdc<br>12-new-project.mdc<br>13-updating-project.mdc</pre><p>Now you can find and update exactly what you need.</p><h3>Rule 1: Tech Stack</h3><p>This rule defines <strong>what the project is built with</strong>.</p><p>For example:</p><pre># Tech Stack<br><br>Language:<br>- Kotlin only<br>UI:<br>- XML<br>- ViewBinding<br>- Material Components<br>Architecture:<br>- MVVM by default<br>- MVI for state-heavy features<br>DI:<br>- Koin<br>Async:<br>- Kotlin Coroutines<br>State:<br>- StateFlow<br>Navigation:<br>- Jetpack Navigation<br>SDK:<br>- minSdk 24<br>- targetSdk 37</pre><p>Keep this rule relatively stable.</p><p>Changing your tech stack is a project-level decision, not something the AI should decide by itself.</p><p>AndroidPilot also puts dependency versions in gradle/libs.versions.toml and instructs the AI not to hardcode dependency versions inside Gradle build files.</p><h3>Rule 2: Architecture</h3><p>Your AI should know where business logic belongs.</p><p>For example:</p><pre># Architecture<br><br>- Follow the existing architecture.<br>- Fragment renders UI and forwards user actions.<br>- ViewModel owns screen state.<br>- Repository handles data access.<br>- Use StateFlow for observable state.<br>- Keep UI state immutable.<br>- Keep dependencies one-directional.<br>- Follow SOLID.<br>- Avoid giant classes.</pre><p>One important idea in AndroidPilot is that <strong>architecture should match the complexity of the feature</strong>.</p><p>Ordinary screens can use MVVM.</p><p>State-heavy screens can use MVI.</p><p>The rule specifically says not to mix both approaches inside a single feature.</p><p>For example:</p><pre>presentation/<br>└── login/<br>    ├── FragmentLogin.kt<br>    ├── LoginViewModel.kt<br>    └── repository/</pre><p>For a complex state-driven feature:</p><pre>presentation/<br>└── checkout/<br>    ├── FragmentCheckout.kt<br>    ├── CheckoutViewModel.kt<br>    ├── state/<br>    │   └── CheckoutUiState.kt<br>    ├── intent/<br>    │   └── CheckoutIntent.kt<br>    └── effect/<br>        └── CheckoutEffect.kt</pre><p>This is much better than telling AI:</p><blockquote><em>“Always use MVI.”</em></blockquote><p>Rules should describe <strong>when</strong> a pattern should be used, not blindly force it everywhere.</p><h3>Rule 3: UI</h3><p>The UI rule should define your visual and resource conventions.</p><p>For example:</p><pre># UI<br><br>- XML only.<br>- ViewBinding only.<br>- Material Components.<br>- Prefer ConstraintLayout.<br>- Use RecyclerView + ListAdapter.<br>- No findViewById.<br>- No hardcoded strings.<br>- No hardcoded colors.<br>- Support light and dark themes.<br>- Use semantic color tokens.<br>- Minimum touch target: 48dp.<br>- Every user-visible string belongs in strings.xml.</pre><p>AndroidPilot also defines naming conventions:</p><pre>activity_*.xml<br>fragment_*.xml<br>item_*.xml<br>dialog_*.xml<br>bg_*<br>ic_*<br>flag_*</pre><p>It uses semantic colors instead of directly referencing palette colors and requires new semantic colors to be defined in both normal and night resources.</p><p>This prevents AI from producing:</p><pre>android:text=&quot;Settings&quot;<br>android:textColor=&quot;#000000&quot;</pre><p>and instead encourages:</p><pre>android:text=&quot;@string/settings&quot;<br>android:textColor=&quot;@color/onSurfaceTitle&quot;</pre><h3>Rule 4: Kotlin</h3><p>Don’t assume AI always follows your preferred Kotlin style.</p><p>Tell it explicitly.</p><p>For example:</p><pre># Kotlin<br><br>- Use idiomatic Kotlin.<br>- Prefer data classes for models.<br>- Use sealed interfaces for state/events/effects.<br>- Prefer val over var.<br>- Avoid !!<br>- Use extension functions when appropriate.<br>- Keep functions small.<br>- Avoid magic numbers.<br>- Use constants for keys.<br>- Prefer immutable collections in public APIs.</pre><p>Coroutine rules are particularly important:</p><pre>- Use viewModelScope in ViewModels.<br>- Use lifecycleScope in UI.<br>- Use repeatOnLifecycle.<br>- Use Dispatchers.IO for I/O and heavy work.<br>- Never block the main thread.<br>- Never use GlobalScope.</pre><p>These conventions are explicitly part of AndroidPilot’s Kotlin rules.</p><h3>Rule 5: Performance</h3><p>AI can generate code that works but is inefficient.</p><p>Your rules should prevent common problems.</p><p>For example:</p><pre># Performance<br><br>- Never perform heavy work on the main thread.<br>- Use ListAdapter + DiffUtil.<br>- Avoid notifyDataSetChanged().<br>- Avoid unnecessary allocations.<br>- Do not perform expensive work in onBindViewHolder.<br>- Do not hold Activity/Fragment/View references in singletons.<br>- Cancel timers and listeners with lifecycle.<br>- Keep Application.onCreate lightweight.<br>- Lazy initialize expensive components.</pre><p>AndroidPilot also specifically addresses RecyclerView binding, memory leaks, startup work, image loading, and rendering performance.</p><p>This is important because AI generally optimizes for <strong>producing an answer</strong>, not necessarily for your application’s long-term performance.</p><p>Your rules provide that missing engineering context.</p><h3>Rule 6: Error Handling</h3><p>A production application cannot simply do this:</p><pre>try {<br>    doSomething()<br>} catch (e: Exception) {<br>}</pre><p>Your AI rules should explicitly prohibit it.</p><p>For example:</p><pre># Error Handling<br><br>Never:<br>- swallow exceptions<br>- leave empty catch blocks<br>- ignore coroutine failures<br>- crash because of missing data<br>Always:<br>- return meaningful Result/UI state<br>- log useful debugging information<br>- show user-friendly messages<br>- recover when possible<br>- handle cancellation correctly<br>- validate user input<br>- validate permissions<br>- validate API responses</pre><p>AndroidPilot also requires UI safety checks before updating a Fragment after asynchronous work, including checking that the Fragment is attached and its view/binding is still valid.</p><h3>Rule 7: Testing</h3><p>Don’t only tell AI how to write production code.</p><p>Tell it how to make that code testable.</p><p>For example:</p><pre># Testing<br><br>- Keep business logic independent from Android.<br>- Inject dependencies.<br>- Avoid hidden dependencies.<br>- Prefer pure functions.<br>- Keep ViewModels testable.<br>- Mock external dependencies only.</pre><p>A useful principle is:</p><blockquote><strong><em>Don’t make everything testable by adding complexity. Make the architecture naturally testable.</em></strong></blockquote><p>AndroidPilot deliberately does not scaffold a testing framework unless tests are requested. When tests are needed, it specifies app/src/test and app/src/androidTest and keeps dependencies in the version catalog.</p><h3>Rule 8: Project Structure</h3><p>AI needs to know where files belong.</p><p>For example:</p><pre>presentation/<br>common/<br>helpers/<br>storage/</pre><p>And a feature might look like:</p><pre>presentation/profile/<br>    FragmentProfile.kt<br>    ProfileViewModel.kt<br>    adapters/<br>    interfaces/<br>    models/<br>    repository/</pre><p>AndroidPilot uses a single :app module and feature-based organization rather than creating a separate module for every feature. It also instructs AI to search existing helpers before creating new ones.</p><p>That last part is extremely valuable.</p><p>Without the rule, AI might see:</p><pre>showToast()</pre><p>and create:</p><pre>ToastUtils.kt</pre><p>even though your project already has a toast helper.</p><p>A good rule says:</p><blockquote><strong><em>Search first. Create second.</em></strong></blockquote><h3>Rule 9: Android Best Practices</h3><p>This rule handles Android-specific problems.</p><p>For example:</p><pre># Android<br><br>Before coding:<br>1. Understand the existing project.<br>2. Reuse existing components.<br>3. Avoid unnecessary refactoring.<br>4. Keep changes focused.<br><br>Always consider:<br>- lifecycle<br>- permissions<br>- API differences<br>- navigation<br>- process death<br>- configuration changes<br>- background execution<br>- battery optimization<br>- notifications<br>- foreground services<br>- R8</pre><p>AndroidPilot also requires lifecycle-aware Flow collection, Safe Args, Activity Result APIs for permissions, API-level guards, and consideration of Android behavior changes across API levels.</p><p>This is where your rules start behaving like a <strong>senior Android engineer’s checklist</strong>.</p><h3>Rule 10: Feature Development Workflow</h3><p>This is arguably the most important rule.</p><p>Don’t tell AI only <strong>what architecture to use</strong>.</p><p>Tell it <strong>how to think before implementing a feature</strong>.</p><p>AndroidPilot defines a multi-step workflow.</p><p>The AI should first:</p><pre>Understand the existing project<br>        ↓<br>Plan the change<br>        ↓<br>Identify affected screens<br>        ↓<br>Identify state/events<br>        ↓<br>Identify data sources<br>        ↓<br>Check permissions<br>        ↓<br>Check lifecycle<br>        ↓<br>Check API differences<br>        ↓<br>Check edge cases<br>        ↓<br>Implement<br>        ↓<br>Verify</pre><p>The repository’s feature-development rule explicitly instructs the AI to inspect existing features, plan before coding, reuse existing components, consider permissions and Android components, handle lifecycle/threading/errors/performance, and verify the final implementation.</p><p>This changes AI behavior dramatically.</p><p>Instead of:</p><pre>User → Feature request → Code</pre><p>you want:</p><pre>User<br> ↓<br>Understand<br> ↓<br>Inspect existing code<br> ↓<br>Plan<br> ↓<br>Implement<br> ↓<br>Check edge cases<br> ↓<br>Verify</pre><h3>Rule 11: Template Conventions</h3><p>If your project already contains reusable infrastructure, document it.</p><p>For example:</p><pre>BaseActivity<br>BaseFragment<br>NavigationHelper<br>ThemeHelper<br>LocaleHelper<br>PermissionHelper<br>ImageHelper<br>SnackbarHelper<br>Dialog helpers<br>SharedPrefManager</pre><p>Tell AI:</p><pre>Before creating a new helper:<br><br>1. Search the existing helpers.<br>2. Reuse an existing implementation if possible.<br>3. Extend existing functionality when appropriate.<br>4. Only create a new helper when necessary.</pre><p>AndroidPilot maintains a dedicated template-conventions rule that catalogs its base classes, helpers, storage, adapters, dialogs, and sample screens.</p><p>This is a powerful concept:</p><blockquote><strong><em>Your AI rules should describe not only what the project believes, but also what the project already provides.</em></strong></blockquote><h3>Treat Rules Like Code</h3><p>This is one of my strongest recommendations.</p><p>Keep your AI rules in Git.</p><p>For example:</p><pre>.cursor/<br>└── rules/</pre><p>Commit them:</p><pre>git add .cursor/rules<br>git commit -m &quot;Add Android engineering rules&quot;</pre><p>Now your rules evolve alongside your application.</p><p>You can review changes:</p><pre>git diff</pre><p>You can revert bad rules.</p><p>You can share them with your team.</p><p>You can use the same rules when a new developer joins the project.</p><p>And most importantly:</p><p><strong>Your AI assistant and your human developers are working from the same engineering standards.</strong></p><h3>How to Know When a Rule Needs Updating</h3><p>A simple rule:</p><h4>Update the rules when the project changes its engineering decisions.</h4><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0x_e0-_K2LdbprzyLv5Pg.png" /></figure><p>Don’t update rules because AI made one mistake.</p><p>Update rules when you’ve discovered a <strong>repeatable project-level requirement</strong>.</p><h3>Bad Rule vs Good Rule</h3><h4>Bad</h4><pre>Write clean Kotlin code.</pre><p>Too vague.</p><p>AI decides what “clean” means.</p><h4>Better</h4><pre>Use idiomatic Kotlin.<br>Prefer val over var.<br>Avoid !!.<br>Keep functions small.<br>Use sealed interfaces for UI events.<br>Expose immutable StateFlow.</pre><p>Much better.</p><h4>Bad</h4><pre>Use good architecture.</pre><h4>Better</h4><pre>Fragments only render UI and forward events.<br>ViewModels own screen state.<br>Repositories handle data access.<br>Business logic must not live inside Activities or Fragments.<br>Use StateFlow for observable state.</pre><p>Now the AI has something enforceable.</p><h3>Don’t Put Everything in alwaysApply</h3><p>Not every rule needs to be loaded for every task.</p><p>Stable project rules are good candidates for always-on behavior:</p><pre>tech stack<br>architecture<br>UI<br>Kotlin<br>performance<br>error handling<br>testing<br>project structure<br>Android best practices</pre><p>Task-specific workflows can be conditional:</p><pre>new project<br>updating project<br>feature development</pre><p>AndroidPilot follows this distinction: the core engineering rules are always applied, while new-project and update workflows are marked as conditional.</p><p>This keeps your rule system organized instead of turning every AI request into a massive context dump.</p><h3>A Practical Rule Structure for Your Own Android App</h3><p>If I were starting a new production Android project today, I would use something like:</p><pre>.cursor/<br>└── rules/<br>    ├── 01-tech-stack.mdc<br>    ├── 02-architecture.mdc<br>    ├── 03-ui.mdc<br>    ├── 04-kotlin.mdc<br>    ├── 05-performance.mdc<br>    ├── 06-error-handling.mdc<br>    ├── 07-testing.mdc<br>    ├── 08-project-structure.mdc<br>    ├── 09-android-best-practices.mdc<br>    ├── 10-feature-development.mdc<br>    ├── 11-project-conventions.mdc<br>    ├── 12-new-project.mdc<br>    └── 13-updating-project.mdc</pre><p>For Claude Code, maintain the equivalent project instructions in the format supported by your Claude workflow, such as CLAUDE.md, rather than assuming Cursor&#39;s .mdc files will automatically be interpreted the same way.</p><p>If you use multiple AI coding assistants, consider maintaining one source of truth and generating/synchronizing the assistant-specific files. Tools such as Rulesync are designed specifically around this problem and support multiple AI assistant instruction formats.</p><h3>A Good Workflow for AI-Assisted Android Development</h3><p>Once your rules exist, your development workflow becomes much simpler.</p><h4>Step 1: Describe the feature</h4><pre>Implement a prayer notification feature.</pre><h4>Step 2: Let AI inspect the project</h4><p>It should identify:</p><pre>Existing architecture<br>Existing notification code<br>Existing permission helpers<br>Existing preferences<br>Existing navigation<br>Existing UI patterns</pre><h4>Step 3: Ask for a plan</h4><pre>Analyze the project and provide an implementation plan before modifying files.</pre><h4>Step 4: Implement</h4><pre>Implement the feature following the project rules.</pre><h4>Step 5: Verify</h4><pre>Review the implementation for:<br>- lifecycle issues<br>- API compatibility<br>- memory leaks<br>- missing resources<br>- missing permissions<br>- navigation issues<br>- dark mode<br>- error handling<br>- build issues</pre><h4>Step 6: Build</h4><pre>./gradlew assembleDebug</pre><h4>Step 7: Review the diff</h4><pre>git diff</pre><p>This is much safer than:</p><pre>&quot;Build the whole feature however you want.&quot;</pre><h3>The Most Important Rule of All</h3><p>There is one rule I would put into almost every AI coding project:</p><blockquote><strong><em>Before writing code, understand the existing codebase.</em></strong></blockquote><p>AI should not immediately start creating files.</p><p>It should first ask:</p><pre>What already exists?<br>What can I reuse?<br>What architecture is already being used?<br>Which helper already solves this?<br>Which feature is most similar?<br>What files will actually change?<br>What Android platform requirements are involved?</pre><p>AndroidPilot explicitly makes this part of its feature-development workflow and instructs the AI to inspect the project, read the closest existing feature, reuse components, and avoid unnecessary refactoring before coding.</p><p>That single principle can prevent a huge amount of AI-generated technical debt.</p><h3>AI Rules Are Your Engineering Constitution</h3><p>AI coding assistants are becoming extremely capable.</p><p>The problem is no longer:</p><blockquote><em>“Can AI write Kotlin?”</em></blockquote><p>The more important question is:</p><blockquote><strong><em>“Can AI write Kotlin that belongs in </em>my<em> codebase?”</em></strong></blockquote><p>That’s what project rules solve.</p><p>A good rule system gives AI:</p><pre>Context<br>+<br>Architecture<br>+<br>Constraints<br>+<br>Conventions<br>+<br>Workflow<br>+<br>Quality standards<br>=<br>Consistent implementation</pre><p>Instead of treating AI as a code generator, treat it like a new senior engineer joining your team.</p><p>You wouldn’t give a new engineer access to a production repository and say:</p><blockquote><em>“Good luck. Figure out our architecture.”</em></blockquote><p>You would give them:</p><ul><li>architecture documentation</li><li>coding standards</li><li>project structure</li><li>conventions</li><li>development workflow</li><li>testing standards</li><li>deployment rules</li></ul><p><strong>Your AI deserves the same context.</strong></p><h3>Final Takeaway</h3><p>If you’re using Cursor, Claude Code, Gemini CLI, GitHub Copilot, or another AI coding assistant for Android development, don’t rely entirely on prompts.</p><p>Build a <strong>project-level rule system</strong>.</p><p>Start small:</p><pre>01-tech-stack<br>02-architecture<br>03-ui<br>04-kotlin<br>05-performance</pre><p>Then grow it as your project grows:</p><pre>error handling<br>testing<br>Android best practices<br>feature workflow<br>project conventions<br>new-project workflow<br>update workflow</pre><p>And keep those rules inside Git alongside your source code.</p><p>Your rules should evolve when your engineering standards evolve.</p><p>The goal isn’t to control every line AI writes.</p><p>The goal is to remove unnecessary guessing.</p><p><strong>The better your project rules are, the less time you spend correcting AI-generated code and the more time you spend actually building your application.</strong></p><h3>Reference: AndroidPilot</h3><p>The concepts in this article are based on the <strong>AndroidPilot</strong> open-source repository, which provides production-oriented Android engineering rules for Cursor and other AI coding assistants.</p><p><a href="https://github.com/orbitalsonic/AndroidPilot">AndroidPilot GitHub Repository</a></p><p>The repository currently contains dedicated rules covering technology stack, architecture, UI, Kotlin, performance, error handling, testing, project structure, Android best practices, feature development, template conventions, new-project setup, and updating existing projects.</p><h4>Rule References</h4><ul><li><a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/01-tech-stack.mdc">01: Tech Stack</a></li><li><a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/02-architecture.mdc">02: Architecture</a></li><li><a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/03-ui.mdc">03: UI</a></li><li><a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/04-kotlin.mdc">04: Kotlin</a></li><li><a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/05-performance.mdc">05: Performance</a></li><li><a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/06-error-handling.mdc">06: Error Handling</a></li><li><a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/07-testing.mdc">07: Testing</a></li><li>0<a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/08-project-structure.mdc">8: Project Structure</a></li><li><a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/09-android-best-practices.mdc">09: Android Best Practices</a></li><li><a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/10-feature-development.mdc">10: Feature Development</a></li><li><a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/11-template-conventions.mdc">11: Template Conventions</a></li><li><a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/12-new-project.mdc">12: New Project Workflow</a></li><li><a href="https://github.com/orbitalsonic/AndroidPilot/blob/master/.cursor/rules/13-updating-project.mdc">13: Updating Project Workflow</a></li></ul><p>If you’re building AI-assisted Android applications seriously, <strong>project rules are not just prompts; they are part of your engineering infrastructure.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2137cf009e7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate AI Stack for Android Development]]></title>
            <link>https://orbitalsonic.medium.com/the-ultimate-ai-stack-for-android-development-f10e88933f20?source=rss-e5fc16dbbf3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f10e88933f20</guid>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[cursor-ai]]></category>
            <category><![CDATA[mobile-development]]></category>
            <dc:creator><![CDATA[Muhammad Yaqoob]]></dc:creator>
            <pubDate>Tue, 28 Jul 2026 12:28:42 GMT</pubDate>
            <atom:updated>2026-07-30T05:33:28.082Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_3wTHGf6iAplLvVjxgVRw.png" /></figure><blockquote><strong><em>Stop asking “Which AI tool is the best?”</em></strong></blockquote><blockquote><em>Instead, ask </em><strong><em>“Which AI tool is best for this stage of development?”</em></strong></blockquote><blockquote><em>The most productive Android developers in now a days don’t rely on a single AI. They build an </em><strong><em>AI-powered engineering workflow</em></strong><em>, where each tool plays a specialised role, just like members of a software team.</em></blockquote><p>Whether you’re building apps with <strong>Kotlin</strong>, <strong>XML/ViewBinding</strong>, <strong>Jetpack Compose</strong>, <strong>MVI</strong>, <strong>MVVM</strong>, or <strong>Clean Architecture</strong>, understanding <strong>where each AI excels</strong> can dramatically improve both development speed and code quality.</p><p>In this article, we’ll explore the complete AI ecosystem for Android development and walk through real-world examples of how these tools work together.</p><h3>Why One AI Tool Isn’t Enough</h3><p>Imagine you’re asked to build a production-ready Alarm application.</p><p>The requirements are simple on paper:</p><ul><li>Support Android 7 (API 24) through Android 17 (API 37)</li><li>Handle Exact Alarms</li><li>Work after device reboot</li><li>Respect Doze Mode</li><li>Support notification permissions</li><li>Handle battery optimisation</li><li>Follow Clean Architecture</li><li>Be production ready</li></ul><p>Many developers immediately open Cursor or another AI coding assistant and ask:</p><blockquote><em>“Build an Alarm App.”</em></blockquote><p>That’s where many AI-assisted projects begin to struggle.</p><p>Professional software development isn’t just writing code.</p><p>A real engineering workflow looks more like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nn9P8sIjmaGjIUX5Anrsqg.png" /></figure><p>Modern AI tools map naturally to each of these stages.</p><h3>The AI Landscape for Android Development</h3><h4>1. AI IDEs &amp; Autonomous Coding Agents</h4><p>These tools understand your project, edit multiple files, execute commands, fix compilation issues, and iterate across the codebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ksFSgDIk7bUS21jNFb07A.png" /></figure><p>These tools are excellent at navigating large projects and making coordinated changes across multiple files.</p><h4>2. AI Chat Models</h4><p>Large language models remain the foundation for reasoning, architecture, debugging, and technical discussions.</p><p>Some of the strongest options include:</p><ul><li>ChatGPT (GPT-5.5)</li><li>Claude 4</li><li>Gemini 2.5 Pro</li><li>Grok</li><li>DeepSeek V3 / R1</li><li>Qwen 3</li><li>Mistral Large</li></ul><p>Unlike coding agents, chat models are especially valuable for explaining concepts, comparing approaches, reviewing designs, and solving complex engineering problems.</p><h4>3. Android Studio AI Features</h4><p>Google has integrated AI directly into Android Studio.</p><p>Capabilities include:</p><ul><li>Code generation</li><li>Project-aware chat</li><li>UI assistance</li><li>Refactoring</li><li>Test generation</li><li>Documentation</li><li>Build debugging</li><li>Crash analysis</li><li>Logcat explanations</li></ul><p>This makes Android Studio an increasingly intelligent development environment rather than just an IDE.</p><h4>4. AI Coding Extensions</h4><p>If you prefer staying inside your existing IDE, several AI extensions provide intelligent code completion and assistance:</p><ul><li>GitHub Copilot</li><li>Codeium</li><li>Continue.dev</li><li>Tabnine</li><li>Supermaven</li><li>Amazon Q Developer</li><li>JetBrains AI Assistant</li></ul><h4>5. AI Models Especially Good for Kotlin</h4><p>These models consistently perform well on Kotlin and Android-related tasks:</p><ul><li>GPT-5.5</li><li>Claude 4</li><li>Gemini 2.5 Pro</li><li>DeepSeek</li><li>Qwen</li><li>Codestral</li><li>CodeLlama</li><li>StarCoder2</li></ul><h4>6. AI Tools for UI Generation</h4><p>Designing Android interfaces has also become AI-assisted.</p><p>Popular tools include:</p><ul><li>Figma AI</li><li>Galileo AI</li><li>Uizard</li><li>Builder.io</li><li>Locofy</li></ul><p>These tools can generate layouts, design systems, icons, and UI assets that developers can adapt for Android.</p><h4>7. AI for Testing</h4><p>Testing is no longer entirely manual.</p><p>Useful AI-powered testing platforms include:</p><ul><li>BrowserStack AI</li><li>LambdaTest KaneAI</li><li>Applitools</li><li>Testim</li></ul><p>They help automate regression testing, cross-device compatibility, and visual validation.</p><h4>8. AI Code Review</h4><p>Before merging code, AI can review pull requests and highlight issues.</p><p>Popular solutions include:</p><ul><li>CodeRabbit</li><li>Cursor Review</li><li>Claude Code</li><li>GitHub Copilot Reviews</li><li>Greptile</li></ul><p>These tools catch bugs, style issues, and architectural inconsistencies before human review.</p><h4>9. AI Documentation</h4><p>Documentation often becomes outdated, but AI can help keep it current.</p><p>Useful platforms include:</p><ul><li>NotebookLM</li><li>Mintlify</li><li>Swimm</li><li>GitBook AI</li><li>Docusaurus AI plugins</li></ul><h4>10. AI for Debugging</h4><p>When something breaks, these tools can analyse stack traces, logs, and compiler errors:</p><ul><li>ChatGPT</li><li>Cursor Agent</li><li>Gemini</li><li>Claude</li><li>Augment Code</li><li>Devin</li></ul><h4>11. AI for Architecture &amp; Planning</h4><p>Before implementation begins, architecture matters.</p><p>Great planning tools include:</p><ul><li>ChatGPT</li><li>Claude</li><li>Gemini</li><li>NotebookLM</li><li>Perplexity</li></ul><p>These tools help design modules, repositories, use cases, state management, dependency injection, and package structures.</p><h4>12. AI Terminal Agents</h4><p>Useful for Gradle, Git, shell commands, and automation.</p><p>Examples include:</p><ul><li>Claude Code</li><li>OpenAI Codex CLI</li><li>Gemini CLI</li><li>Aider</li><li>OpenHands</li><li>Goose</li><li>AmpCode</li></ul><h4>13. AI for Images &amp; Assets</h4><p>Creating icons, marketing assets, illustrations, and screenshots is now much faster.</p><p>Popular options include:</p><ul><li>ChatGPT Images</li><li>Midjourney</li><li>Adobe Firefly</li><li>Ideogram</li><li>Flux</li><li>Stable Diffusion</li></ul><h4>14. AI Voice &amp; Audio</h4><p>Need voiceovers or realistic speech?</p><p>Popular tools include:</p><ul><li>ElevenLabs</li><li>PlayHT</li><li>Cartesia</li></ul><h4>15. AI Backend Generation</h4><p>Backend development is becoming increasingly AI-assisted.</p><p>Useful platforms include:</p><ul><li>Firebase Studio</li><li>Supabase AI</li><li>Convex AI</li><li>Bolt.new</li><li>Lovable</li><li>Replit AI</li></ul><h3>Recommended Tool Stack For Android Development</h3><p>If you’re building modern Android applications, this combination provides an excellent balance of research, architecture, implementation, and validation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iNfBWA1x621of8P-h37rug.png" /></figure><h3>A Real Engineering Example: Building an Alarm App</h3><p>Let’s see how these tools collaborate on a real Android feature.</p><p>Imagine your manager says:</p><blockquote><strong><em>“Build a production-ready Alarm application that supports API 24 to API 37.”</em></strong></blockquote><p>Instead of immediately asking Cursor to write code, follow this workflow.</p><h4>Step 1 — Perplexity Becomes Your Research Analyst</h4><p>Before writing code, you first need to understand how Android has evolved.</p><p>A good prompt might be:</p><blockquote><em>Build an Alarm app for Android API 24–37. Research Exact Alarm permission changes, battery optimisation, notification permissions, PendingIntent updates, reboot behaviour, and official Android best practices.</em></blockquote><p>Perplexity doesn’t generate your implementation.</p><p>Instead, it gathers current knowledge such as:</p><ul><li>Android 13 requires POST_NOTIFICATIONS.</li><li>Android 12 introduced FLAG_IMMUTABLE and FLAG_MUTABLE for PendingIntent.</li><li>Android 14 tightened Exact Alarm restrictions for some apps.</li><li>Alarms should be rescheduled after reboot using BOOT_COMPLETED.</li><li>Battery optimisation should only be ignored when genuinely necessary.</li></ul><p>It also links to:</p><ul><li>Official Android documentation</li><li>Android release notes</li><li>Android Developers Blog</li><li>GitHub discussions</li><li>Stack Overflow</li><li>Reddit community experiences</li></ul><p>At this stage, you haven’t written a single line of code.</p><p>You’ve simply built a reliable checklist.</p><pre>✓ Notification Permission<br>✓ Exact Alarm Permission<br>✓ PendingIntent<br>✓ Boot Receiver<br>✓ AlarmManager<br>✓ Battery Optimisation<br>✓ Android 13 Changes<br>✓ Android 14 Changes<br>✓ Android 15+ Behaviour</pre><p>Research first. Code later.</p><h4>Step 2 — ChatGPT Becomes the Software Architect</h4><p>Now you understand the platform.</p><p>The next question becomes:</p><blockquote><strong><em>How should this application be structured?</em></strong></blockquote><p>Example prompt:</p><pre>Design a production-ready Alarm module using:<br><br>- Kotlin<br>- XML + ViewBinding<br>- MVI<br>- Clean Architecture<br>- Koin<br>- DataStore<br>- API 24–37<br>- Exact Alarm support<br>- Battery optimisation<br>- SOLID principles</pre><p>Rather than jumping into implementation, ChatGPT helps design the architecture.</p><p>Example project structure:</p><pre>presentation/<br>    alarm/<br><br>domain/<br>    repository/<br>    usecase/<br><br>data/<br>    scheduler/<br>    receiver/<br>    datasource/<br><br>service/<br>notification/<br><br>di/</pre><p>It also defines responsibilities:</p><pre>AlarmFragment<br>        │<br>        ▼<br>AlarmViewModel<br>        │<br>        ▼<br>ScheduleAlarmUseCase<br>        │<br>        ▼<br>AlarmRepository<br>        │<br>        ▼<br>AlarmScheduler<br>        │<br>        ▼<br>AlarmManager</pre><p>You now have a clear blueprint before implementation begins.</p><h4>Step 3 — Cursor Becomes the Senior Android Engineer</h4><p>With the architecture approved, implementation becomes much easier.</p><p>Prompt:</p><blockquote><em>Implement the architecture we designed.</em></blockquote><p>Cursor starts creating production code.</p><p>For example:</p><pre>AlarmFragment<br>AlarmViewModel<br>AlarmState<br>AlarmIntent<br>AlarmEffect<br><br>AlarmRepository<br>AlarmRepositoryImpl<br><br>AlarmScheduler<br><br>AlarmReceiver<br>BootReceiver<br><br>NotificationHelper<br><br>SettingsFragment</pre><p>It also updates existing project files:</p><ul><li>AndroidManifest.xml</li><li>build.gradle.kts</li><li>Navigation Graph</li><li>XML layouts</li><li>Koin modules</li><li>strings.xml</li><li>colours.xml</li></ul><p>If the project fails to compile, Cursor can often:</p><ul><li>Read compiler errors</li><li>Fix imports</li><li>Resolve Gradle issues</li><li>Update dependencies</li><li>Retry until the project builds successfully</li></ul><p>This is why Cursor feels like working alongside a senior Android engineer who understands your entire codebase.</p><h4>Step 4 — Gemini Becomes the Android Platform Specialist</h4><p>The application now compiles.</p><p>But is it aligned with current Android guidance?</p><p>That’s where Gemini provides value.</p><p>Example prompt:</p><blockquote><em>Review this Alarm implementation. Does it follow Android 17 best practices?</em></blockquote><p>Gemini may suggest improvements such as:</p><ul><li>Replace a background BroadcastReceiver with WorkManager where appropriate.</li><li>Use FLAG_IMMUTABLE for PendingIntent on Android 12+.</li><li>Explain how Doze Mode affects alarm delivery.</li><li>Request notification permission before scheduling notifications on Android 13+.</li><li>Recommend more suitable Jetpack APIs.</li></ul><p>Rather than writing large amounts of code, Gemini validates whether your implementation aligns with modern Android platform behaviour.</p><h3>Another Example: Building a Habit Tracker App</h3><p>The same workflow applies to other Android applications.</p><p>Imagine you’re building a <strong>Habit Tracker app</strong> that helps users build daily habits, track progress, and receive reminders.</p><h4>Step 1 — Research (Perplexity)</h4><p><strong>Ask:</strong></p><blockquote><em>What are the best practices for designing a habit tracking app? How do successful apps like Habitica, Loop Habit Tracker, and Streaks motivate users?</em></blockquote><p><strong>You’ll get:</strong></p><ul><li>Habit tracking methodologies</li><li>Streak calculation techniques</li><li>UX best practices</li><li>Reminder strategies</li><li>Data modelling approaches</li><li>Community recommendations</li><li>Relevant Android libraries</li></ul><h4>Step 2 — Architecture (ChatGPT)</h4><p><strong>Ask:</strong></p><blockquote><em>Design a Habit Tracker module using MVI, Clean Architecture, Room, DataStore, WorkManager, and Offline Support.</em></blockquote><p><strong>Result:</strong></p><ul><li>Feature architecture</li><li>Package structure</li><li>Database schema</li><li>Repository interfaces</li><li>Use Cases</li><li>UI State &amp; Intent design</li><li>Reminder scheduling strategy</li><li>Offline-first data flow</li></ul><h4>Step 3 — Implementation (Cursor)</h4><p><strong>Ask:</strong></p><blockquote><em>Implement the Habit Tracker module based on this architecture while following the existing project structure.</em></blockquote><p><strong>Cursor generates:</strong></p><ul><li>Habit creation screens</li><li>Habit list UI</li><li>Progress tracking</li><li>Room database</li><li>Repository implementations</li><li>ViewModels</li><li>Reminder scheduling</li><li>Statistics screens</li><li>Unit tests</li><li>Project-wide integration</li></ul><h4>Step 4 — Platform Validation (Gemini)</h4><p><strong>Ask:</strong></p><blockquote><em>Review this implementation. Is it following the latest Android recommendations for Room, WorkManager, notifications, and background work?</em></blockquote><p><strong>Gemini validates:</strong></p><ul><li>Room implementation</li><li>WorkManager usage</li><li>Notification APIs</li><li>Background execution</li><li>Battery efficiency</li><li>Lifecycle handling</li><li>Compatibility with the latest Android SDK</li></ul><h3>The AI Team Analogy</h3><p>Think of each tool as a specialist on your engineering team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cclQF1Lx57oXdeOz7BLSMQ.png" /></figure><p>Each tool solves a different problem, and together they create a much stronger development workflow than relying on a single AI assistant.</p><h3>The Complete Workflow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tCEz6qI_x1LHnmMSGPr3w.png" /></figure><h3>Conclusion</h3><p>AI is transforming Android development, but the biggest productivity gains don’t come from asking one tool to do everything. They come from using the <strong>right tool at the right stage</strong>.</p><p>A successful Android engineer still owns the final product. AI can accelerate research, propose architectures, generate code, review implementations, and explain platform behaviour — but it doesn’t replace engineering judgement, testing, or product understanding.</p><p>Treat AI as a team of specialists rather than a single all-knowing assistant:</p><ul><li><strong>Perplexity</strong> uncovers the latest Android knowledge.</li><li><strong>ChatGPT</strong> designs maintainable architectures and implementation plans.</li><li><strong>Cursor</strong> turns those plans into production-ready code.</li><li><strong>Gemini</strong> ensures your implementation aligns with Android platform guidance.</li><li><strong>You</strong>, the developer, make the final technical decisions, validate quality, and deliver software users can trust.</li></ul><p>The future of Android development isn’t about replacing developers with AI. It’s about empowering developers with an AI-powered workflow that mirrors how high-performing engineering teams already operate.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f10e88933f20" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Location Finder on Android with MVI, StateFlow, and Clean Architecture]]></title>
            <link>https://orbitalsonic.medium.com/location-finder-on-android-with-mvi-stateflow-and-clean-architecture-81a890127111?source=rss-e5fc16dbbf3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/81a890127111</guid>
            <category><![CDATA[android-location]]></category>
            <category><![CDATA[location-services]]></category>
            <category><![CDATA[google-location-services]]></category>
            <category><![CDATA[location-finder]]></category>
            <category><![CDATA[gps-location-tracking]]></category>
            <dc:creator><![CDATA[Muhammad Yaqoob]]></dc:creator>
            <pubDate>Mon, 20 Jul 2026 11:36:30 GMT</pubDate>
            <atom:updated>2026-07-20T11:36:30.886Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5j9dw94pYCQaKQAnovKNgA.png" /></figure><p>A practical guide to unidirectional data flow, Google Location Services, DataStore caching, and scalable Android architecture.</p><p>Location looks easy on Android.</p><p>Request permission, fetch coordinates, display them on the screen, and you’re done.</p><p>Until reality happens.</p><p>The user permanently denies permission. GPS is disabled. FusedLocationProviderClient returns null. Geocoder behaves differently on Android 13. The Activity recreates during rotation, and half the UI state disappears. Somewhere in the middle, multiple callbacks start updating views independently, and debugging becomes a nightmare.</p><p>These are the problems that separate demo applications from production applications.</p><p>To explore a cleaner approach, I built <strong>Location Finder MVI Android</strong>, a small open-source project demonstrating how to build a real-world location feature using <strong>MVI (Model-View-Intent)</strong>, <strong>StateFlow</strong>, <strong>Kotlin Coroutines</strong>, and <strong>Clean Architecture</strong>.</p><p>The app intentionally focuses on one screen and one responsibility, but the architecture is designed to scale to much larger applications.</p><p>The complete source code is available here:</p><p>⭐ <strong>GitHub Repository</strong></p><p><a href="https://github.com/orbitalsonic/Location-Finder-MVI-Android">https://github.com/orbitalsonic/Location-Finder-MVI-Android</a></p><h3>Why I Built This Project</h3><p>Most location tutorials stop here:</p><pre>fusedLocationClient.lastLocation.addOnSuccessListener {<br>    // Update TextView<br>}</pre><p>That works for a tutorial.</p><p>It doesn’t work for a production app.</p><p>I wanted a project that handled the boring but important problems:</p><ul><li>Showing cached data immediately</li><li>Fetching fresh location in the background</li><li>Handling permission denial properly</li><li>Handling permanently denied permissions</li><li>Detecting disabled GPS</li><li>Reverse geocoding addresses</li><li>Preserving state during configuration changes</li><li>Keeping Android APIs away from business logic</li><li>Avoiding callback-heavy UI code</li></ul><p>MVI provided exactly the structure I needed:</p><pre>Intent → ViewModel → Repository → State → UI</pre><p>Once every action follows this flow, the application becomes dramatically easier to reason about.</p><h3>Features</h3><p>Location Finder includes:</p><p>✅ Current latitude &amp; longitude</p><p>✅ Reverse geocoding</p><p>✅ Full address, short address, city, and country</p><p>✅ Cached location on startup</p><p>✅ Fresh location refresh</p><p>✅ Smart cache updates (300m movement threshold)</p><p>✅ Cache fallback when fresh fetch fails</p><p>✅ Permission rationale handling</p><p>✅ Permanent denial settings redirection</p><p>✅ GPS disabled detection</p><p>✅ Cache status indicator</p><p>The UI is intentionally simple and built using:</p><ul><li>XML</li><li>ViewBinding</li><li>Material Components</li><li>MaterialCardView</li><li>MaterialButton</li></ul><p>The focus is architecture, not UI complexity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZJK1OxqkjdKQLYA9kueXjA.png" /></figure><h3>Project Structure</h3><pre>presentation/<br>│<br>├── LocationViewModel.kt<br>├── LocationIntent.kt<br>├── LocationState.kt<br>└── LocationEffect.kt<br>domain/<br>│<br>├── LocationData.kt<br>├── LocationFailure.kt<br>└── LocationRepository.kt<br>data/<br>│<br>├── LocationRepositoryImpl.kt<br>├── LocationRemoteDataSource.kt<br>└── LocationCacheDataStore.kt</pre><p>The project follows a lightweight three-layer architecture:</p><pre>Presentation<br>     ↓<br>Domain<br>     ↓<br>Data</pre><p>Each layer has a single responsibility.</p><h3>Understanding MVI</h3><p>The application uses <strong>Intent → State → Effect</strong>.</p><pre>User Action<br>     ↓<br>Intent<br>     ↓<br>ViewModel<br>     ↓<br>Repository<br>     ↓<br>State<br>     ↓<br>UI</pre><p>Instead of mutating multiple views independently, the UI simply renders immutable state.</p><h3>Intents</h3><p>Every user action becomes an Intent.</p><pre>sealed class LocationIntent {<br>data class Initialize(<br>        val hasPermission: Boolean<br>    ) : LocationIntent()<br>    data class Refresh(<br>        val hasPermission: Boolean<br>    ) : LocationIntent()<br>    data object PermissionRationaleRequired :<br>        LocationIntent()<br>    data object PermissionPermanentlyDenied :<br>        LocationIntent()<br>    data object OpenAppSettingsRequested :<br>        LocationIntent()<br>    data object OpenGpsSettingsRequested :<br>        LocationIntent()<br>}</pre><p>The Activity never talks directly to repositories.</p><p>It only sends intents.</p><h3>State</h3><p>The entire screen is represented by a single immutable state object.</p><pre>data class LocationState(<br>    val isLoading: Boolean = false,<br>    val location: LocationData? = null,<br>    val cacheStatus: CacheStatus = CacheStatus.None,<br>    val errorMessage: String? = null<br>)</pre><p>This becomes the <strong>single source of truth</strong> for the UI.</p><h3>Effects</h3><p>Dialogs, navigation, and Snackbars should not live inside state.</p><p>They belong in Effects.</p><pre>sealed class LocationEffect {<br>data object RequestPermission :<br>        LocationEffect()<br>    data object ShowPermissionRationaleDialog :<br>        LocationEffect()<br>    data object OpenAppSettings :<br>        LocationEffect()<br>    data class ShowMessage(<br>        val message: String<br>    ) : LocationEffect()<br>}</pre><p>This avoids duplicate dialogs after rotation.</p><h3>ViewModel Intent Handling</h3><p>Every action enters the ViewModel through a single entry point.</p><pre>fun onIntent(intent: LocationIntent) {<br>when (intent) {<br>        is LocationIntent.Initialize -&gt;<br>            initialize(intent.hasPermission)<br>        is LocationIntent.Refresh -&gt;<br>            refresh(intent.hasPermission)<br>        LocationIntent.PermissionRationaleRequired -&gt;<br>            emitEffect(<br>                LocationEffect<br>                    .ShowPermissionRationaleDialog<br>            )<br>        LocationIntent.PermissionPermanentlyDenied -&gt;<br>            emitEffect(<br>                LocationEffect.OpenAppSettings<br>            )<br>        else -&gt; {}<br>    }<br>}</pre><p>Having one entry point keeps the flow predictable and easy to debug.</p><h3>StateFlow Instead of LiveData</h3><p>The project uses StateFlow from top to bottom.</p><p>The Activity simply collects state:</p><pre>lifecycleScope.launch {<br>repeatOnLifecycle(<br>        Lifecycle.State.STARTED<br>    ) {<br>        viewModel.state.collect(<br>            ::renderState<br>        )<br>    }<br>}</pre><p>Whenever the Activity stops, collection automatically pauses.</p><p>No manual observer cleanup required.</p><h3>Rendering UI</h3><p>The UI becomes a pure function of state.</p><pre>private fun renderState(<br>    state: LocationState<br>) {<br>binding.progress.isVisible =<br>        state.isLoading<br>    state.location?.let {<br>        binding.tvCity.text =<br>            it.city<br>        binding.tvCountry.text =<br>            it.country<br>        binding.tvLatitude.text =<br>            it.latitude.toString()<br>        binding.tvLongitude.text =<br>            it.longitude.toString()<br>    }<br>}</pre><p>Every update comes from a full state snapshot.</p><p>No scattered callbacks.</p><p>No hidden mutable flags.</p><h3>Repository Layer</h3><p>The repository coordinates local and remote data.</p><pre>override suspend fun fetchFreshLocation():<br>    Result&lt;LocationData&gt; {<br>val location =<br>        remoteDataSource<br>            .getCurrentLocation()<br>    saveLocationIfMoved(<br>        previous =<br>            cacheDataStore.getLocation(),<br>        new = location<br>    )<br>    return Result.success(location)<br>}</pre><p>The ViewModel never knows whether data came from cache or GPS.</p><p>That complexity belongs in the repository.</p><h3>Smart Cache Updates</h3><p>Blindly writing every location update wastes I/O and battery.</p><p>Instead, the repository only saves when the user meaningfully moved.</p><pre>override suspend fun saveLocationIfMoved(<br>    previous: LocationData?,<br>    new: LocationData<br>) {<br>if (<br>        previous == null ||<br>        distanceInMeters(<br>            previous,<br>            new<br>        ) &gt; MIN_DISTANCE_TO_UPDATE_METERS<br>    ) {<br>        cacheDataStore.saveLocation(new)<br>    }<br>}</pre><p>This keeps DataStore writes efficient.</p><h3>Cache First, Fetch Second</h3><p>The startup flow looks like this:</p><pre>Load Cache<br>     ↓<br>Show Cached Data<br>     ↓<br>Fetch GPS<br>     ↓<br>Update State<br>     ↓<br>Save If Moved</pre><p>Showing cached data first makes cold starts feel almost instant.</p><h3>Requesting Location with Coroutines</h3><p>Google Location APIs use callbacks.</p><p>The project converts them into suspend functions using suspendCancellableCoroutine.</p><pre>private suspend fun requestCurrentLocation():<br>    Location? {<br>return suspendCancellableCoroutine {<br>        continuation -&gt;<br>        val tokenSource =<br>            CancellationTokenSource()<br>        continuation<br>            .invokeOnCancellation {<br>                tokenSource.cancel()<br>            }<br>        val request =<br>            CurrentLocationRequest<br>                .Builder()<br>                .setPriority(<br>                    Priority<br>                        .PRIORITY_HIGH_ACCURACY<br>                )<br>                .build()<br>        fusedLocationProviderClient<br>            .getCurrentLocation(<br>                request,<br>                tokenSource.token<br>            )<br>            .addOnSuccessListener {<br>                continuation.resume(it)<br>            }<br>            .addOnFailureListener {<br>                continuation<br>                    .resumeWithException(it)<br>            }<br>    }<br>}</pre><p>Wrapping callback APIs with coroutines dramatically improves readability.</p><h3>Permission Handling</h3><p>There are actually three permission outcomes:</p><ol><li>Granted</li><li>Denied</li><li>Permanently denied</li></ol><p>The Activity converts those results into intents.</p><pre>private val permissionLauncher =<br>    registerForActivityResult(<br>        ActivityResultContracts<br>            .RequestMultiplePermissions()<br>    ) { result -&gt;<br>val granted =<br>            result[<br>                Manifest.permission<br>                    .ACCESS_FINE_LOCATION<br>            ] == true ||<br>            result[<br>                Manifest.permission<br>                    .ACCESS_COARSE_LOCATION<br>            ] == true<br>        if (granted) {<br>            viewModel.onIntent(<br>                LocationIntent.Refresh(true)<br>            )<br>        } else if (<br>            shouldShowLocationPermissionRationale()<br>        ) {<br>            viewModel.onIntent(<br>                LocationIntent<br>                    .PermissionRationaleRequired<br>            )<br>        } else {<br>            viewModel.onIntent(<br>                LocationIntent<br>                    .PermissionPermanentlyDenied<br>            )<br>        }<br>    }</pre><p>The ViewModel remains completely unaware of Android permission APIs.</p><h3>Geocoder API Differences</h3><p>Android 13 introduced asynchronous Geocoder APIs.</p><p>The data source handles both implementations.</p><pre>return if (<br>    Build.VERSION.SDK_INT &gt;=<br>    Build.VERSION_CODES.TIRAMISU<br>) {<br>suspendCancellableCoroutine {<br>        continuation -&gt;<br>        geocoder.getFromLocation(<br>            latitude,<br>            longitude,<br>            1<br>        ) { list -&gt;<br>            continuation.resume(<br>                list ?: emptyList()<br>            )<br>        }<br>    }<br>} else {<br>    @Suppress(&quot;DEPRECATION&quot;)<br>    geocoder.getFromLocation(<br>        latitude,<br>        longitude,<br>        1<br>    ) ?: emptyList()<br>}</pre><p>The ViewModel never touches Geocoder directly.</p><p>Exactly where this complexity belongs.</p><h3>Modeling Failures</h3><p>Instead of throwing random exceptions across layers, failures become domain models.</p><pre>sealed class LocationFailure {<br>data object PermissionDenied :<br>        LocationFailure()<br>    data object PermissionPermanentlyDenied :<br>        LocationFailure()<br>    data object GpsDisabled :<br>        LocationFailure()<br>    data object NullLocation :<br>        LocationFailure()<br>    data class Unknown(<br>        val message: String?<br>    ) : LocationFailure()<br>}</pre><p>The ViewModel decides how each failure should affect state.</p><pre>private fun handleFailure(<br>    failure: LocationFailure<br>) {<br>when (failure) {<br>        LocationFailure.GpsDisabled -&gt; {<br>            emitEffect(<br>                LocationEffect<br>                    .ShowEnableGpsDialog<br>            )<br>        }<br>        LocationFailure.PermissionDenied -&gt; {<br>            emitEffect(<br>                LocationEffect<br>                    .RequestPermission<br>            )<br>        }<br>        else -&gt; Unit<br>    }<br>}</pre><p>Explicit failures scale much better than string-matching exceptions.</p><h3>What Makes This Architecture Scalable?</h3><p>Every feature follows the same flow.</p><pre>Intent<br> ↓<br>ViewModel<br> ↓<br>Repository<br> ↓<br>State<br> ↓<br>UI</pre><p>Once the team understands that pattern, adding new features becomes significantly easier.</p><p>No architecture drift.</p><p>No callback spaghetti.</p><p>No hidden state.</p><h3>Lessons Learned</h3><h4>Cache first, fetch second.</h4><p>Instant startup feels dramatically better.</p><h4>Separate state from effects.</h4><p>Dialogs do not belong inside immutable state.</p><h4>Model failures.</h4><p>Typed failures are easier to maintain than exceptions.</p><h4>Keep Android APIs at the edges.</h4><p>Activities and data sources should handle Android.</p><p>Your domain layer should not.</p><h3>Conclusion</h3><p>Location isn’t difficult because of the API.</p><p>It’s difficult because of everything around the API:</p><ul><li>Permissions</li><li>GPS settings</li><li>Lifecycle</li><li>Caching</li><li>Async work</li><li>Configuration changes</li><li>API-level differences</li></ul><p>Architecture is what keeps those problems manageable.</p><p>By combining <strong>MVI</strong>, <strong>StateFlow</strong>, <strong>Kotlin Coroutines</strong>, <strong>Clean Architecture</strong>, <strong>DataStore</strong>, and <strong>Google Location Services</strong>, Location Finder demonstrates how a small feature can remain predictable, scalable, and maintainable.</p><p>If you’re learning MVI or modern Android architecture, I hope this project serves as a useful reference.</p><p>⭐ If you find it helpful, consider giving the repository a star on GitHub.</p><p><a href="https://github.com/orbitalsonic/Location-Finder-MVI-Android">https://github.com/orbitalsonic/Location-Finder-MVI-Android</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81a890127111" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Production-Ready Android Clock Widget (Complete Guide)]]></title>
            <link>https://orbitalsonic.medium.com/building-a-production-ready-android-clock-widget-complete-guide-0ab32bc5e2ae?source=rss-e5fc16dbbf3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ab32bc5e2ae</guid>
            <category><![CDATA[clock-widgets-android]]></category>
            <category><![CDATA[best-android-widgets]]></category>
            <category><![CDATA[widgets-in-android]]></category>
            <category><![CDATA[android-widget]]></category>
            <category><![CDATA[widget]]></category>
            <dc:creator><![CDATA[Muhammad Yaqoob]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 12:39:22 GMT</pubDate>
            <atom:updated>2026-04-22T12:39:22.393Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XzaCkTIkOLkpZIlLzM4aXg.png" /></figure><p>Android widgets are one of the most powerful yet underutilized features in mobile apps. They allow users to interact with your app directly from the home screen without opening it.</p><p>In this article, we’ll:</p><ul><li>Build a <strong>clean clock widget</strong></li><li>Understand <strong>AppWidgetProvider deeply</strong></li><li>Explore <strong>best practices &amp; pitfalls</strong></li><li>Share <strong>production-level advice</strong></li><li>Provide a <strong>complete working reference</strong></li></ul><h3>What is an App Widget?</h3><p>An <strong>App Widget</strong> is a miniature app view that can be embedded in other applications (like the home screen launcher).</p><p>👉 It is:</p><ul><li>Lightweight</li><li>Remote-rendered (via RemoteViews)</li><li>System-controlled lifecycle</li></ul><h3>Core Components of a Widget</h3><p>A typical widget consists of:</p><pre>AppWidgetProvider (BroadcastReceiver)<br>        ↓<br>RemoteViews (UI)<br>        ↓<br>AppWidgetManager (updates UI)<br>        ↓<br>AppWidgetProviderInfo (XML config)</pre><h3>🕒 Example: Clean Clock Widget</h3><h4>1. Widget Layout</h4><p>📄 res/layout/widget_clock.xml</p><pre>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    android:orientation=&quot;vertical&quot;<br>    android:gravity=&quot;center&quot;<br>    android:padding=&quot;16dp&quot;<br>    android:background=&quot;@drawable/bg_clock_widget&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;&gt;<br><br>    &lt;TextView<br>        android:id=&quot;@+id/time&quot;<br>        android:text=&quot;12:45&quot;<br>        android:textSize=&quot;32sp&quot;<br>        android:textStyle=&quot;bold&quot;<br>        android:textColor=&quot;@android:color/white&quot;<br>        android:fontFamily=&quot;sans-serif-medium&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;/&gt;<br><br>    &lt;TextView<br>        android:id=&quot;@+id/date&quot;<br>        android:text=&quot;Wed, Apr 22&quot;<br>        android:textSize=&quot;14sp&quot;<br>        android:textColor=&quot;@android:color/white&quot;<br>        android:alpha=&quot;0.8&quot;<br>        android:layout_marginTop=&quot;4dp&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;/&gt;<br><br>&lt;/LinearLayout&gt;</pre><h4>2. Background (Modern Glass Look)</h4><p>📄 res/drawable/bg_clock_widget.xml</p><pre>&lt;shape xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;<br>    &lt;gradient<br>        android:startColor=&quot;#1F1C2C&quot;<br>        android:endColor=&quot;#928DAB&quot;<br>        android:angle=&quot;135&quot;/&gt;<br>    &lt;corners android:radius=&quot;24dp&quot;/&gt;<br>&lt;/shape&gt;</pre><h4>3. M<strong>anifest (CRITICAL)</strong></h4><p>📄 AndroidManifest.xml</p><pre>&lt;receiver<br>    android:name=&quot;.clock.ClockWidgetProvider&quot;<br>    android:exported=&quot;false&quot;&gt;<br><br>    &lt;intent-filter&gt;<br>        &lt;action android:name=&quot;android.appwidget.action.APPWIDGET_UPDATE&quot;/&gt;<br>        &lt;action android:name=&quot;android.intent.action.TIME_TICK&quot;/&gt;<br>        &lt;action android:name=&quot;android.intent.action.TIME_CHANGED&quot;/&gt;<br>        &lt;action android:name=&quot;android.intent.action.TIMEZONE_CHANGED&quot;/&gt;<br>    &lt;/intent-filter&gt;<br><br>    &lt;meta-data<br>        android:name=&quot;android.appwidget.provider&quot;<br>        android:resource=&quot;@xml/clock_widget_info&quot;/&gt;<br>&lt;/receiver&gt;</pre><h4>4. AppWidgetProviderInfo</h4><p>📄 res/xml/clock_widget_info.xml</p><pre>&lt;appwidget-provider xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    android:minWidth=&quot;200dp&quot;<br>    android:minHeight=&quot;100dp&quot;<br>    android:updatePeriodMillis=&quot;0&quot;<br>    android:initialLayout=&quot;@layout/widget_clock&quot;<br>    android:previewImage=&quot;@drawable/widget_preview&quot;<br>    android:resizeMode=&quot;horizontal|vertical&quot;/&gt;</pre><h4>5. AppWidgetProvider (Lifecycle Aware)</h4><p>📄 ClockWidgetProvider.kt</p><pre>class ClockWidgetProvider : AppWidgetProvider() {<br><br>    companion object {<br>        private var handler: Handler? = null<br>        private var runnable: Runnable? = null<br>    }<br><br>    override fun onReceive(context: Context, intent: Intent) {<br>        super.onReceive(context, intent)<br><br>        when (intent.action) {<br><br>            Intent.ACTION_SCREEN_ON -&gt; startClock(context)<br>            Intent.ACTION_SCREEN_OFF -&gt; stopClock()<br><br>            Intent.ACTION_TIME_TICK -&gt; updateAllWidgets(context)<br>        }<br>    }<br><br>    override fun onEnabled(context: Context) {<br>        super.onEnabled(context)<br>        startClock(context)<br>    }<br><br>    override fun onDisabled(context: Context) {<br>        super.onDisabled(context)<br>        stopClock()<br>    }<br><br>    private fun startClock(context: Context) {<br>        if (handler != null) return<br><br>        handler = Handler(Looper.getMainLooper())<br><br>        runnable = object : Runnable {<br>            override fun run() {<br>                updateAllWidgets(context)<br>                handler?.postDelayed(this, 1000) // every second<br>            }<br>        }<br><br>        handler?.post(runnable!!)<br>    }<br><br>    private fun stopClock() {<br>        handler?.removeCallbacks(runnable!!)<br>        handler = null<br>        runnable = null<br>    }<br><br>    private fun updateAllWidgets(context: Context) {<br>        val manager = AppWidgetManager.getInstance(context)<br>        val component = ComponentName(context, ClockWidgetProvider::class.java)<br><br>        val ids = manager.getAppWidgetIds(component)<br><br>        ids.forEach {<br>            val views = RemoteViews(context.packageName, R.layout.widget_clock)<br><br>            val time = SimpleDateFormat(&quot;HH:mm:ss&quot;, Locale.getDefault())<br>                .format(Date())<br><br>            views.setTextViewText(R.id.time, time)<br><br>            manager.updateAppWidget(it, views)<br>        }<br>    }<br>}</pre><h3>AppWidgetProviderInfo Explained (VERY IMPORTANT)</h3><p>📄 res/xml/clock_widget_info.xml</p><pre>&lt;appwidget-provider<br>    android:minWidth=&quot;200dp&quot;<br>    android:minHeight=&quot;100dp&quot;<br>    android:updatePeriodMillis=&quot;0&quot;<br>    android:initialLayout=&quot;@layout/widget_clock&quot;<br>    android:previewLayout=&quot;@layout/widget_clock&quot;<br>    android:resizeMode=&quot;horizontal|vertical&quot;<br>    android:widgetCategory=&quot;home_screen&quot;/&gt;</pre><h4>🔍 Property Breakdown</h4><h4>minWidth / minHeight</h4><ul><li>Defines default widget size</li><li>Should match grid size (e.g., 2x1, 4x2)</li></ul><h4>updatePeriodMillis</h4><ul><li>Minimum interval: <strong>30 minutes</strong></li><li>⚠️ Not suitable for real-time updates</li><li>Best practice: set to 0 and use broadcasts</li></ul><h4>initialLayout</h4><ul><li>First UI shown when widget loads</li></ul><h4>previewLayout / previewImage</h4><ul><li>What user sees in widget picker</li><li>Critical for UX</li></ul><h4>resizeMode</h4><ul><li>Allows resizing</li><li>Options:</li><li>horizontal</li><li>vertical</li><li>none</li></ul><h4>widgetCategory</h4><ul><li>home_screen</li><li>keyguard (lock screen)</li></ul><h3>❌ What You Should Avoid (Critical)</h3><h4>🚫 1. Frequent Updates (Battery Killer)</h4><ul><li>Never update every second using background services</li><li>System may kill your process</li></ul><h4>🚫 2. Heavy Work in onUpdate()</h4><p>Bad:</p><pre>// Network call ❌</pre><p>Good:</p><pre>// Fetch from cache ✅</pre><h4>🚫 3. Complex Layouts</h4><ul><li>Widgets support <strong>limited views</strong></li><li>Avoid:</li><li>Custom views</li><li>Deep hierarchies</li></ul><h4>🚫 4. Blocking Main Thread</h4><ul><li>ANRs can happen even in widgets</li></ul><h4>🚫 5. Overusing PendingIntent</h4><ul><li>Reuse intents</li><li>Avoid creating multiple unnecessary ones</li></ul><h3>🧠 Performance &amp; Architecture Advice</h3><h4>✅ Keep It Lightweight</h4><p>Widgets should:</p><ul><li>Load fast</li><li>Update fast</li><li>Never block UI</li></ul><h4>✅ Use Data Layer</h4><pre>Widget → Repository → Room/API</pre><h4>✅ Prefer Event-Driven Updates</h4><ul><li>Data changed → update widget</li><li>Not polling</li></ul><h4>✅ Handle Lifecycle Properly</h4><ul><li>onEnabled() → start logic</li><li>onDisabled() → clean resources</li></ul><h4>✅ Use System Broadcasts</h4><ul><li>TIME_TICK</li><li>TIMEZONE_CHANGED</li><li>SCREEN_ON/OFF</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*E9wsFI7NG1Drvm3cXu8vCQ.png" /></figure><h4>🎯 UX Best Practices</h4><ul><li>Clean design (no clutter)</li><li>Readable fonts</li><li>Proper spacing</li><li>Good contrast</li><li>Useful interaction (click → open app)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rVOeWcupQtI1-kEhnw5QQA.png" /></figure><h3>🔗 Full Working Sample</h3><p>👉 Complete implementation available here:</p><p><a href="https://github.com/orbitalsonic/Android-Widgets-Clock-Sample">https://github.com/orbitalsonic/Android-Widgets-Clock-Sample</a></p><h3>📚 Official Documentation</h3><p>👉 Android Official Guide:</p><p><a href="https://developer.android.com/develop/ui/views/appwidgets">https://developer.android.com/develop/ui/views/appwidgets</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ab32bc5e2ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Material 3 Colors in Android: A Practical Guide for Developers]]></title>
            <link>https://orbitalsonic.medium.com/mastering-material-3-colors-in-android-a-practical-guide-for-developers-3fc4448d5c57?source=rss-e5fc16dbbf3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fc4448d5c57</guid>
            <category><![CDATA[material3-colors]]></category>
            <category><![CDATA[compose-color-scheme]]></category>
            <category><![CDATA[compose-colors]]></category>
            <category><![CDATA[android-color-scheme]]></category>
            <category><![CDATA[color-scheme]]></category>
            <dc:creator><![CDATA[Muhammad Yaqoob]]></dc:creator>
            <pubDate>Thu, 16 Apr 2026 06:55:29 GMT</pubDate>
            <atom:updated>2026-04-16T10:06:23.982Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LKPiQCXFEn8UMpho_0Vvog.png" /></figure><p>When working with Android UI, especially with <strong>Material Design 3 (M3)</strong>, many developers get overwhelmed by the sheer number of color attributes generated by tools like the theme builder.</p><p>You might see <strong>100+ colors</strong>, but the reality is:</p><blockquote><em>👉 Only a small subset of these colors drives most of your UI.</em></blockquote><p>This article simplifies Material 3 colors into a <strong>practical mental model</strong>, explains <strong>which colors actually matter</strong>, and shows <strong>where they are used by default in Android components</strong>.</p><h3>🧠 Understanding Material Color Roles</h3><p>Material Design doesn’t assign colors randomly. Instead, it uses <strong>semantic color roles,</strong> a system where each color has a purpose rather than a fixed usage.</p><blockquote><em>Color roles are mapped to UI elements and define what color goes where.</em></blockquote><p>These roles ensure:</p><ul><li>Consistency across components</li><li>Accessibility (contrast ratios)</li><li>Easy theming and customization</li></ul><h3>🎯 The 10–12 Colors That Actually Matter</h3><p>From your generated theme, the <strong>core colors used in most UI components</strong> are:</p><h4>🔹 Primary System</h4><ul><li>primary</li><li>onPrimary</li></ul><h4>🔹 Secondary System</h4><ul><li>secondary</li><li>onSecondary</li></ul><h4>🔹 Surface System (MOST IMPORTANT)</h4><ul><li>surface</li><li>onSurface</li></ul><h4>🔹 Variant System</h4><ul><li>surfaceVariant</li><li>onSurfaceVariant</li></ul><h4>🔹 Utility</h4><ul><li>outline</li><li>error</li><li>onError</li></ul><p>👉 That’s it.<br> Out of ~150 colors, these <strong>~11 colors control 90% of your UI</strong>.</p><h3>🧾 Where These Colors Are Used (Default Mapping)</h3><p>Now let’s map these colors to actual Android UI components.</p><p>👉 <strong>Material 3 Default Color Mapping (Attribute Reference)</strong><br> <a href="https://github.com/orbitalsonic/Material3-Default-Color-Mapping">https://github.com/orbitalsonic/Material3-Default-Color-Mapping</a></p><h3>📝 Text &amp; Input Fields</h3><h4>Default Behavior</h4><ul><li><strong>Text (TextView, EditText)</strong> → onSurface</li><li><strong>Hint / Placeholder</strong> → onSurfaceVariant</li><li><strong>Cursor / Active state</strong> → primary</li></ul><p>💡 Why?<br> Surface colors are used for backgrounds, and “on” colors ensure readable text on top.</p><h3>🔘 Buttons</h3><h4>Filled Button (Primary Action)</h4><ul><li>Background → primary</li><li>Text → onPrimary</li></ul><p>👉 Used for main actions like <strong>Submit / Confirm</strong></p><h4>Outlined / Text Button</h4><ul><li>Text → primary</li><li>Border → outline</li></ul><h4>Floating Action Button (FAB)</h4><ul><li>Background → secondary or secondaryContainer</li><li>Icon → onSecondary</li></ul><p>💡 Secondary colors are used for <strong>less dominant but still important actions</strong></p><h3>☑️ Selection Controls</h3><h4>CheckBox / RadioButton / Switch</h4><ul><li>Checked → primary</li><li>Unchecked → onSurfaceVariant</li></ul><h3>🧩 Common Widgets</h3><h4>ProgressBar / SeekBar</h4><ul><li>Progress → primary</li><li>Track → surfaceVariant</li></ul><h4>ImageView</h4><ul><li>Tint → onSurface</li></ul><h4>SearchView</h4><ul><li>Text → onSurface</li><li>Hint → onSurfaceVariant</li><li>Background → surface</li></ul><h3>🧱 Containers &amp; Layouts</h3><h4>CardView / Dialog / BottomSheet</h4><ul><li>Background → surface</li><li>Content → onSurface</li></ul><h4>Toolbar / AppBar</h4><ul><li>Background → surface</li><li>Text &amp; Icons → onSurface</li></ul><h4>Navigation Drawer</h4><ul><li>Background → surface</li><li>Text → onSurface</li><li>Icons → onSurfaceVariant</li><li>Selected Item → secondaryContainer</li></ul><h4>❗ Error States</h4><ul><li>Error text → error</li><li>Text on error → onError</li></ul><h3>🧠 The Real Mental Model (This is the Key)</h3><p>Instead of remembering 100 attributes, think like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*NWW5cIUgbwfrlXHUR_dj_g.png" /></figure><h3>⚠️ Common Mistakes Developers Make</h3><p>❌ Setting everything to primary<br> ✅ Using <strong>semantic roles</strong></p><p>Material is not:</p><blockquote><em>Which color looks good here?</em></blockquote><p>It is:</p><blockquote><em>What role does this UI element play?</em></blockquote><h3>🧪 Why So Many Colors Exist in Theme Builder?</h3><p>Material 3 generates a <strong>full tonal palette</strong> using algorithms for:</p><ul><li>Light / Dark themes</li><li>Accessibility contrast</li><li>Dynamic colors (Android 12+)</li></ul><blockquote><em>The system derives multiple color roles from a base color to ensure consistency and accessibility.</em></blockquote><h3>🔗 Useful Resources</h3><h4>🎨 Material Theme Builder (Generate your color system)</h4><p>👉 <a href="https://material-foundation.github.io/material-theme-builder/">https://material-foundation.github.io/material-theme-builder/</a></p><h4>📚 Material Components (Android)</h4><p>👉 <a href="https://m2.material.io/components?platform=android">https://m2.material.io/components?platform=android</a></p><h4>🧩 Material 3 Color System (Official)</h4><p>👉 <a href="https://m3.material.io/styles/color/overview">https://m3.material.io/styles/color/overview</a></p><h4>🧩 Material 3 Default Color Mapping (Attribute Reference)</h4><p>👉 <a href="https://github.com/orbitalsonic/Material3-Default-Color-Mapping">https://github.com/orbitalsonic/Material3-Default-Color-Mapping</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fc4448d5c57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Flexible Hijri Calendar in Kotlin for Android]]></title>
            <link>https://orbitalsonic.medium.com/building-a-flexible-hijri-calendar-in-kotlin-for-android-c444e21c2022?source=rss-e5fc16dbbf3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c444e21c2022</guid>
            <category><![CDATA[islamic-calendar]]></category>
            <category><![CDATA[islamic-calendar-android]]></category>
            <category><![CDATA[calendar]]></category>
            <category><![CDATA[gregorian-calendar]]></category>
            <category><![CDATA[muslim-calendar]]></category>
            <dc:creator><![CDATA[Muhammad Yaqoob]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 06:33:56 GMT</pubDate>
            <atom:updated>2026-04-14T06:48:37.209Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tBygOjjhXrKxYxFHe_7WWw.png" /></figure><p>Islamic calendar calculations are different from Gregorian ones. They depend on lunar cycles and regional adjustments. Most solutions either lack flexibility or are too complex to integrate.</p><p>This project solves that by offering:</p><ul><li>Simple API for conversion</li><li>Built in Umm Al Qura calendar data</li><li>Locale support for multiple languages</li><li>Lightweight and offline ready</li><li>Clean Kotlin architecture</li></ul><h3>Project structure</h3><p>You can either use this code directly in your project or include it as a dependency using <a href="https://github.com/orbitalsonic/SonicMuslimCalendar">SonicMuslimCalendar</a>.</p><p>The repository is divided into small focused classes. Each one has a clear responsibility.</p><h3>Formatter.kt</h3><p>Handles formatting of Hijri and Gregorian dates into readable strings.</p><pre>package com.muslim.calendar<br><br>import java.time.DayOfWeek<br>import java.util.Locale<br><br>object Formatter {<br>    fun format(calendar: MuslimCalendar, pattern: String, locale: Locale = Locale.ENGLISH): String {<br>        val adjusted = calendar.adjusted()<br>        val dayOfWeek = calendar.toGregorian().dayOfWeek<br>        val out = StringBuilder(pattern.length + 16)<br>        var i = 0<br><br>        while (i &lt; pattern.length) {<br>            val ch = pattern[i]<br>            if (!ch.isLetter()) {<br>                out.append(ch)<br>                i++<br>                continue<br>            }<br>            var run = 1<br>            while (i + run &lt; pattern.length &amp;&amp; pattern[i + run] == ch) run++<br>            out.append(renderToken(ch, run, adjusted.day, adjusted.month, adjusted.year, dayOfWeek, locale))<br>            i += run<br>        }<br>        return out.toString()<br>    }<br><br>    private fun renderToken(<br>        token: Char,<br>        size: Int,<br>        day: Int,<br>        month: Int,<br>        year: Int,<br>        dayOfWeek: DayOfWeek,<br>        locale: Locale<br>    ): String = when (token) {<br>        &#39;d&#39; -&gt; if (size &gt;= 2) day.toString().padStart(2, &#39;0&#39;) else day.toString()<br>        &#39;M&#39; -&gt; when {<br>            size &gt;= 4 -&gt; LocaleProvider.monthName(month, locale, false)<br>            size == 3 -&gt; LocaleProvider.monthName(month, locale, true)<br>            size == 2 -&gt; month.toString().padStart(2, &#39;0&#39;)<br>            else -&gt; month.toString()<br>        }<br>        &#39;y&#39; -&gt; when {<br>            size &gt;= 4 -&gt; year.toString().padStart(4, &#39;0&#39;)<br>            size == 2 -&gt; (year % 100).toString().padStart(2, &#39;0&#39;)<br>            else -&gt; year.toString()<br>        }<br>        &#39;E&#39; -&gt; if (size &gt;= 4) LocaleProvider.dayName(dayOfWeek, locale, false) else LocaleProvider.dayName(dayOfWeek, locale, true)<br>        else -&gt; token.toString().repeat(size)<br>    }<br>}</pre><h3>HijriConverter.kt</h3><p>Core conversion logic between Gregorian and Hijri dates.</p><pre>package com.muslim.calendar<br><br>import java.time.LocalDate<br><br>internal data class HijriDate(val year: Int, val month: Int, val day: Int)<br><br>object HijriConverter {<br>    internal fun fromGregorian(date: LocalDate): HijriDate {<br>        val julianDay = gregorianToJulianDay(date.year, date.monthValue, date.dayOfMonth)<br>        return UmmAlQuraData.julianDayToHijri(julianDay)<br>    }<br><br>    internal fun toGregorian(hijri: HijriDate): LocalDate {<br>        UmmAlQuraData.validateHijriRange(hijri.year, hijri.month, hijri.day)<br>        val julianDay = UmmAlQuraData.hijriToJulianDay(hijri.year, hijri.month, hijri.day)<br>        val (year, month, day) = julianDayToGregorian(julianDay)<br>        return LocalDate.of(year, month, day)<br>    }<br><br>    fun lengthOfMonth(year: Int, month: Int): Int {<br>        UmmAlQuraData.validateHijriRange(year, month, 1)<br>        return UmmAlQuraData.getDaysInMonth(year, month)<br>    }<br><br>    fun lengthOfYear(year: Int): Int = (1..12).sumOf { month -&gt; lengthOfMonth(year, month) }<br><br>    fun isLeapYear(year: Int): Boolean = lengthOfYear(year) == 355<br><br>    private fun div(a: Int, b: Int): Int = a / b<br>    private fun mod(a: Int, b: Int): Int = a - ((a / b) * b)<br><br>    private fun gregorianToJulianDay(year: Int, month: Int, day: Int): Int {<br>        var d = div((year + div(month - 8, 6) + 100100) * 1461, 4) +<br>            div((153 * mod(month + 9, 12)) + 2, 5) +<br>            day - 34_840_408<br>        d = d - div((div(year + 100100 + div(month - 8, 6), 100) * 3), 4) + 752<br>        return d<br>    }<br><br>    private fun julianDayToGregorian(julianDay: Int): Triple&lt;Int, Int, Int&gt; {<br>        var j = 4 * julianDay + 139_361_631<br>        j += div((div((4 * julianDay) + 183_187_720, 146_097) * 3), 4) * 4 - 3_908<br>        val i = div(mod(j, 1461), 4) * 5 + 308<br>        val day = div(mod(i, 153), 5) + 1<br>        val month = mod(div(i, 153), 12) + 1<br>        val year = div(j, 1461) - 100_100 + div(8 - month, 6)<br>        return Triple(year, month, day)<br>    }<br>}</pre><h3>LocaleProvider.kt</h3><p>Provides localized names for months and days.</p><pre>package com.muslim.calendar<br><br>import java.time.DayOfWeek<br>import java.util.Locale<br><br>object LocaleProvider {<br>    private val defaultMonths = listOf(<br>        &quot;Muharram&quot;, &quot;Safar&quot;, &quot;Rabi&#39; al-Awwal&quot;, &quot;Rabi&#39; al-Thani&quot;,<br>        &quot;Jumada al-Ula&quot;, &quot;Jumada al-Akhirah&quot;, &quot;Rajab&quot;, &quot;Sha&#39;ban&quot;,<br>        &quot;Ramadan&quot;, &quot;Shawwal&quot;, &quot;Dhu al-Qi&#39;dah&quot;, &quot;Dhu al-Hijjah&quot;<br>    )<br>    private val defaultShortMonths = listOf(<br>        &quot;Muh&quot;, &quot;Saf&quot;, &quot;Rab-I&quot;, &quot;Rab-II&quot;, &quot;Jum-I&quot;, &quot;Jum-II&quot;,<br>        &quot;Raj&quot;, &quot;Sha&quot;, &quot;Ram&quot;, &quot;Shw&quot;, &quot;Dhu-Q&quot;, &quot;Dhu-H&quot;<br>    )<br>    private val defaultDays = listOf(<br>        &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;, &quot;Sunday&quot;<br>    )<br>    private val defaultShortDays = listOf(&quot;Mon&quot;, &quot;Tue&quot;, &quot;Wed&quot;, &quot;Thu&quot;, &quot;Fri&quot;, &quot;Sat&quot;, &quot;Sun&quot;)<br><br>    private val monthNames = mapOf(<br>        &quot;en&quot; to defaultMonths,<br>        &quot;ar&quot; to listOf(&quot;محرم&quot;, &quot;صفر&quot;, &quot;ربيع الأول&quot;, &quot;ربيع الثاني&quot;, &quot;جمادى الأولى&quot;, &quot;جمادى الآخرة&quot;, &quot;رجب&quot;, &quot;شعبان&quot;, &quot;رمضان&quot;, &quot;شوال&quot;, &quot;ذو القعدة&quot;, &quot;ذو الحجة&quot;),<br>        &quot;ur&quot; to listOf(&quot;محرم&quot;, &quot;صفر&quot;, &quot;ربیع الاول&quot;, &quot;ربیع الثانی&quot;, &quot;جمادی الاول&quot;, &quot;جمادی الثانی&quot;, &quot;رجب&quot;, &quot;شعبان&quot;, &quot;رمضان&quot;, &quot;شوال&quot;, &quot;ذوالقعدہ&quot;, &quot;ذوالحجہ&quot;),<br>        &quot;id&quot; to listOf(&quot;Muharam&quot;, &quot;Safar&quot;, &quot;Rabiulawal&quot;, &quot;Rabiulakhir&quot;, &quot;Jumadilawal&quot;, &quot;Jumadilakhir&quot;, &quot;Rajab&quot;, &quot;Syaban&quot;, &quot;Ramadan&quot;, &quot;Syawal&quot;, &quot;Zulkaidah&quot;, &quot;Zulhijah&quot;),<br>        &quot;hi&quot; to listOf(&quot;मुहर्रम&quot;, &quot;सफ़र&quot;, &quot;रबीउल अव्वल&quot;, &quot;रबीउल आखिर&quot;, &quot;जुमादा अल-अव्वल&quot;, &quot;जुमादा अल-आखिर&quot;, &quot;रजब&quot;, &quot;शाबान&quot;, &quot;रमज़ान&quot;, &quot;शव्वाल&quot;, &quot;ज़ुल क़ादा&quot;, &quot;ज़ुल हिज्जा&quot;),<br>        &quot;bn&quot; to listOf(&quot;মুহররম&quot;, &quot;সফর&quot;, &quot;রবিউল আউয়াল&quot;, &quot;রবিউস সানি&quot;, &quot;জুমাদাল উলা&quot;, &quot;জুমাদাস সানিয়া&quot;, &quot;রজব&quot;, &quot;শাবান&quot;, &quot;রমজান&quot;, &quot;শাওয়াল&quot;, &quot;জিলকদ&quot;, &quot;জিলহজ&quot;),<br>        &quot;fa&quot; to listOf(&quot;محرم&quot;, &quot;صفر&quot;, &quot;ربیع‌الاول&quot;, &quot;ربیع‌الثانی&quot;, &quot;جمادی‌الاول&quot;, &quot;جمادی‌الثانی&quot;, &quot;رجب&quot;, &quot;شعبان&quot;, &quot;رمضان&quot;, &quot;شوال&quot;, &quot;ذیقعده&quot;, &quot;ذیحجه&quot;),<br>        &quot;tr&quot; to listOf(&quot;Muharrem&quot;, &quot;Safer&quot;, &quot;Rebiülevvel&quot;, &quot;Rebiülahir&quot;, &quot;Cemaziyelevvel&quot;, &quot;Cemaziyelahir&quot;, &quot;Recep&quot;, &quot;Şaban&quot;, &quot;Ramazan&quot;, &quot;Şevval&quot;, &quot;Zilkade&quot;, &quot;Zilhicce&quot;),<br>        &quot;am&quot; to listOf(&quot;ሙሐረም&quot;, &quot;ሰፈር&quot;, &quot;ረቢዕ አል አወል&quot;, &quot;ረቢዕ አል ሳኒ&quot;, &quot;ጁማዳ አል ኡላ&quot;, &quot;ጁማዳ አል አኺራ&quot;, &quot;ረጀብ&quot;, &quot;ሻዕባን&quot;, &quot;ረመዳን&quot;, &quot;ሸዋል&quot;, &quot;ዙልቃዕዳ&quot;, &quot;ዙልሒጃ&quot;),<br>        &quot;fr&quot; to listOf(&quot;Mouharram&quot;, &quot;Safar&quot;, &quot;ربيع الأول&quot;, &quot;ربيع الثاني&quot;, &quot;Joumada al oula&quot;, &quot;Joumada al akhirah&quot;, &quot;Rajab&quot;, &quot;Chaabane&quot;, &quot;Ramadan&quot;, &quot;Chawwal&quot;, &quot;Dhou al qi`da&quot;, &quot;Dhou al hijja&quot;),<br>        &quot;ms&quot; to listOf(&quot;Muharam&quot;, &quot;Safar&quot;, &quot;Rabiulawal&quot;, &quot;Rabiulakhir&quot;, &quot;Jamadilawal&quot;, &quot;Jamadilakhir&quot;, &quot;Rejab&quot;, &quot;Syaaban&quot;, &quot;Ramadan&quot;, &quot;Syawal&quot;, &quot;Zulkaedah&quot;, &quot;Zulhijah&quot;),<br>        &quot;az&quot; to listOf(&quot;Məhərrəm&quot;, &quot;Səfər&quot;, &quot;Rəbiüləvvəl&quot;, &quot;Rəbiülaxir&quot;, &quot;Cəmadiyələvvəl&quot;, &quot;Cəmadiyəlaxir&quot;, &quot;Rəcəb&quot;, &quot;Şaban&quot;, &quot;Ramazan&quot;, &quot;Şəvval&quot;, &quot;Zilqədə&quot;, &quot;Zilhiccə&quot;),<br>        &quot;kk&quot; to listOf(&quot;Мұхаррам&quot;, &quot;Сафар&quot;, &quot;Раби әл-әууәл&quot;, &quot;Раби ас-сани&quot;, &quot;Жумәда әл-әууәл&quot;, &quot;Жумәда ас-сани&quot;, &quot;Рәжәб&quot;, &quot;Шағбан&quot;, &quot;Рамазан&quot;, &quot;Шәууәл&quot;, &quot;Зүлқағда&quot;, &quot;Зүлхижжа&quot;),<br>        &quot;ky&quot; to listOf(&quot;Мухаррам&quot;, &quot;Сафар&quot;, &quot;Рабиул-аввал&quot;, &quot;Рабиус-сани&quot;, &quot;Жумада-ул-аввал&quot;, &quot;Жумада-ус-сани&quot;, &quot;Ражаб&quot;, &quot;Шаабан&quot;, &quot;Рамазан&quot;, &quot;Шаввал&quot;, &quot;Зул-каада&quot;, &quot;Зул-хижжа&quot;),<br>        &quot;tg&quot; to listOf(&quot;Муҳаррам&quot;, &quot;Сафар&quot;, &quot;Рабиъу-л-аввал&quot;, &quot;Рабиъу-с-сонӣ&quot;, &quot;Ҷумодо-л-аввал&quot;, &quot;Ҷумодо-с-сонӣ&quot;, &quot;Раҷаб&quot;, &quot;Шаъбон&quot;, &quot;Рамазон&quot;, &quot;Шаввол&quot;, &quot;Зулқаъда&quot;, &quot;Зулҳиҷҷа&quot;),<br>        &quot;ru&quot; to listOf(&quot;Мухаррам&quot;, &quot;Сафар&quot;, &quot;Раби аль-авваль&quot;, &quot;Раби ас-сани&quot;, &quot;Джумада аль-уля&quot;, &quot;Джумада аль-ахира&quot;, &quot;Раджаб&quot;, &quot;Шаабан&quot;, &quot;Рамадан&quot;, &quot;Шавваль&quot;, &quot;Зуль-каада&quot;, &quot;Зуль-хиджа&quot;),<br>        &quot;de&quot; to listOf(&quot;Muharram&quot;, &quot;Safar&quot;, &quot;Rabi al-awwal&quot;, &quot;Rabi ath-thani&quot;, &quot;Dschumada al-ula&quot;, &quot;Dschumada al-akhira&quot;, &quot;Radschab&quot;, &quot;Schaban&quot;, &quot;Ramadan&quot;, &quot;Schawwal&quot;, &quot;Dhu l-qiʿda&quot;, &quot;Dhu l-hiddscha&quot;),<br>        &quot;sv&quot; to listOf(&quot;Muharram&quot;, &quot;Safar&quot;, &quot;Rabi al-awwal&quot;, &quot;Rabi al-thani&quot;, &quot;Jumada al-ula&quot;, &quot;Jumada al-akhira&quot;, &quot;Rajab&quot;, &quot;Sha&#39;ban&quot;, &quot;Ramadan&quot;, &quot;Shawwal&quot;, &quot;Dhu al-qi&#39;dah&quot;, &quot;Dhu al-hijjah&quot;),<br>        &quot;th&quot; to listOf(&quot;มุฮัรรอม&quot;, &quot;ซอฟัร&quot;, &quot;รอบีอุลเอาวัล&quot;, &quot;รอบีอุซซานี&quot;, &quot;ญุมาดาอัลอูลา&quot;, &quot;ญุมาดาอัซซานียะห์&quot;, &quot;รอญับ&quot;, &quot;ชะอ์บาน&quot;, &quot;รอมฎอน&quot;, &quot;เชาวาล&quot;, &quot;ซุลเกาะอ์ดะฮ์&quot;, &quot;ซุลฮิจญะฮ์&quot;),<br>        &quot;fil&quot; to listOf(&quot;Muharram&quot;, &quot;Safar&quot;, &quot;Rabi&#39; al-Awwal&quot;, &quot;Rabi&#39; al-Thani&quot;, &quot;Jumada al-Ula&quot;, &quot;Jumada al-Akhirah&quot;, &quot;Rajab&quot;, &quot;Sha&#39;ban&quot;, &quot;Ramadan&quot;, &quot;Shawwal&quot;, &quot;Dhu al-Qi&#39;dah&quot;, &quot;Dhu al-Hijjah&quot;),<br>        &quot;ja&quot; to listOf(&quot;ムハッラム&quot;, &quot;サファル&quot;, &quot;ラビー・アル＝アウワル&quot;, &quot;ラビー・アッ＝サーニー&quot;, &quot;ジュマーダー・アル＝ウーラー&quot;, &quot;ジュマーダー・アル＝アーヒラ&quot;, &quot;ラジャブ&quot;, &quot;シャアバーン&quot;, &quot;ラマダーン&quot;, &quot;シャウワール&quot;, &quot;ズー・アル＝カアダ&quot;, &quot;ズー・アル＝ヒッジャ&quot;),<br>        &quot;es&quot; to listOf(&quot;Muharram&quot;, &quot;Safar&quot;, &quot;Rabi al-awwal&quot;, &quot;Rabi al-thani&quot;, &quot;Yumada al-ula&quot;, &quot;Yumada al-akhirah&quot;, &quot;Rayab&quot;, &quot;Sha&#39;ban&quot;, &quot;Ramadán&quot;, &quot;Shawwal&quot;, &quot;Dhu al-Qi&#39;dah&quot;, &quot;Dhu al-Hijjah&quot;),<br>        &quot;ko&quot; to listOf(&quot;무하람&quot;, &quot;사파르&quot;, &quot;라비 알 아왈&quot;, &quot;라비 알 타니&quot;, &quot;주마다 알 울라&quot;, &quot;주마다 알 아키라&quot;, &quot;라자브&quot;, &quot;샤아반&quot;, &quot;라마단&quot;, &quot;샤왈&quot;, &quot;둘 카이다&quot;, &quot;둘 힛자&quot;),<br>        &quot;sw&quot; to listOf(&quot;Muharram&quot;, &quot;Safar&quot;, &quot;Rabiul Awwal&quot;, &quot;Rabiul Thani&quot;, &quot;Jumadal Ula&quot;, &quot;Jumadal Akhira&quot;, &quot;Rajab&quot;, &quot;Shaaban&quot;, &quot;Ramadhani&quot;, &quot;Shawwal&quot;, &quot;Dhul Qaada&quot;, &quot;Dhul Hijja&quot;),<br>        &quot;pt&quot; to listOf(&quot;Muharram&quot;, &quot;Safar&quot;, &quot;Rabi al-awwal&quot;, &quot;Rabi al-thani&quot;, &quot;Jumada al-ula&quot;, &quot;Jumada al-akhirah&quot;, &quot;Rajab&quot;, &quot;Sha&#39;ban&quot;, &quot;Ramadão&quot;, &quot;Shawwal&quot;, &quot;Dhu al-Qi&#39;dah&quot;, &quot;Dhu al-Hijjah&quot;)<br>    )<br><br>    private val monthShortNames = mapOf(<br>        &quot;en&quot; to defaultShortMonths,<br>        &quot;ar&quot; to listOf(&quot;محرم&quot;, &quot;صفر&quot;, &quot;ربيع 1&quot;, &quot;ربيع 2&quot;, &quot;جمادى 1&quot;, &quot;جمادى 2&quot;, &quot;رجب&quot;, &quot;شعبان&quot;, &quot;رمضان&quot;, &quot;شوال&quot;, &quot;ذو القعدة&quot;, &quot;ذو الحجة&quot;),<br>        &quot;ur&quot; to listOf(&quot;محرم&quot;, &quot;صفر&quot;, &quot;ربیع 1&quot;, &quot;ربیع 2&quot;, &quot;جمادی 1&quot;, &quot;جمادی 2&quot;, &quot;رجب&quot;, &quot;شعبان&quot;, &quot;رمضان&quot;, &quot;شوال&quot;, &quot;ذوالقعدہ&quot;, &quot;ذوالحجہ&quot;),<br>        &quot;id&quot; to listOf(&quot;Muh&quot;, &quot;Saf&quot;, &quot;Rab1&quot;, &quot;Rab2&quot;, &quot;Jum1&quot;, &quot;Jum2&quot;, &quot;Raj&quot;, &quot;Sya&quot;, &quot;Ram&quot;, &quot;Syw&quot;, &quot;Zqa&quot;, &quot;Zhj&quot;),<br>        &quot;hi&quot; to listOf(&quot;मुह&quot;, &quot;सफ़&quot;, &quot;रअ1&quot;, &quot;रअ2&quot;, &quot;जअ1&quot;, &quot;जअ2&quot;, &quot;रज&quot;, &quot;शा&quot;, &quot;रम&quot;, &quot;शव&quot;, &quot;ज़ुका&quot;, &quot;ज़ुहि&quot;),<br>        &quot;bn&quot; to listOf(&quot;মুহ&quot;, &quot;সফ&quot;, &quot;রবি1&quot;, &quot;রবি2&quot;, &quot;জুম1&quot;, &quot;জুম2&quot;, &quot;রজ&quot;, &quot;শা&quot;, &quot;রম&quot;, &quot;শাও&quot;, &quot;জিলক&quot;, &quot;জিলহ&quot;),<br>        &quot;fa&quot; to listOf(&quot;مح&quot;, &quot;صف&quot;, &quot;رب۱&quot;, &quot;رب۲&quot;, &quot;جم۱&quot;, &quot;جم۲&quot;, &quot;رجب&quot;, &quot;شعب&quot;, &quot;رمض&quot;, &quot;شوال&quot;, &quot;ذق&quot;, &quot;ذح&quot;),<br>        &quot;tr&quot; to listOf(&quot;Muh&quot;, &quot;Saf&quot;, &quot;Reb1&quot;, &quot;Reb2&quot;, &quot;Cem1&quot;, &quot;Cem2&quot;, &quot;Rec&quot;, &quot;Şab&quot;, &quot;Ram&quot;, &quot;Şev&quot;, &quot;ZilK&quot;, &quot;ZilH&quot;),<br>        &quot;am&quot; to listOf(&quot;ሙሐ&quot;, &quot;ሰፈ&quot;, &quot;ረቢ1&quot;, &quot;ረቢ2&quot;, &quot;ጁማ1&quot;, &quot;ጁማ2&quot;, &quot;ረጀ&quot;, &quot;ሻዕ&quot;, &quot;ረመ&quot;, &quot;ሸዋ&quot;, &quot;ዙቃ&quot;, &quot;ዙሒ&quot;),<br>        &quot;fr&quot; to listOf(&quot;Mou&quot;, &quot;Saf&quot;, &quot;Rab1&quot;, &quot;Rab2&quot;, &quot;Jou1&quot;, &quot;Jou2&quot;, &quot;Raj&quot;, &quot;Cha&quot;, &quot;Ram&quot;, &quot;ChaW&quot;, &quot;DQi&quot;, &quot;DHj&quot;),<br>        &quot;ms&quot; to listOf(&quot;Muh&quot;, &quot;Saf&quot;, &quot;Rab1&quot;, &quot;Rab2&quot;, &quot;Jam1&quot;, &quot;Jam2&quot;, &quot;Rej&quot;, &quot;Sya&quot;, &quot;Ram&quot;, &quot;Syw&quot;, &quot;ZulK&quot;, &quot;ZulH&quot;),<br>        &quot;az&quot; to listOf(&quot;Müh&quot;, &quot;Səf&quot;, &quot;Rəb1&quot;, &quot;Rəb2&quot;, &quot;Cəm1&quot;, &quot;Cəm2&quot;, &quot;Rəc&quot;, &quot;Şab&quot;, &quot;Ram&quot;, &quot;Şəv&quot;, &quot;ZilQ&quot;, &quot;ZilH&quot;),<br>        &quot;kk&quot; to listOf(&quot;Мұх&quot;, &quot;Саф&quot;, &quot;Раб1&quot;, &quot;Раб2&quot;, &quot;Жұм1&quot;, &quot;Жұм2&quot;, &quot;Рәж&quot;, &quot;Шағ&quot;, &quot;Рам&quot;, &quot;Шәү&quot;, &quot;ЗүлҚ&quot;, &quot;ЗүлХ&quot;),<br>        &quot;ky&quot; to listOf(&quot;Мух&quot;, &quot;Саф&quot;, &quot;Раб1&quot;, &quot;Раб2&quot;, &quot;Жум1&quot;, &quot;Жум2&quot;, &quot;Раж&quot;, &quot;Шаа&quot;, &quot;Рам&quot;, &quot;Шав&quot;, &quot;ЗулК&quot;, &quot;ЗулХ&quot;),<br>        &quot;tg&quot; to listOf(&quot;Муҳ&quot;, &quot;Саф&quot;, &quot;Раб1&quot;, &quot;Раб2&quot;, &quot;Ҷум1&quot;, &quot;Ҷум2&quot;, &quot;Раҷ&quot;, &quot;Шаъ&quot;, &quot;Рам&quot;, &quot;Шав&quot;, &quot;ЗулҚ&quot;, &quot;ЗулҲ&quot;),<br>        &quot;ru&quot; to listOf(&quot;Мух&quot;, &quot;Саф&quot;, &quot;Раб1&quot;, &quot;Раб2&quot;, &quot;Джу1&quot;, &quot;Джу2&quot;, &quot;Рад&quot;, &quot;Шаа&quot;, &quot;Рам&quot;, &quot;Шав&quot;, &quot;ЗулК&quot;, &quot;ЗулХ&quot;),<br>        &quot;de&quot; to listOf(&quot;Muh&quot;, &quot;Saf&quot;, &quot;Rab1&quot;, &quot;Rab2&quot;, &quot;Dju1&quot;, &quot;Dju2&quot;, &quot;Rad&quot;, &quot;Sch&quot;, &quot;Ram&quot;, &quot;Shw&quot;, &quot;DhuQ&quot;, &quot;DhuH&quot;),<br>        &quot;sv&quot; to listOf(&quot;Muh&quot;, &quot;Saf&quot;, &quot;Rab1&quot;, &quot;Rab2&quot;, &quot;Jum1&quot;, &quot;Jum2&quot;, &quot;Raj&quot;, &quot;Sha&quot;, &quot;Ram&quot;, &quot;Shw&quot;, &quot;DhuQ&quot;, &quot;DhuH&quot;),<br>        &quot;th&quot; to listOf(&quot;มุฮ&quot;, &quot;ซอฟ&quot;, &quot;รอ1&quot;, &quot;รอ2&quot;, &quot;ญุ1&quot;, &quot;ญุ2&quot;, &quot;รญ&quot;, &quot;ชา&quot;, &quot;รม&quot;, &quot;ชว&quot;, &quot;ซกอ&quot;, &quot;ซฮจ&quot;),<br>        &quot;fil&quot; to listOf(&quot;Muh&quot;, &quot;Saf&quot;, &quot;Rab1&quot;, &quot;Rab2&quot;, &quot;Jum1&quot;, &quot;Jum2&quot;, &quot;Raj&quot;, &quot;Sha&quot;, &quot;Ram&quot;, &quot;Shw&quot;, &quot;DhuQ&quot;, &quot;DhuH&quot;),<br>        &quot;ja&quot; to listOf(&quot;ムハ&quot;, &quot;サフ&quot;, &quot;ラビ1&quot;, &quot;ラビ2&quot;, &quot;ジュ1&quot;, &quot;ジュ2&quot;, &quot;ラジ&quot;, &quot;シャ&quot;, &quot;ラマ&quot;, &quot;シャW&quot;, &quot;ズルQ&quot;, &quot;ズルH&quot;),<br>        &quot;es&quot; to listOf(&quot;Muh&quot;, &quot;Saf&quot;, &quot;Rab1&quot;, &quot;Rab2&quot;, &quot;Yum1&quot;, &quot;Yum2&quot;, &quot;Ray&quot;, &quot;Sha&quot;, &quot;Ram&quot;, &quot;Shw&quot;, &quot;DhuQ&quot;, &quot;DhuH&quot;),<br>        &quot;ko&quot; to listOf(&quot;무하&quot;, &quot;사파&quot;, &quot;라비1&quot;, &quot;라비2&quot;, &quot;주마1&quot;, &quot;주마2&quot;, &quot;라자&quot;, &quot;샤반&quot;, &quot;라마&quot;, &quot;샤왈&quot;, &quot;둘카&quot;, &quot;둘힛&quot;),<br>        &quot;sw&quot; to listOf(&quot;Muh&quot;, &quot;Saf&quot;, &quot;Rab1&quot;, &quot;Rab2&quot;, &quot;Jum1&quot;, &quot;Jum2&quot;, &quot;Raj&quot;, &quot;Sha&quot;, &quot;Ram&quot;, &quot;Shw&quot;, &quot;DhuQ&quot;, &quot;DhuH&quot;),<br>        &quot;pt&quot; to listOf(&quot;Muh&quot;, &quot;Saf&quot;, &quot;Rab1&quot;, &quot;Rab2&quot;, &quot;Jum1&quot;, &quot;Jum2&quot;, &quot;Raj&quot;, &quot;Sha&quot;, &quot;Ram&quot;, &quot;Shw&quot;, &quot;DhuQ&quot;, &quot;DhuH&quot;)<br>    )<br><br>    private val dayNames = mapOf(<br>        &quot;en&quot; to defaultDays,<br>        &quot;ar&quot; to listOf(&quot;الاثنين&quot;, &quot;الثلاثاء&quot;, &quot;الأربعاء&quot;, &quot;الخميس&quot;, &quot;الجمعة&quot;, &quot;السبت&quot;, &quot;الأحد&quot;),<br>        &quot;ur&quot; to listOf(&quot;پیر&quot;, &quot;منگل&quot;, &quot;بدھ&quot;, &quot;جمعرات&quot;, &quot;جمعہ&quot;, &quot;ہفتہ&quot;, &quot;اتوار&quot;),<br>        &quot;id&quot; to listOf(&quot;Senin&quot;, &quot;Selasa&quot;, &quot;Rabu&quot;, &quot;Kamis&quot;, &quot;Jumat&quot;, &quot;Sabtu&quot;, &quot;Minggu&quot;),<br>        &quot;hi&quot; to listOf(&quot;सोमवार&quot;, &quot;मंगलवार&quot;, &quot;बुधवार&quot;, &quot;गुरुवार&quot;, &quot;शुक्रवार&quot;, &quot;शनिवार&quot;, &quot;रविवार&quot;),<br>        &quot;bn&quot; to listOf(&quot;সোমবার&quot;, &quot;মঙ্গলবার&quot;, &quot;বুধবার&quot;, &quot;বৃহস্পতিবার&quot;, &quot;শুক্রবার&quot;, &quot;শনিবার&quot;, &quot;রবিবার&quot;),<br>        &quot;fa&quot; to listOf(&quot;دوشنبه&quot;, &quot;سه‌شنبه&quot;, &quot;چهارشنبه&quot;, &quot;پنج‌شنبه&quot;, &quot;جمعه&quot;, &quot;شنبه&quot;, &quot;یکشنبه&quot;),<br>        &quot;tr&quot; to listOf(&quot;Pazartesi&quot;, &quot;Salı&quot;, &quot;Çarşamba&quot;, &quot;Perşembe&quot;, &quot;Cuma&quot;, &quot;Cumartesi&quot;, &quot;Pazar&quot;),<br>        &quot;am&quot; to listOf(&quot;ሰኞ&quot;, &quot;ማክሰኞ&quot;, &quot;ረቡዕ&quot;, &quot;ሐሙስ&quot;, &quot;ዓርብ&quot;, &quot;ቅዳሜ&quot;, &quot;እሑድ&quot;),<br>        &quot;fr&quot; to listOf(&quot;lundi&quot;, &quot;mardi&quot;, &quot;mercredi&quot;, &quot;jeudi&quot;, &quot;vendredi&quot;, &quot;samedi&quot;, &quot;dimanche&quot;),<br>        &quot;ms&quot; to listOf(&quot;Isnin&quot;, &quot;Selasa&quot;, &quot;Rabu&quot;, &quot;Khamis&quot;, &quot;Jumaat&quot;, &quot;Sabtu&quot;, &quot;Ahad&quot;),<br>        &quot;az&quot; to listOf(&quot;Bazar ertəsi&quot;, &quot;Çərşənbə axşamı&quot;, &quot;Çərşənbə&quot;, &quot;Cümə axşamı&quot;, &quot;Cümə&quot;, &quot;Şənbə&quot;, &quot;Bazar&quot;),<br>        &quot;kk&quot; to listOf(&quot;Дүйсенбі&quot;, &quot;Сейсенбі&quot;, &quot;Сәрсенбі&quot;, &quot;Бейсенбі&quot;, &quot;Жұма&quot;, &quot;Сенбі&quot;, &quot;Жексенбі&quot;),<br>        &quot;ky&quot; to listOf(&quot;Дүйшөмбү&quot;, &quot;Шейшемби&quot;, &quot;Шаршемби&quot;, &quot;Бейшемби&quot;, &quot;Жума&quot;, &quot;Ишемби&quot;, &quot;Жекшемби&quot;),<br>        &quot;tg&quot; to listOf(&quot;Душанбе&quot;, &quot;Сешанбе&quot;, &quot;Чоршанбе&quot;, &quot;Панҷшанбе&quot;, &quot;Ҷумъа&quot;, &quot;Шанбе&quot;, &quot;Якшанбе&quot;),<br>        &quot;ru&quot; to listOf(&quot;понедельник&quot;, &quot;вторник&quot;, &quot;среда&quot;, &quot;четверг&quot;, &quot;пятница&quot;, &quot;суббота&quot;, &quot;воскресенье&quot;),<br>        &quot;de&quot; to listOf(&quot;Montag&quot;, &quot;Dienstag&quot;, &quot;Mittwoch&quot;, &quot;Donnerstag&quot;, &quot;Freitag&quot;, &quot;Samstag&quot;, &quot;Sonntag&quot;),<br>        &quot;sv&quot; to listOf(&quot;måndag&quot;, &quot;tisdag&quot;, &quot;onsdag&quot;, &quot;torsdag&quot;, &quot;fredag&quot;, &quot;lördag&quot;, &quot;söndag&quot;),<br>        &quot;th&quot; to listOf(&quot;วันจันทร์&quot;, &quot;วันอังคาร&quot;, &quot;วันพุธ&quot;, &quot;วันพฤหัสบดี&quot;, &quot;วันศุกร์&quot;, &quot;วันเสาร์&quot;, &quot;วันอาทิตย์&quot;),<br>        &quot;fil&quot; to listOf(&quot;Lunes&quot;, &quot;Martes&quot;, &quot;Miyerkules&quot;, &quot;Huwebes&quot;, &quot;Biyernes&quot;, &quot;Sabado&quot;, &quot;Linggo&quot;),<br>        &quot;ja&quot; to listOf(&quot;月曜日&quot;, &quot;火曜日&quot;, &quot;水曜日&quot;, &quot;木曜日&quot;, &quot;金曜日&quot;, &quot;土曜日&quot;, &quot;日曜日&quot;),<br>        &quot;es&quot; to listOf(&quot;lunes&quot;, &quot;martes&quot;, &quot;miércoles&quot;, &quot;jueves&quot;, &quot;viernes&quot;, &quot;sábado&quot;, &quot;domingo&quot;),<br>        &quot;ko&quot; to listOf(&quot;월요일&quot;, &quot;화요일&quot;, &quot;수요일&quot;, &quot;목요일&quot;, &quot;금요일&quot;, &quot;토요일&quot;, &quot;일요일&quot;),<br>        &quot;sw&quot; to listOf(&quot;Jumatatu&quot;, &quot;Jumanne&quot;, &quot;Jumatano&quot;, &quot;Alhamisi&quot;, &quot;Ijumaa&quot;, &quot;Jumamosi&quot;, &quot;Jumapili&quot;),<br>        &quot;pt&quot; to listOf(&quot;segunda-feira&quot;, &quot;terça-feira&quot;, &quot;quarta-feira&quot;, &quot;quinta-feira&quot;, &quot;sexta-feira&quot;, &quot;sábado&quot;, &quot;domingo&quot;)<br>    )<br><br>    private val dayShortNames = mapOf(<br>        &quot;en&quot; to defaultShortDays,<br>        &quot;ar&quot; to listOf(&quot;اثن&quot;, &quot;ثلا&quot;, &quot;أرب&quot;, &quot;خمي&quot;, &quot;جمع&quot;, &quot;سبت&quot;, &quot;أحد&quot;),<br>        &quot;ur&quot; to listOf(&quot;پیر&quot;, &quot;منگ&quot;, &quot;بدھ&quot;, &quot;جمع&quot;, &quot;جمعہ&quot;, &quot;ہفتہ&quot;, &quot;ات&quot;),<br>        &quot;id&quot; to listOf(&quot;Sen&quot;, &quot;Sel&quot;, &quot;Rab&quot;, &quot;Kam&quot;, &quot;Jum&quot;, &quot;Sab&quot;, &quot;Min&quot;),<br>        &quot;hi&quot; to listOf(&quot;सोम&quot;, &quot;मंगल&quot;, &quot;बुध&quot;, &quot;गुरु&quot;, &quot;शुक्र&quot;, &quot;शनि&quot;, &quot;रवि&quot;),<br>        &quot;bn&quot; to listOf(&quot;সোম&quot;, &quot;মঙ্গল&quot;, &quot;বুধ&quot;, &quot;বৃহ&quot;, &quot;শুক্র&quot;, &quot;শনি&quot;, &quot;রবি&quot;),<br>        &quot;fa&quot; to listOf(&quot;دو&quot;, &quot;سه&quot;, &quot;چه&quot;, &quot;پن&quot;, &quot;جم&quot;, &quot;شن&quot;, &quot;یک&quot;),<br>        &quot;tr&quot; to listOf(&quot;Pzt&quot;, &quot;Sal&quot;, &quot;Çar&quot;, &quot;Per&quot;, &quot;Cum&quot;, &quot;Cmt&quot;, &quot;Paz&quot;),<br>        &quot;am&quot; to listOf(&quot;ሰኞ&quot;, &quot;ማክ&quot;, &quot;ረቡ&quot;, &quot;ሐሙ&quot;, &quot;ዓር&quot;, &quot;ቅዳ&quot;, &quot;እሑ&quot;),<br>        &quot;fr&quot; to listOf(&quot;lun&quot;, &quot;mar&quot;, &quot;mer&quot;, &quot;jeu&quot;, &quot;ven&quot;, &quot;sam&quot;, &quot;dim&quot;),<br>        &quot;ms&quot; to listOf(&quot;Isn&quot;, &quot;Sel&quot;, &quot;Rab&quot;, &quot;Kha&quot;, &quot;Jum&quot;, &quot;Sab&quot;, &quot;Ahd&quot;),<br>        &quot;az&quot; to listOf(&quot;B.e&quot;, &quot;Ç.a&quot;, &quot;Çər&quot;, &quot;C.a&quot;, &quot;Cüm&quot;, &quot;Şən&quot;, &quot;Baz&quot;),<br>        &quot;kk&quot; to listOf(&quot;Дүй&quot;, &quot;Сей&quot;, &quot;Сәр&quot;, &quot;Бей&quot;, &quot;Жұм&quot;, &quot;Сен&quot;, &quot;Жек&quot;),<br>        &quot;ky&quot; to listOf(&quot;Дүй&quot;, &quot;Шей&quot;, &quot;Шар&quot;, &quot;Бей&quot;, &quot;Жум&quot;, &quot;Ише&quot;, &quot;Жек&quot;),<br>        &quot;tg&quot; to listOf(&quot;Душ&quot;, &quot;Сеш&quot;, &quot;Чор&quot;, &quot;Пан&quot;, &quot;Ҷум&quot;, &quot;Шан&quot;, &quot;Якш&quot;),<br>        &quot;ru&quot; to listOf(&quot;пн&quot;, &quot;вт&quot;, &quot;ср&quot;, &quot;чт&quot;, &quot;пт&quot;, &quot;сб&quot;, &quot;вс&quot;),<br>        &quot;de&quot; to listOf(&quot;Mo&quot;, &quot;Di&quot;, &quot;Mi&quot;, &quot;Do&quot;, &quot;Fr&quot;, &quot;Sa&quot;, &quot;So&quot;),<br>        &quot;sv&quot; to listOf(&quot;mån&quot;, &quot;tis&quot;, &quot;ons&quot;, &quot;tor&quot;, &quot;fre&quot;, &quot;lör&quot;, &quot;sön&quot;),<br>        &quot;th&quot; to listOf(&quot;จ.&quot;, &quot;อ.&quot;, &quot;พ.&quot;, &quot;พฤ.&quot;, &quot;ศ.&quot;, &quot;ส.&quot;, &quot;อา.&quot;),<br>        &quot;fil&quot; to listOf(&quot;Lun&quot;, &quot;Mar&quot;, &quot;Miy&quot;, &quot;Huw&quot;, &quot;Biy&quot;, &quot;Sab&quot;, &quot;Lin&quot;),<br>        &quot;ja&quot; to listOf(&quot;月&quot;, &quot;火&quot;, &quot;水&quot;, &quot;木&quot;, &quot;金&quot;, &quot;土&quot;, &quot;日&quot;),<br>        &quot;es&quot; to listOf(&quot;lun&quot;, &quot;mar&quot;, &quot;mié&quot;, &quot;jue&quot;, &quot;vie&quot;, &quot;sáb&quot;, &quot;dom&quot;),<br>        &quot;ko&quot; to listOf(&quot;월&quot;, &quot;화&quot;, &quot;수&quot;, &quot;목&quot;, &quot;금&quot;, &quot;토&quot;, &quot;일&quot;),<br>        &quot;sw&quot; to listOf(&quot;J3&quot;, &quot;J4&quot;, &quot;J5&quot;, &quot;Alh&quot;, &quot;Iju&quot;, &quot;J1&quot;, &quot;J2&quot;),<br>        &quot;pt&quot; to listOf(&quot;seg&quot;, &quot;ter&quot;, &quot;qua&quot;, &quot;qui&quot;, &quot;sex&quot;, &quot;sáb&quot;, &quot;dom&quot;)<br>    )<br><br>    fun monthName(month: Int, locale: Locale, short: Boolean = false): String =<br>        resolve(locale, if (short) monthShortNames else monthNames)[month - 1]<br><br>    fun dayName(dayOfWeek: DayOfWeek, locale: Locale, short: Boolean = false): String =<br>        resolve(locale, if (short) dayShortNames else dayNames)[dayOfWeek.ordinal]<br><br>    private fun resolve(locale: Locale, map: Map&lt;String, List&lt;String&gt;&gt;): List&lt;String&gt; {<br>        return map[locale.language.lowercase()] ?: map[&quot;en&quot;] ?: error(&quot;English locale data missing&quot;)<br>    }<br>}</pre><h3>MuslimCalendar.kt</h3><p>Main entry point that developers interact with. It connects everything together.</p><pre>package com.muslim.calendar<br><br>import java.time.LocalDate<br>import java.util.Locale<br><br>/**<br> * Umm Al-Qura Hijri date model.<br> *<br> * Month is 1-based (1..12). Offset is applied after conversion and can be in -3..3.<br> */<br>data class MuslimCalendar(<br>    val year: Int,<br>    val month: Int,<br>    val day: Int,<br>    val offsetDays: Int = 0<br>) {<br>    init {<br>        require(offsetDays in -3..3) { &quot;offsetDays must be between -3 and 3&quot; }<br>        UmmAlQuraData.validateHijriRange(year, month, day)<br>    }<br><br>    fun setOffset(days: Int): MuslimCalendar = copy(offsetDays = days)<br><br>    fun toGregorian(): LocalDate {<br>        val value = adjusted()<br>        return HijriConverter.toGregorian(value)<br>    }<br><br>    fun getMonthName(locale: Locale = Locale.ENGLISH): String =<br>        LocaleProvider.monthName(adjusted().month, locale, short = false)<br><br>    fun getDayName(locale: Locale = Locale.ENGLISH): String =<br>        LocaleProvider.dayName(toGregorian().dayOfWeek, locale, short = false)<br><br>    fun format(pattern: String, locale: Locale = Locale.ENGLISH): String =<br>        Formatter.format(this, pattern, locale)<br><br>    internal fun adjusted(): HijriDate {<br>        if (offsetDays == 0) return HijriDate(year, month, day)<br>        val shifted = HijriConverter.toGregorian(HijriDate(year, month, day)).plusDays(offsetDays.toLong())<br>        return HijriConverter.fromGregorian(shifted)<br>    }<br><br>    companion object {<br>        fun fromGregorian(date: LocalDate, offsetDays: Int = 0): MuslimCalendar {<br>            require(offsetDays in -3..3) { &quot;offsetDays must be between -3 and 3&quot; }<br>            val converted = HijriConverter.fromGregorian(date)<br>            return MuslimCalendar(converted.year, converted.month, converted.day, offsetDays)<br>        }<br><br>        fun parse(input: String, pattern: String, locale: Locale = Locale.ENGLISH): MuslimCalendar =<br>            Parser.parse(input, pattern, locale)<br><br>        fun lengthOfMonth(year: Int, month: Int): Int = HijriConverter.lengthOfMonth(year, month)<br><br>        fun lengthOfYear(year: Int): Int = HijriConverter.lengthOfYear(year)<br><br>        fun isLeapYear(year: Int): Boolean = HijriConverter.isLeapYear(year)<br>    }<br>}</pre><h3>Parser.kt</h3><p>Parses date inputs and ensures safe conversions.</p><pre>package com.muslim.calendar<br><br>import java.time.DayOfWeek<br>import java.util.Locale<br><br>object Parser {<br>    fun parse(input: String, pattern: String, locale: Locale = Locale.ENGLISH): MuslimCalendar {<br>        var year: Int? = null<br>        var month: Int? = null<br>        var day: Int? = null<br>        var pi = 0<br>        var ii = 0<br><br>        while (pi &lt; pattern.length) {<br>            val p = pattern[pi]<br>            if (!p.isLetter()) {<br>                require(ii &lt; input.length &amp;&amp; input[ii] == p) { &quot;Expected &#39;$p&#39; at position $ii&quot; }<br>                pi++<br>                ii++<br>                continue<br>            }<br><br>            var run = 1<br>            while (pi + run &lt; pattern.length &amp;&amp; pattern[pi + run] == p) run++<br><br>            when (p) {<br>                &#39;d&#39; -&gt; {<br>                    val len = if (run &gt;= 2) 2 else consumeNumberLength(input, ii, 1, 2)<br>                    day = input.substring(ii, ii + len).toInt()<br>                    ii += len<br>                }<br>                &#39;M&#39; -&gt; {<br>                    if (run &gt;= 3) {<br>                        val parsed = parseMonthName(input, ii, locale, run == 3)<br>                        month = parsed.first<br>                        ii += parsed.second<br>                    } else {<br>                        val len = if (run == 2) 2 else consumeNumberLength(input, ii, 1, 2)<br>                        month = input.substring(ii, ii + len).toInt()<br>                        ii += len<br>                    }<br>                }<br>                &#39;y&#39; -&gt; {<br>                    val len = if (run &gt;= 4) 4 else if (run == 2) 2 else consumeNumberLength(input, ii, 1, 4)<br>                    val value = input.substring(ii, ii + len).toInt()<br>                    year = if (run == 2) 1400 + value else value<br>                    ii += len<br>                }<br>                &#39;E&#39; -&gt; {<br>                    ii += parseDayName(input, ii, locale, run &lt; 4)<br>                }<br>                else -&gt; error(&quot;Unsupported token: $p&quot;)<br>            }<br>            pi += run<br>        }<br><br>        require(ii == input.length) { &quot;Unexpected trailing input at position $ii&quot; }<br>        return MuslimCalendar(<br>            year = year ?: error(&quot;Missing year in input&quot;),<br>            month = month ?: error(&quot;Missing month in input&quot;),<br>            day = day ?: error(&quot;Missing day in input&quot;)<br>        )<br>    }<br><br>    private fun consumeNumberLength(input: String, index: Int, min: Int, max: Int): Int {<br>        var len = 0<br>        while (index + len &lt; input.length &amp;&amp; input[index + len].isDigit() &amp;&amp; len &lt; max) len++<br>        require(len &gt;= min) { &quot;Expected number at position $index&quot; }<br>        return len<br>    }<br><br>    private fun parseMonthName(input: String, index: Int, locale: Locale, short: Boolean): Pair&lt;Int, Int&gt; {<br>        for (month in 1..12) {<br>            val name = LocaleProvider.monthName(month, locale, short)<br>            if (input.regionMatches(index, name, 0, name.length, ignoreCase = true)) {<br>                return month to name.length<br>            }<br>        }<br>        error(&quot;Unable to parse month name at position $index&quot;)<br>    }<br><br>    private fun parseDayName(input: String, index: Int, locale: Locale, short: Boolean): Int {<br>        for (day in DayOfWeek.entries) {<br>            val name = LocaleProvider.dayName(day, locale, short)<br>            if (input.regionMatches(index, name, 0, name.length, ignoreCase = true)) {<br>                return name.length<br>            }<br>        }<br>        error(&quot;Unable to parse day name at position $index&quot;)<br>    }<br>}</pre><h3>UmmAlQuraData.kt</h3><p>Contains precomputed calendar data for accurate Hijri calculations.</p><pre>package com.muslim.calendar<br><br>internal object UmmAlQuraData {<br>    const val MIN_HIJRI_YEAR: Int = 1356<br>    const val MAX_HIJRI_YEAR: Int = 1500<br><br>    private const val JULIAN_DAY_OFFSET: Int = 2_400_000<br>    private const val MONTH_INDEX_ANCHOR: Int = 16_260<br><br>   private val NEW_MOON_MJDN: IntArray = intArrayOf(28607, 28636, 28665, 28695, 28724, 28754, 28783, 28813, 28843, 28872, 28901, 28931, 28960, 28990, 29019, 29049, 29078, 29108, 29137, 29167, 29196, 29226, 29255, 29285, 29315, 29345, 29375, 29404, 29434, 29463, 29492, 29522, 29551, 29580, 29610, 29640, 29669, 29699, 29729, 29759, 29788, 29818, 29847, 29876, 29906, 29935, 29964, 29994, 30023, 30053, 30082, 30112, 30141, 30171, 30200, 30230, 30259, 30289, 30318, 30348, 30378, 30408, 30437, 30467, 30496, 30526, 30555, 30585, 30614, 30644, 30673, 30703, 30732, 30762, 30791, 30821, 30850, 30880, 30909, 30939, 30968, 30998, 31027, 31057, 31086, 31116, 31145, 31175, 31204, 31234, 31263, 31293, 31322, 31352, 31381, 31411, 31441, 31471, 31500, 31530, 31559, 31589, 31618, 31648, 31676, 31706, 31736, 31766, 31795, 31825, 31854, 31884, 31913, 31943, 31972, 32002, 32031, 32061, 32090, 32120, 32150, 32180, 32209, 32239, 32268, 32298, 32327, 32357, 32386, 32416, 32445, 32475, 32504, 32534, 32563, 32593, 32622, 32652, 32681, 32711, 32740, 32770, 32799, 32829, 32858, 32888, 32917, 32947, 32976, 33006, 33035, 33065, 33094, 33124, 33153, 33183, 33213, 33243, 33272, 33302, 33331, 33361, 33390, 33420, 33450, 33479, 33509, 33539, 33568, 33598, 33627, 33657, 33686, 33716, 33745, 33775, 33804, 33834, 33863, 33893, 33922, 33952, 33981, 34011, 34040, 34069, 34099, 34128, 34158, 34187, 34217, 34247, 34277, 34306, 34336, 34365, 34395, 34424, 34454, 34483, 34512, 34542, 34571, 34601, 34631, 34660, 34690, 34719, 34749, 34778, 34808, 34837, 34867, 34896, 34926, 34955, 34985, 35015, 35044, 35074, 35103, 35133, 35162, 35192, 35222, 35251, 35280, 35310, 35340, 35370, 35399, 35429, 35458, 35488, 35517, 35547, 35576, 35605, 35635, 35665, 35694, 35723, 35753, 35782, 35811, 35841, 35871, 35901, 35930, 35960, 35989, 36019, 36048, 36078, 36107, 36136, 36166, 36195, 36225, 36254, 36284, 36314, 36343, 36373, 36403, 36433, 36462, 36492, 36521, 36551, 36580, 36610, 36639, 36669, 36698, 36728, 36757, 36786, 36816, 36845, 36875, 36904, 36934, 36963, 36993, 37022, 37052, 37081, 37111, 37141, 37170, 37200, 37229, 37259, 37288, 37318, 37347, 37377, 37406, 37436, 37465, 37495, 37524, 37554, 37584, 37613, 37643, 37672, 37701, 37731, 37760, 37790, 37819, 37849, 37878, 37908, 37938, 37967, 37997, 38027, 38056, 38085, 38115, 38144, 38174, 38203, 38233, 38262, 38292, 38322, 38351, 38381, 38410, 38440, 38469, 38499, 38528, 38558, 38587, 38617, 38646, 38676, 38705, 38735, 38764, 38794, 38823, 38853, 38882, 38912, 38941, 38971, 39001, 39030, 39059, 39089, 39118, 39148, 39178, 39208, 39237, 39267, 39297, 39326, 39355, 39385, 39414, 39444, 39473, 39503, 39532, 39562, 39592, 39621, 39650, 39680, 39709, 39739, 39768, 39798, 39827, 39857, 39886, 39916, 39946, 39975, 40005, 40035, 40064, 40094, 40123, 40153, 40182, 40212, 40241, 40271, 40300, 40330, 40359, 40389, 40418, 40448, 40477, 40507, 40536, 40566, 40595, 40625, 40655, 40685, 40714, 40744, 40773, 40803, 40832, 40862, 40892, 40921, 40951, 40980, 41009, 41039, 41068, 41098, 41127, 41157, 41186, 41216, 41245, 41275, 41304, 41334, 41364, 41393, 41422, 41452, 41481, 41511, 41540, 41570, 41599, 41629, 41658, 41688, 41718, 41748, 41777, 41807, 41836, 41865, 41894, 41924, 41953, 41983, 42012, 42042, 42072, 42102, 42131, 42161, 42190, 42220, 42249, 42279, 42308, 42337, 42367, 42397, 42426, 42456, 42485, 42515, 42545, 42574, 42604, 42633, 42662, 42692, 42721, 42751, 42780, 42810, 42839, 42869, 42899, 42929, 42958, 42988, 43017, 43046, 43076, 43105, 43135, 43164, 43194, 43223, 43253, 43283, 43312, 43342, 43371, 43401, 43430, 43460, 43489, 43519, 43548, 43578, 43607, 43637, 43666, 43696, 43726, 43755, 43785, 43814, 43844, 43873, 43903, 43932, 43962, 43991, 44021, 44050, 44080, 44109, 44139, 44169, 44198, 44228, 44258, 44287, 44317, 44346, 44375, 44405, 44434, 44464, 44493, 44523, 44553, 44582, 44612, 44641, 44671, 44700, 44730, 44759, 44788, 44818, 44847, 44877, 44906, 44936, 44966, 44996, 45025, 45055, 45084, 45114, 45143, 45172, 45202, 45231, 45261, 45290, 45320, 45350, 45380, 45409, 45439, 45468, 45498, 45527, 45556, 45586, 45615, 45644, 45674, 45704, 45733, 45763, 45793, 45823, 45852, 45882, 45911, 45940, 45970, 45999, 46028, 46058, 46088, 46117, 46147, 46177, 46206, 46236, 46265, 46295, 46324, 46354, 46383, 46413, 46442, 46472, 46501, 46531, 46560, 46590, 46620, 46649, 46679, 46708, 46738, 46767, 46797, 46826, 46856, 46885, 46915, 46944, 46974, 47003, 47033, 47063, 47092, 47122, 47151, 47181, 47210, 47240, 47269, 47298, 47328, 47357, 47387, 47417, 47446, 47476, 47506, 47535, 47565, 47594, 47624, 47653, 47682, 47712, 47741, 47771, 47800, 47830, 47860, 47890, 47919, 47949, 47978, 48008, 48037, 48066, 48096, 48125, 48155, 48184, 48214, 48244, 48273, 48303, 48333, 48362, 48392, 48421, 48450, 48480, 48509, 48538, 48568, 48598, 48627, 48657, 48687, 48717, 48746, 48776, 48805, 48834, 48864, 48893, 48922, 48952, 48982, 49011, 49041, 49071, 49100, 49130, 49160, 49189, 49218, 49248, 49277, 49306, 49336, 49365, 49395, 49425, 49455, 49484, 49514, 49543, 49573, 49602, 49632, 49661, 49690, 49720, 49749, 49779, 49809, 49838, 49868, 49898, 49927, 49957, 49986, 50016, 50045, 50075, 50104, 50133, 50163, 50192, 50222, 50252, 50281, 50311, 50340, 50370, 50400, 50429, 50459, 50488, 50518, 50547, 50576, 50606, 50635, 50665, 50694, 50724, 50754, 50784, 50813, 50843, 50872, 50902, 50931, 50960, 50990, 51019, 51049, 51078, 51108, 51138, 51167, 51197, 51227, 51256, 51286, 51315, 51345, 51374, 51403, 51433, 51462, 51492, 51522, 51552, 51582, 51611, 51641, 51670, 51699, 51729, 51758, 51787, 51816, 51846, 51876, 51906, 51936, 51965, 51995, 52025, 52054, 52083, 52113, 52142, 52171, 52200, 52230, 52260, 52290, 52319, 52349, 52379, 52408, 52438, 52467, 52497, 52526, 52555, 52585, 52614, 52644, 52673, 52703, 52733, 52762, 52792, 52822, 52851, 52881, 52910, 52939, 52969, 52998, 53028, 53057, 53087, 53116, 53146, 53176, 53205, 53235, 53264, 53294, 53324, 53353, 53383, 53412, 53441, 53471, 53500, 53530, 53559, 53589, 53619, 53648, 53678, 53708, 53737, 53767, 53796, 53825, 53855, 53884, 53913, 53943, 53973, 54003, 54032, 54062, 54092, 54121, 54151, 54180, 54209, 54239, 54268, 54297, 54327, 54357, 54387, 54416, 54446, 54476, 54505, 54535, 54564, 54593, 54623, 54652, 54681, 54711, 54741, 54770, 54800, 54830, 54859, 54889, 54919, 54948, 54977, 55007, 55036, 55066, 55095, 55125, 55154, 55184, 55213, 55243, 55273, 55302, 55332, 55361, 55391, 55420, 55450, 55479, 55508, 55538, 55567, 55597, 55627, 55657, 55686, 55716, 55745, 55775, 55804, 55834, 55863, 55892, 55922, 55951, 55981, 56011, 56040, 56070, 56100, 56129, 56159, 56188, 56218, 56247, 56276, 56306, 56335, 56365, 56394, 56424, 56454, 56483, 56513, 56543, 56572, 56601, 56631, 56660, 56690, 56719, 56749, 56778, 56808, 56837, 56867, 56897, 56926, 56956, 56985, 57015, 57044, 57074, 57103, 57133, 57162, 57192, 57221, 57251, 57280, 57310, 57340, 57369, 57399, 57429, 57458, 57487, 57517, 57546, 57576, 57605, 57634, 57664, 57694, 57723, 57753, 57783, 57813, 57842, 57871, 57901, 57930, 57959, 57989, 58018, 58048, 58077, 58107, 58137, 58167, 58196, 58226, 58255, 58285, 58314, 58343, 58373, 58402, 58432, 58461, 58491, 58521, 58551, 58580, 58610, 58639, 58669, 58698, 58727, 58757, 58786, 58816, 58845, 58875, 58905, 58934, 58964, 58994, 59023, 59053, 59082, 59111, 59141, 59170, 59200, 59229, 59259, 59288, 59318, 59348, 59377, 59407, 59436, 59466, 59495, 59525, 59554, 59584, 59613, 59643, 59672, 59702, 59731, 59761, 59791, 59820, 59850, 59879, 59909, 59939, 59968, 59997, 60027, 60056, 60086, 60115, 60145, 60174, 60204, 60234, 60264, 60293, 60323, 60352, 60381, 60411, 60440, 60469, 60499, 60528, 60558, 60588, 60618, 60648, 60677, 60707, 60736, 60765, 60795, 60824, 60853, 60883, 60912, 60942, 60972, 61002, 61031, 61061, 61090, 61120, 61149, 61179, 61208, 61237, 61267, 61296, 61326, 61356, 61385, 61415, 61445, 61474, 61504, 61533, 61563, 61592, 61621, 61651, 61680, 61710, 61739, 61769, 61799, 61828, 61858, 61888, 61917, 61947, 61976, 62006, 62035, 62064, 62094, 62123, 62153, 62182, 62212, 62242, 62271, 62301, 62331, 62360, 62390, 62419, 62448, 62478, 62507, 62537, 62566, 62596, 62625, 62655, 62685, 62715, 62744, 62774, 62803, 62832, 62862, 62891, 62921, 62950, 62980, 63009, 63039, 63069, 63099, 63128, 63157, 63187, 63216, 63246, 63275, 63305, 63334, 63363, 63393, 63423, 63453, 63482, 63512, 63541, 63571, 63600, 63630, 63659, 63689, 63718, 63747, 63777, 63807, 63836, 63866, 63895, 63925, 63955, 63984, 64014, 64043, 64073, 64102, 64131, 64161, 64190, 64220, 64249, 64279, 64309, 64339, 64368, 64398, 64427, 64457, 64486, 64515, 64545, 64574, 64603, 64633, 64663, 64692, 64722, 64752, 64782, 64811, 64841, 64870, 64899, 64929, 64958, 64987, 65017, 65047, 65076, 65106, 65136, 65166, 65195, 65225, 65254, 65283, 65313, 65342, 65371, 65401, 65431, 65460, 65490, 65520, 65549, 65579, 65608, 65638, 65667, 65697, 65726, 65755, 65785, 65815, 65844, 65874, 65903, 65933, 65963, 65992, 66022, 66051, 66081, 66110, 66140, 66169, 66199, 66228, 66258, 66287, 66317, 66346, 66376, 66405, 66435, 66465, 66494, 66524, 66553, 66583, 66612, 66641, 66671, 66700, 66730, 66760, 66789, 66819, 66849, 66878, 66908, 66937, 66967, 66996, 67025, 67055, 67084, 67114, 67143, 67173, 67203, 67233, 67262, 67292, 67321, 67351, 67380, 67409, 67439, 67468, 67497, 67527, 67557, 67587, 67617, 67646, 67676, 67705, 67735, 67764, 67793, 67823, 67852, 67882, 67911, 67941, 67971, 68000, 68030, 68060, 68089, 68119, 68148, 68177, 68207, 68236, 68266, 68295, 68325, 68354, 68384, 68414, 68443, 68473, 68502, 68532, 68561, 68591, 68620, 68650, 68679, 68708, 68738, 68768, 68797, 68827, 68857, 68886, 68916, 68946, 68975, 69004, 69034, 69063, 69092, 69122, 69152, 69181, 69211, 69240, 69270, 69300, 69330, 69359, 69388, 69418, 69447, 69476, 69506, 69535, 69565, 69595, 69624, 69654, 69684, 69713, 69743, 69772, 69802, 69831, 69861, 69890, 69919, 69949, 69978, 70008, 70038, 70067, 70097, 70126, 70156, 70186, 70215, 70245, 70274, 70303, 70333, 70362, 70392, 70421, 70451, 70481, 70510, 70540, 70570, 70599, 70629, 70658, 70687, 70717, 70746, 70776, 70805, 70835, 70864, 70894, 70924, 70954, 70983, 71013, 71042, 71071, 71101, 71130, 71159, 71189, 71218, 71248, 71278, 71308, 71337, 71367, 71397, 71426, 71455, 71485, 71514, 71543, 71573, 71602, 71632, 71662, 71691, 71721, 71751, 71810, 71839, 71869, 71898, 71927, 71957, 71986, 72016, 72046, 72075, 72105, 72135, 72164, 72194, 72223, 72253, 72282, 72311, 72341, 72370, 72400, 72429, 72459, 72489, 72518, 72548, 72577, 72607, 72637, 72666, 72695, 72725, 72754, 72784, 72813, 72843, 72872, 72902, 72931, 72961, 72991, 73020, 73050, 73080, 73109, 73139, 73168, 73197, 73227, 73256, 73286, 73315, 73345, 73375, 73404, 73434, 73464, 73493, 73523, 73552, 73581, 73611, 73640, 73669, 73699, 73729, 73758, 73788, 73818, 73848, 73877, 73907, 73936, 73965, 73995, 74024, 74053, 74083, 74113, 74142, 74172, 74202, 74231, 74261, 74291, 74320, 74349, 74379, 74408, 74437, 74467, 74497, 74526, 74556, 74586, 74615, 74645, 74675, 74704, 74733, 74763, 74792, 74822, 74851, 74881, 74910, 74940, 74969, 74999, 75029, 75058, 75088, 75117, 75147, 75176, 75206, 75235, 75264, 75294, 75323, 75353, 75383, 75412, 75442, 75472, 75501, 75531, 75560, 75590, 75619, 75648, 75678, 75707, 75737, 75766, 75796, 75826, 75856, 75885, 75915, 75944, 75974, 76003, 76032, 76062, 76091, 76121, 76150, 76180, 76210, 76239, 76269, 76299, 76328, 76358, 76387, 76416, 76446, 76475, 76505, 76534, 76564, 76593, 76623, 76653, 76682, 76712, 76741, 76771, 76801, 76830, 76859, 76889, 76918, 76948, 76977, 77007, 77036, 77066, 77096, 77125, 77155, 77185, 77214, 77243, 77273, 77302, 77332, 77361, 77390, 77420, 77450, 77479, 77509, 77539, 77569, 77598, 77627, 77657, 77686, 77715, 77745, 77774, 77804, 77833, 77863, 77893, 77923, 77952, 77982, 78011, 78041, 78070, 78099, 78129, 78158, 78188, 78217, 78247, 78277, 78307, 78336, 78366, 78395, 78425, 78454, 78483, 78513, 78542, 78572, 78601, 78631, 78661, 78690, 78720, 78750, 78779, 78808, 78838, 78867, 78897, 78926, 78956, 78985, 79015, 79044, 79074, 79104, 79133, 79163, 79192, 79222, 79251, 79281, 79310, 79340, 79369, 79399, 79428, 79458, 79517, 79546, 79576, 79606, 79635, 79665, 79695, 79724, 79753, 79783, 79812, 79841, 79871, 79900, 79930, 79960, 79990)<br><br>    fun getDaysInMonth(year: Int, month: Int): Int {<br>        val index = getNewMoonIndex(year, month)<br>        return at(index) - at(index - 1)<br>    }<br><br>    fun hijriToJulianDay(year: Int, month: Int, day: Int): Int {<br>        val index = getNewMoonIndex(year, month)<br>        val mjdn = day + at(index - 1) - 1<br>        return mjdn + JULIAN_DAY_OFFSET<br>    }<br><br>    fun julianDayToHijri(julianDay: Int): HijriDate {<br>        val mjdn = julianDay - JULIAN_DAY_OFFSET<br>        val index = getNewMoonIndexByMjdn(mjdn)<br>        val totalMonths = index + MONTH_INDEX_ANCHOR<br>        val completedYears = (totalMonths - 1) / 12<br>        val year = completedYears + 1<br>        val month = totalMonths - (12 * completedYears)<br>        val day = mjdn - at(index - 1) + 1<br>        return HijriDate(year, month, day)<br>    }<br><br>    fun validateHijriRange(year: Int, month: Int, day: Int) {<br>        require(year in MIN_HIJRI_YEAR..MAX_HIJRI_YEAR) {<br>            &quot;Supported Hijri year range is $MIN_HIJRI_YEAR..$MAX_HIJRI_YEAR&quot;<br>        }<br>        require(month in 1..12) { &quot;Hijri month must be in 1..12&quot; }<br>        val maxDay = getDaysInMonth(year, month)<br>        require(day in 1..maxDay) { &quot;Hijri day must be in 1..$maxDay for $year/$month&quot; }<br>    }<br><br>    private fun getNewMoonIndex(year: Int, month: Int): Int {<br>        val totalMonths = ((year - 1) * 12) + month<br>        return totalMonths - MONTH_INDEX_ANCHOR<br>    }<br><br>    private fun getNewMoonIndexByMjdn(mjdn: Int): Int {<br>        var low = 0<br>        var high = NEW_MOON_MJDN.lastIndex<br>        while (low &lt;= high) {<br>            val mid = (low + high) ushr 1<br>            if (NEW_MOON_MJDN[mid] &gt; mjdn) high = mid - 1 else low = mid + 1<br>        }<br>        return low<br>    }<br><br>    private fun at(index: Int): Int {<br>        require(index in NEW_MOON_MJDN.indices) { &quot;Valid date should be between 1356 AH (14 March 1937 CE) and 1500 AH (16 November 2077 CE)&quot; }<br>        return NEW_MOON_MJDN[index]<br>    }<br>}</pre><h3>Usage examples</h3><p>Below are some examples demonstrating how to use it.</p><h3>1) Get current Hijri date</h3><pre>// val today = LocalDate.now()<br>val today = LocalDate.of(2026, 4, 13)<br>val currentHijri = MuslimCalendar.fromGregorian(today)<br><br>println(&quot;Today (Gregorian): $today&quot;)<br>// Output: Today (Gregorian): 2026-04-13<br>println(&quot;Current Hijri Date: ${currentHijri.year} ${currentHijri.getMonthName(Locale.ENGLISH)} ${currentHijri.day}&quot;)<br>// Output: Current Hijri Date: 1447 Shawwal 25</pre><h3>2) Create a custom Hijri date</h3><pre>val hijri = MuslimCalendar(year = 1446, month = 9, day = 10)<br>println(hijri)<br>// Output: MuslimCalendar(year=1446, month=9, day=10, offsetDays=0)</pre><h3>3) Gregorian to Hijri</h3><pre>// val today = LocalDate.now()<br>val today = LocalDate.of(2026, 4, 13)<br>val convertedFromGregorian = MuslimCalendar.fromGregorian(today)<br>println(&quot;Gregorian $today -&gt; Hijri ${convertedFromGregorian.format(&quot;dd MMMM yyyy&quot;, Locale.ENGLISH)}&quot;)<br>// Output: Gregorian 2026-04-13 -&gt; Hijri 25 Shawwal 1447</pre><h3>4) Hijri to Gregorian</h3><pre>val customHijri = MuslimCalendar(1446, 9, 10)<br>val customGregorian = customHijri.toGregorian()<br>println(&quot;Custom Hijri: ${customHijri.format(&quot;dd MMMM yyyy&quot;, Locale.ENGLISH)}&quot;)<br>// Output: Custom Hijri: 10 Ramadan 1446<br>println(&quot;Converted Gregorian: $customGregorian&quot;)<br>// Output: Converted Gregorian: 2025-03-10</pre><h3>5) Offset usage (+1 / -1)</h3><pre>val customHijri = MuslimCalendar(1446, 9, 10)<br>val offsetZero = customHijri.setOffset(0)<br>val offsetPlus = customHijri.setOffset(1)<br>val offsetMinus = customHijri.setOffset(-1)<br><br>println(&quot;Offset 0 : ${offsetZero.format(&quot;dd MMMM yyyy&quot;, Locale.ENGLISH)}&quot;)<br>// Output: Offset 0 : 10 Ramadan 1446<br>println(&quot;Offset +1: ${offsetPlus.format(&quot;dd MMMM yyyy&quot;, Locale.ENGLISH)}&quot;)<br>// Output: Offset +1: 11 Ramadan 1446<br>println(&quot;Offset -1: ${offsetMinus.format(&quot;dd MMMM yyyy&quot;, Locale.ENGLISH)}&quot;)<br>// Output: Offset -1: 09 Ramadan 1446<br>val base = MuslimCalendar(1446, 9, 1)<br>val adjusted = base.setOffset(1)<br>println(adjusted.format(&quot;dd MMMM yyyy&quot;, Locale.ENGLISH))<br>// Output: 02 Ramadan 1446</pre><h3>6) Localization (Arabic, Urdu)</h3><pre>val date = MuslimCalendar(1446, 9, 10)<br>println(&quot;English: ${date.getDayName(Locale.ENGLISH)}, ${date.getMonthName(Locale.ENGLISH)}&quot;)<br>// Output: English: Monday, Ramadan<br>println(&quot;Arabic : ${date.getDayName(Locale(&quot;ar&quot;))}, ${date.getMonthName(Locale(&quot;ar&quot;))}&quot;)<br>// Output: Arabic : الاثنين, رمضان<br>println(&quot;Urdu   : ${date.getDayName(Locale(&quot;ur&quot;, &quot;PK&quot;))}, ${date.getMonthName(Locale(&quot;ur&quot;, &quot;PK&quot;))}&quot;)<br>// Output: Urdu   : پیر, رمضان</pre><h3>7) Formatting</h3><p>Supported tokens:</p><ul><li>d, dd</li><li>M, MM, MMM, MMMM</li><li>y, yy, yyyy</li><li>E, EEEE</li></ul><pre>val date = MuslimCalendar(1446, 9, 10)<br>println(&quot;Pattern [dd MMMM yyyy]: ${date.format(&quot;dd MMMM yyyy&quot;, Locale.ENGLISH)}&quot;)<br>// Output: Pattern [dd MMMM yyyy]: 10 Ramadan 1446<br>println(&quot;Pattern [EEEE, d MMMM yyyy]: ${date.format(&quot;EEEE, d MMMM yyyy&quot;, Locale.ENGLISH)}&quot;)<br>// Output: Pattern [EEEE, d MMMM yyyy]: Monday, 10 Ramadan 1446</pre><h3>8) Parsing</h3><pre>val parseInput = &quot;10 Ramadan 1446&quot;<br>val parsed = MuslimCalendar.parse(<br>    input = parseInput,<br>    pattern = &quot;dd MMMM yyyy&quot;,<br>    locale = Locale.ENGLISH<br>)<br>println(&quot;Input: $parseInput&quot;)<br>// Output: Input: 10 Ramadan 1446<br>println(&quot;Parsed: ${parsed.format(&quot;dd MMMM yyyy&quot;, Locale.ENGLISH)}&quot;)<br>// Output: Parsed: 10 Ramadan 1446</pre><h3>9) Month and Year info</h3><pre>val customHijri = MuslimCalendar(1446, 9, 10)<br>println(&quot;Length of month (${customHijri.month}/${customHijri.year}): ${MuslimCalendar.lengthOfMonth(customHijri.year, customHijri.month)} days&quot;)<br>// Output: Length of month (9/1446): 29 days<br>println(&quot;Length of year (${customHijri.year}): ${MuslimCalendar.lengthOfYear(customHijri.year)} days&quot;)<br>// Output: Length of year (1446): 354 days<br>println(&quot;Is leap year (${customHijri.year}): ${MuslimCalendar.isLeapYear(customHijri.year)}&quot;)<br>// Output: Is leap year (1446): false</pre><h3>🌍 Locale Support</h3><p>Supports 25+ languages<br>Includes Arabic, English, and Urdu<br>Locale mappings are easy to extend through LocaleProvider</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*7RL00IYdcEaeJaJendL_jA.png" /></figure><p>To add a new locale, provide:</p><ul><li>full month names</li><li>short month names</li><li>full day names</li><li>short day names</li></ul><h3>⚠️ Limitations</h3><ul><li>Valid only inside the supported Umm Al Qura data range</li><li>offsetDays is a manual post conversion adjustment</li><li>Not an astronomical moon sighting engine</li><li>Supported range: 1300H to 1600H</li></ul><h3>⭐ GitHub Repository</h3><p>Check out the full project here:<br>👉 <a href="https://github.com/orbitalsonic/SonicMuslimCalendar">https://github.com/orbitalsonic/SonicMuslimCalendar</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c444e21c2022" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jetpack Compose Roadmap: From Beginner to Advanced (Step-by-Step Guide)]]></title>
            <link>https://orbitalsonic.medium.com/jetpack-compose-roadmap-from-beginner-to-advanced-step-by-step-guide-00ac7c7bd3f1?source=rss-e5fc16dbbf3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/00ac7c7bd3f1</guid>
            <category><![CDATA[compose-roadmap]]></category>
            <category><![CDATA[roadmaps]]></category>
            <category><![CDATA[android-jetpack-compose]]></category>
            <category><![CDATA[android-compose]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <dc:creator><![CDATA[Muhammad Yaqoob]]></dc:creator>
            <pubDate>Wed, 01 Apr 2026 11:18:18 GMT</pubDate>
            <atom:updated>2026-04-28T06:05:50.715Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JY-bUm1X0CeKZJDLS1D2fw.png" /></figure><p>If you’re an Android developer looking to modernize your UI skills, <strong>Jetpack Compose</strong> is no longer optional it’s the future. When I started learning Compose, I realized that jumping randomly between topics made things confusing. So I created a structured roadmap to go from <strong>basic to advanced</strong>, and this guide is the result.</p><p>This roadmap will help you learn Compose in layers the right way.</p><h3>🧱 Phase 1: Fundamentals (Beginner Level)</h3><h4>🔹 What is Jetpack Compose?</h4><p>Jetpack Compose is a <strong>declarative UI toolkit</strong>, meaning you describe what your UI should look like, and the system handles the rest.</p><p>Instead of XML, you now write UI using Kotlin functions.</p><pre>@Composable<br>fun Greeting(name: String) {<br>    Text(text = &quot;Hello $name&quot;)<br>}</pre><h4>🔹 Core Concepts You Must Learn</h4><p>Start with the absolute basics:</p><ul><li>@Composable functions</li><li>setContent {} entry point</li><li>Basic UI components:</li><li>Text</li><li>Button</li><li>Image</li></ul><h4>🔹 Layouts</h4><p>Compose provides simple layout systems:</p><ul><li>Column → vertical layout</li><li>Row → horizontal layout</li><li>Box → stack elements</li></ul><p>👉 Practice:</p><ul><li>Create a profile UI</li><li>Build a static login screen</li></ul><h4>🔹 Modifiers (Super Important)</h4><p>Modifiers define how your UI looks and behaves.</p><pre>Text(<br>    text = &quot;Hello&quot;,<br>    modifier = Modifier<br>        .padding(16.dp)<br>        .background(Color.Red)<br>)</pre><p>👉 Learn:</p><ul><li>spacing (padding)</li><li>sizing (size, fillMaxWidth)</li><li>click handling (clickable)</li></ul><h3>⚡ Phase 2: State &amp; Interaction (Intermediate Level)</h3><h4>🔹 Understanding State</h4><p>State is the heart of Compose.</p><pre>var count by remember { mutableStateOf(0) }</pre><p>👉 Key concepts:</p><ul><li>remember</li><li>mutableStateOf</li><li>recomposition (UI updates automatically)</li></ul><h4>🔹 Handling User Interaction</h4><pre>Button(onClick = { count++ }) {<br>    Text(&quot;Clicked $count times&quot;)<br>}</pre><p>👉 Practice:</p><ul><li>Counter app</li><li>Toggle switch</li><li>Simple form validation</li></ul><h4>🔹 Lists &amp; Lazy Components</h4><pre>LazyColumn {<br>    items(100) {<br>        Text(&quot;Item $it&quot;)<br>    }<br>}</pre><p>👉 Learn:</p><ul><li>LazyColumn</li><li>LazyRow</li><li>Efficient rendering</li></ul><h3>🧠 Phase 3: Architecture (Upper Intermediate)</h3><h4>🔹 ViewModel Integration</h4><p>Separate UI from logic using a ViewModel.</p><pre>class MyViewModel : ViewModel() {<br>    private val _state = MutableStateFlow(0)<br>    val state = _state<br>}</pre><p>👉 Learn:</p><ul><li>MVVM or MVI architecture</li><li>StateFlow vs LiveData</li><li>Unidirectional Data Flow</li></ul><h4>🔹 Navigation in Compose</h4><p>Use Navigation Compose to handle multiple screens.</p><p>👉 Practice:</p><ul><li>Navigate between screens</li><li>Pass arguments</li></ul><h3>🎨 Phase 4: UI Design &amp; Theming</h3><h4>🔹 Material Design</h4><p>Compose follows Material Design principles.</p><p>👉 Learn:</p><ul><li>Colors</li><li>Typography</li><li>Dark mode</li></ul><h4>🔹 Custom UI &amp; Animations</h4><pre>val scale by animateFloatAsState(targetValue = 1f)</pre><p>👉 Practice:</p><ul><li>Animated buttons</li><li>Loading indicators</li></ul><h3>⚙️ Phase 5: Advanced Concepts</h3><h4>🔹 Side Effects</h4><p>Understand lifecycle-aware APIs:</p><ul><li>LaunchedEffect</li><li>SideEffect</li><li>DisposableEffect</li></ul><h4>🔹 Performance Optimization</h4><ul><li>Avoid unnecessary recomposition</li><li>Use stable data</li><li>Optimize lists</li></ul><h4>🔹 Interoperability</h4><ul><li>Use Compose inside XML</li><li>Use XML inside Compose</li></ul><h4>🔹 Testing</h4><ul><li>UI testing with Compose testing APIs</li></ul><h3>🧩 Phase 6: Real-World Projects (Expert Level)</h3><p>Once you’re comfortable, build real apps:</p><ul><li>Chat application</li><li>E-commerce UI</li><li>Dashboard with API integration</li></ul><h3>🛣️ Suggested Learning Timeline</h3><h4>Week 1</h4><p>Basics + Layouts + Modifiers</p><h4>Week 2</h4><p>State + Lists + Interaction</p><h4>Week 3</h4><p>ViewModel + Navigation</p><h4>Week 4</h4><p>Animations + Build a real app</p><h3>💡 Pro Tips</h3><ul><li>Don’t just watch tutorials, build projects</li><li>Focus heavily on <strong>state management</strong></li><li>Understand recomposition deeply</li><li>Follow clean architecture (MVVM or MVI)</li></ul><h3>🎯 Conclusion</h3><p>Jetpack Compose can feel overwhelming at first, but if you follow a structured path, it becomes much easier. The key is consistency and practice.</p><p>This roadmap is not just about learning Compose, it’s about learning how to think in a <strong>modern Android way</strong>.</p><h3>📚 Official Resources to Go Deeper</h3><p>If you want to follow a structured and official learning path, here are some highly recommended resources from Android developers:</p><h3>🚀 Jetpack Compose Official Course</h3><p>👉 <a href="https://developer.android.com/courses/jetpack-compose/course">https://developer.android.com/courses/jetpack-compose/course</a></p><p>This is a complete guided pathway covering everything from basics to advanced concepts.</p><h3>🧪 Must-Do Codelabs (Hands-On Practice)</h3><p>These codelabs are essential to solidify your understanding:</p><ul><li>👉 <a href="https://developer.android.com/codelabs/jetpack-compose-basics">https://developer.android.com/codelabs/jetpack-compose-basics</a></li><li>👉 <a href="https://developer.android.com/codelabs/jetpack-compose-layouts">https://developer.android.com/codelabs/jetpack-compose-layouts</a></li><li>👉 <a href="https://developer.android.com/codelabs/jetpack-compose-state">https://developer.android.com/codelabs/jetpack-compose-state</a></li><li>👉 <a href="https://developer.android.com/codelabs/jetpack-compose-theming">https://developer.android.com/codelabs/jetpack-compose-theming</a></li><li>👉 <a href="https://developer.android.com/codelabs/jetpack-compose-migration">https://developer.android.com/codelabs/jetpack-compose-migration</a></li></ul><p>💡 <strong>Tip:</strong> Don’t just read, complete these codelabs by writing code yourself. That’s where real learning happens.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00ac7c7bd3f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Avoiding AdMob Policy Violations: Banner, Native, Interstitial & App Open Ads Explained]]></title>
            <link>https://orbitalsonic.medium.com/avoiding-admob-policy-violations-banner-native-interstitial-app-open-ads-explained-4a1893b3d5e1?source=rss-e5fc16dbbf3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a1893b3d5e1</guid>
            <category><![CDATA[ads-violations]]></category>
            <category><![CDATA[admob-ads-policy]]></category>
            <category><![CDATA[mobile-advertising]]></category>
            <category><![CDATA[admob-policy-violations]]></category>
            <category><![CDATA[google-ads-violations]]></category>
            <dc:creator><![CDATA[Muhammad Yaqoob]]></dc:creator>
            <pubDate>Wed, 01 Apr 2026 07:42:46 GMT</pubDate>
            <atom:updated>2026-04-28T06:06:44.470Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XGSixVz30kNAFhHBraXrMg.png" /><figcaption>Admob Policy Violations</figcaption></figure><p>When you start monetizing your app with AdMob, everything looks simple: add ads, earn revenue, and scale. But in reality, it’s very easy to make small mistakes that can lead to <strong>policy violations</strong>, limited ad serving, or even account suspension.</p><p>I’ve seen many developers focus only on implementation and ignore the <strong>AdMob policies</strong>, especially when working with different ad formats like Banner, Native, Interstitial, and App Open ads. The problem is, each format has its own rules, and even a small UI or placement mistake can cause issues.</p><p>In this article, I’m going to break down the most common <strong>AdMob policy violations</strong> across all major ad formats, along with practical explanations so you can avoid costly mistakes.</p><h3>📱 Ad Formats Overview (Quick Understanding)</h3><p>Before jumping into violations, let’s quickly understand the ad types we’ll be discussing:</p><h4>🔹 Banner Ads</h4><p>Banner ads are the most basic and commonly used ads. They usually appear at the <strong>top or bottom of the screen</strong> and stay visible while the user interacts with the app.</p><p>👉 Official Documentation: <a href="https://developers.google.com/admob/android/banner">banner ad implementation</a></p><h4>🔹 Native Ads</h4><p>Native ads are designed to <strong>blend with your app’s UI</strong>, making them look like part of your content.</p><p>👉 Official Documentation: <a href="https://developers.google.com/admob/android/native">native ad implementation</a></p><h4>🔹 Interstitial Ads</h4><p>These are <strong>full-screen ads</strong> that appear at natural transition points (like moving to the next screen or level).</p><p>👉 Official Documentation: <a href="https://developers.google.com/admob/android/interstitial">interstitial ad implementation</a></p><h4>🔹 App Open Ads</h4><p>App Open ads show when the user <strong>opens or switches back to your app</strong>.</p><p>👉 Official Documentation: <a href="https://developers.google.com/admob/android/app-open">App open ad implementation</a></p><h3>🚫 Banner Ad Violations (What to Avoid)</h3><p>Banner ads look simple, but they’re one of the easiest places to make policy mistakes. Most violations happen because of poor placement or trying to “optimize” too aggressively.</p><p>Here are some important things to keep in mind:</p><ul><li><strong>Don’t show multiple banner ads on the same screen</strong><br> Showing more than one banner at a time can lead to policy violations and a bad user experience. Keep it clean; one banner per screen is enough.</li><li><strong>Always reserve a fixed space for the banner</strong><br> Your layout should have a dedicated area for the ad. Avoid placing banners in a way that shifts or overlaps your content.</li><li><strong>Be careful with scrollable screens</strong><br> If you’re using banners inside scrollable layouts, it’s fine to place them at the <strong>top or bottom</strong>, but make sure they are clearly separated (using spacing or a border) so users don’t confuse them with app content.</li><li><strong>Show/Hide is fine but don’t resize your UI dynamically</strong><br> You can load or hide a banner when needed, but the space for the ad should remain consistent. Expanding or shrinking your UI when ads load can lead to accidental clicks, which is a violation.</li></ul><h4>Example</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*i2juCzf-SLOx-aGFf_NHmg.png" /><figcaption>Banner ADs Voilation</figcaption></figure><h3>🚫 Native Ad Violations (Things You Should Never Ignore)</h3><p>Native ads are powerful because they blend with your app’s UI, but that’s exactly why they’re risky. Most AdMob violations happen here due to misleading design or incorrect implementation.</p><p>Let’s go through the key rules you should always follow:</p><h4>🔹 Proper Ad Size &amp; Assets</h4><ul><li>Make sure your ad view is <strong>not too small;</strong> it should be at least <strong>32x32 dp</strong>.</li><li>If you’re using video assets, the <strong>MediaView must be at least 120x120 dp</strong>.</li><li>All ad assets (headline, media, CTA, etc.) should stay <strong>inside the native ad container;</strong> nothing should overflow outside.</li></ul><h4>🔹 Clear Ad Attribution (Very Important)</h4><p>Users should never be confused about whether something is an ad or content.</p><ul><li>You must include a clear label like:</li><li><strong>“Ad”</strong></li><li><strong>“Advertisement”</strong></li><li>Or a visible <strong>“Ad” badge (minimum 15x15 px)</strong></li><li>The <strong>AdChoices icon (or “Ads by Google”)</strong> must be clearly visible and not hidden.</li><li>Don’t camouflage these elements; adding a <strong>solid background behind AdChoices</strong> is a good practice.</li></ul><h4>🔹 UI Should Not Be Misleading</h4><ul><li>Your ad should <strong>not look like part of your app’s navigation</strong> (buttons, menus, etc.).</li><li>Avoid designs that <strong>mimic real content</strong>, system dialogs, or notifications.</li><li>Users should instantly recognize: <em>“This is an ad.”</em></li></ul><h4>🔹 Clickable Areas (Common Mistake)</h4><ul><li>Only specific elements should be clickable:<br> 👉 Headline<br> 👉 Call-to-action (CTA)<br> 👉 Media assets</li><li><strong>Never make empty space clickable</strong><br> Extra padding or background clicks can lead to <strong>accidental clicks</strong>, which is a serious violation.</li></ul><h4>🔹 Required Content (Don’t Skip This)</h4><ul><li>Always include a <strong>headline</strong> (and avoid cutting it off up to ~25 characters should be visible).</li><li>Include the <strong>body text</strong> as well (up to ~90 characters without truncation).</li></ul><p>Incomplete ads can get flagged easily.</p><h4>🔹 UX &amp; Behavior Rules</h4><ul><li>❌ Don’t add a <strong>fake close button</strong> on native ads</li><li>⏱️ If an ad doesn’t load within ~30 seconds, it’s better to <strong>hide or remove the placeholder</strong></li><li>⚠️ Never trigger ads on <strong>wrong clicks or unrelated buttons</strong></li></ul><h4>Example</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1D2rET5XbD73aXVSpLKaNw.png" /><figcaption>Native ads Violations</figcaption></figure><h3>🚫 Interstitial Ad Violations (Use Carefully)</h3><h4>🔹 Don’t Show Ads Outside Your App</h4><ul><li>Never show an interstitial ad on the <strong>device home screen</strong> or outside your app context.</li><li>Ads should only appear <strong>while the user is actively using your app</strong>.</li></ul><h4>🔹 Avoid Unexpected Redirects</h4><ul><li>If an interstitial ad loads in the background, it should <strong>not suddenly redirect the user</strong> when they return.</li><li>Ads must feel <strong>intentional and expected</strong>, not forced.</li></ul><h4>🔹 Respect Timing Between Ads</h4><ul><li>Don’t show an interstitial <strong>immediately after an App Open Ad</strong><br> 👉 Keep at least a <strong>10-second gap</strong> between them</li><li>Maintain proper spacing between interstitials<br> 👉 A good practice is <strong>~25 seconds between two interstitial ads</strong></li></ul><p>Showing ads too frequently is a common reason for poor UX and policy issues.</p><h4>🔹 Give Users a Small Buffer</h4><ul><li>Avoid showing an interstitial <strong>instantly without context</strong></li><li>It’s better to add a short delay or a message like:<br> 👉 <em>“Loading Ad…”</em></li></ul><p>This prepares the user and makes the experience feel less aggressive.</p><h4>Example: Repetitive Ads / No Capping</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F61N8qbsMDe0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2F61N8qbsMDe0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F61N8qbsMDe0%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8e2510f993b130a420139b8099f4b994/href">https://medium.com/media/8e2510f993b130a420139b8099f4b994/href</a></iframe><h4>Example: Ad Redirecting to App</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F6RMRKdDvWEc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2F6RMRKdDvWEc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F6RMRKdDvWEc%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca0ce2af5dae4abbb666b0eed4f812ec/href">https://medium.com/media/ca0ce2af5dae4abbb666b0eed4f812ec/href</a></iframe><h3>🚫 App Open Ad Violations (Handle With Care)</h3><p>App Open ads are great for monetizing app launches, but they need to be implemented very carefully. If done wrong, they can feel intrusive or worse, lead to policy violations.</p><p>Here are the key things you should avoid:</p><h4>🔹 Avoid Transparency Issues</h4><ul><li>Don’t leave the background transparent when showing an App Open ad</li><li>Always use a <strong>solid background (preferably black)</strong> to avoid UI glitches or accidental interactions</li></ul><h4>🔹 Be Careful on Splash Screens</h4><ul><li>Showing App Open ads directly on the <strong>splash screen</strong> can be risky if not handled properly</li><li>Make sure it doesn’t feel forced or block the natural app startup experience</li></ul><h4>🔹 Control Ad Frequency</h4><ul><li>Don’t show App Open ads every single time the app opens</li><li>Review your app’s behavior and <strong>apply proper frequency capping</strong> to avoid annoying users</li></ul><h4>🔹 Show Ads at the Right Moment</h4><ul><li>The ad should appear <strong>before the user starts interacting with the app</strong></li><li>Once the user is engaged, interrupting them with an App Open ad is a bad experience</li></ul><h4>🔹 Never Stack Ads</h4><ul><li>Don’t show App Open ads <strong>on top of other ads</strong><br> 👉 For example, avoid showing it when a banner or native ad is already visible</li><li>Also, make sure <strong>no other ads are visible underneath</strong> the App Open ad</li></ul><h4>🔹 Avoid System-Level Interference</h4><ul><li>Never show ads triggered by <strong>phone launcher buttons</strong> or outside your app flow</li><li>Ads must stay within your app’s context only</li></ul><h4>🔹 Handle Background UI Properly</h4><ul><li>If there are dialogs or popups in your app, don’t let them appear <strong>behind the App Open ad</strong></li><li>It’s better to <strong>dismiss dialogs when the app goes to the background</strong> and restore them cleanly later</li></ul><h4>Example: App Open and Interstitial Ad Overlapping</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F5v4UVnJfbow%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2F5v4UVnJfbow&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F5v4UVnJfbow%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/48e512deda6154ad4eae7641ae5cb02f/href">https://medium.com/media/48e512deda6154ad4eae7641ae5cb02f/href</a></iframe><h4>Example</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*82cAL6ResPXfL-kvvpMnLA.png" /></figure><h3>🚫 Common AdMob Violations (That Developers Often Miss)</h3><p>Even if you implement each ad format correctly, there are still some <strong>general mistakes</strong> that can lead to policy violations. These usually happen because of poor UX decisions or edge-case scenarios that are easy to overlook.</p><p>Let’s break them down in a simple way.</p><h4>🔹 General Violations</h4><ul><li>Don’t show ads on the <strong>exit screen</strong> (e.g., “Tap here to exit”)</li><li>Ads should never appear on <strong>lock screens</strong> unless your app is specifically built for that purpose</li><li>Avoid placing ads inside <strong>dialogs, notifications, or widgets</strong></li><li>Don’t show ads in apps where users are not actively looking at the screen (like flashlight apps)</li><li>Ads must not appear on <strong>third-party content</strong> (e.g., maps, embedded SDK screens)</li><li>Be careful with <strong>deep link</strong> ads should not trigger unexpectedly</li><li>Never show ads triggered by <strong>phone launcher buttons</strong></li><li>Don’t show ads on <strong>premium screens</strong> or during the exit from premium flows</li></ul><h4>🔹 Common Mistakes in Native &amp; Banner Ads</h4><ul><li>Keep a safe distance from <strong>clickable UI elements</strong></li><li>Don’t “sandwich” ads between buttons or interactive elements</li><li>Avoid <strong>overlapping ads with app content</strong></li><li>Make sure text and font sizes don’t overlap or break the layout</li><li>Ads should never appear on <strong>empty screens</strong></li><li>Maintain a healthy <strong>content-to-ad ratio (around 70% content / 30% ads)</strong></li><li>Don’t reuse the <strong>same ad in horizontally scrollable views;</strong> each screen should load its own</li></ul><h4>🔹 Common Mistakes in App Open &amp; Interstitial Ads</h4><ul><li>Don’t show ads on <strong>app start or exit in a forced way</strong></li><li>Avoid <strong>repetitive ads </strong>always apply proper capping</li><li>Never show ads <strong>unexpectedly without user action or transition</strong></li><li>Don’t stack ads (e.g., interstitial on top of app open ad)</li><li>Maintain at least <strong>10 seconds gap between App Open and Interstitial ads</strong></li><li>Pause any <strong>audio/video</strong> if an App Open ad appears</li></ul><h4>🧪 Real Testing Scenarios (Don’t Skip This)</h4><p>A lot of violations don’t show up in normal testing; they appear in edge cases. Make sure you test these:</p><ul><li>Minimize the app while an ad is loading, then return and check behavior</li><li>Trigger App Open and Interstitial ads together ensure they don’t overlap</li><li>Change <strong>theme (dark/light)</strong> while ads are visible</li><li>Switch between screens/modules and check if ads repeat incorrectly</li><li>Test on <strong>low-end devices</strong> (ads may behave differently)</li><li>Test with <strong>slow internet (2G/3G)</strong> and no internet</li><li>Use <strong>deep links</strong> while ads are loading or showing</li><li>Click an ad → return to app → check if another ad appears unexpectedly</li></ul><h4>🔹 Native Ads Edge Cases</h4><ul><li>Native ads should disappear if there is <strong>no content on the screen</strong></li><li>Don’t let native ads be <strong>larger than your actual content</strong> (keep ~30/70 ratio)</li><li>When refreshing ads, ensure <strong>old ads are removed before new ones load</strong></li><li>Never place native ads before the <strong>start/privacy policy screen</strong></li><li>Avoid placing native ads on <strong>third-party content screens</strong></li></ul><h4>🔹 Premium &amp; Special Screens</h4><ul><li>No ads on <strong>premium screens or purchase flows</strong></li><li>Don’t place ads on the <strong>close (X) button</strong></li><li>It’s okay to show ads on “<strong>Continue with Ads</strong>” options</li><li>Ensure the <strong>close button is clearly visible</strong></li></ul><h4>🔹 Critical Edge Cases</h4><ul><li>App Open ads should <strong>not appear on splash or first launch screen</strong></li><li>Interstitial ads should not appear <strong>unexpectedly when reopening the app</strong></li><li>Ads must not show during <strong>loading states</strong> (e.g., progress bars, file fetching)</li><li>No ads during <strong>force update, rating dialogs, or onboarding flows</strong></li></ul><h4>Example</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QGkF9qoW_JoYJLdfDhLTXw.png" /></figure><h3>💡 Conclusion</h3><p>Most AdMob violations don’t come from obvious mistakes they come from <strong>edge cases and bad user experience decisions</strong>.</p><p>👉 If an ad:</p><ul><li>Feels unexpected</li><li>Interrupts at the wrong moment</li><li>Or tricks the user</li></ul><p>…it’s likely a violation.</p><h3>📚 References &amp; Official Guidelines</h3><p>If you want to go deeper or verify anything, these are the official Google AdMob resources you should always refer to:</p><ul><li>👉 <a href="https://support.google.com/admob/answer/6239795">https://support.google.com/admob/answer/6239795</a><br> <em>(Native Ads policies, required elements, and implementation guidelines)</em></li><li>👉 <a href="https://support.google.com/admob/answer/6128543">https://support.google.com/admob/answer/6128543</a><br> <em>(AdMob program policies &amp; restrictions cover overall rules, invalid activity, and ad placement guidelines)</em></li><li>👉 <a href="https://support.google.com/admob/answer/2936217">https://support.google.com/admob/answer/2936217</a><br> <em>(Ad placement and user experience policies: what is allowed and what can lead to violations)</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a1893b3d5e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rethinking MVI: Why I Call It SUA + StateFlow vs SharedFlow Explained]]></title>
            <link>https://orbitalsonic.medium.com/rethinking-mvi-why-i-call-it-sua-stateflow-vs-sharedflow-explained-321628f6606f?source=rss-e5fc16dbbf3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/321628f6606f</guid>
            <category><![CDATA[mvi]]></category>
            <category><![CDATA[android-mvi]]></category>
            <category><![CDATA[android-mvi-architecture]]></category>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[mvi-architecture]]></category>
            <dc:creator><![CDATA[Muhammad Yaqoob]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 07:24:58 GMT</pubDate>
            <atom:updated>2026-04-28T06:07:26.685Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4zn-2c-yj3DVODcB31x-IA.png" /></figure><h3>When I first started working with MVI, something always felt a bit… off.</h3><p>Not the architecture itself that’s solid. But the naming?<br> “Model View Intent”… really?</p><p>After building a few real apps and debugging messy state issues at 2 AM, I started thinking about it differently.</p><p>And that’s when I came up with my own way to describe it:</p><p>👉 <strong>SUA = State UI Action</strong></p><p>Yeah, I said it. And honestly… it just makes more sense.</p><p>Let me explain.</p><h3>🤔 Why I Prefer SUA Over MVI</h3><p>Traditional <strong>MVI (Model-View-Intent)</strong> sounds academic. But when you’re actually coding, you’re not thinking in “intents” all the time.</p><p>You’re thinking:</p><ul><li>What’s the <strong>state</strong> right now?</li><li>What did the <strong>user do</strong>?</li><li>What <strong>action</strong> should happen?</li></ul><p>So I renamed it in my head:</p><h3>👉 SUA = State + UI + Action</h3><ul><li><strong>State</strong> → What the UI should look like</li><li><strong>UI</strong> → Where everything is rendered</li><li><strong>Action</strong> → What the user or system triggers</li></ul><p>Simple. Practical. Real.</p><h3>🔄 Where StateFlow &amp; SharedFlow Fit In</h3><p>Now let’s talk about the real heroes:</p><h3>🟢 StateFlow → “What is the current state?”</h3><ul><li>Holds <strong>one latest value</strong></li><li>Always emits the <strong>current UI state</strong></li><li>Perfect for UI rendering</li></ul><h3>🔵 SharedFlow → “What just happened?”</h3><ul><li>Doesn’t hold a state</li><li>Emits <strong>events</strong></li><li>Used for one-time actions (navigation, toast, etc.)</li></ul><h3>⚡ Quick Analogy</h3><ul><li><strong>StateFlow</strong> = “Screen ka current scene kya hai?”</li><li><strong>SharedFlow</strong> = “Abhi kya event hua?”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*we8y5JO2DNpG0TxyAdm4jQ.png" /></figure><h3>🧱 SUA (MVI) Structure</h3><p>Here’s how I structure it:</p><pre>UI → Action → ViewModel → StateFlow (state)<br>                       → SharedFlow (events)</pre><h3>📱 Example: Todo App (Real World)</h3><p>Let’s build a simple Todo feature using both flows.</p><h3>🧾 Step 1: Define SUA Components</h3><h3>UI State</h3><pre>data class TodoState(<br>    val todos: List&lt;String&gt; = emptyList(),<br>    val isLoading: Boolean = false<br>)</pre><h3>UI Actions</h3><pre>sealed class TodoAction {<br>    data class AddTodo(val task: String) : TodoAction()<br>    data class DeleteTodo(val task: String) : TodoAction()<br>}</pre><h3>UI Events (One-time)</h3><pre>sealed class TodoEvent {<br>    data class ShowToast(val message: String) : TodoEvent()<br>}</pre><h3>🧠 Step 2: ViewModel with StateFlow + SharedFlow</h3><pre>class TodoViewModel : ViewModel() {<br>    // StateFlow → UI State<br>    private val _state = MutableStateFlow(TodoState())<br>    val state: StateFlow&lt;TodoState&gt; = _state<br><br>    // SharedFlow → One-time events<br>    private val _event = MutableSharedFlow&lt;TodoEvent&gt;()<br>    val event: SharedFlow&lt;TodoEvent&gt; = _event<br><br>    fun onAction(action: TodoAction) {<br>        when (action) {<br>            is TodoAction.AddTodo -&gt; addTodo(action.task)<br>            is TodoAction.DeleteTodo -&gt; deleteTodo(action.task)<br>        }<br>    }<br>    private fun addTodo(task: String) {<br>        val updatedList = _state.value.todos + task<br>        _state.value = _state.value.copy(todos = updatedList)<br>        // Emit event<br>        viewModelScope.launch {<br>            _event.emit(TodoEvent.ShowToast(&quot;Task Added&quot;))<br>        }<br>    }<br>    private fun deleteTodo(task: String) {<br>        val updatedList = _state.value.todos - task<br>        _state.value = _state.value.copy(todos = updatedList)<br>        viewModelScope.launch {<br>            _event.emit(TodoEvent.ShowToast(&quot;Task Deleted&quot;))<br>        }<br>    }<br>}</pre><h3>🎨 Step 3: UI Layer (Collect Both)</h3><pre>lifecycleScope.launchWhenStarted {<br>    viewModel.state.collect { state -&gt;<br>        // Update UI<br>        todoListAdapter.submitList(state.todos)<br>    }<br>}<br><br>lifecycleScope.launchWhenStarted {<br>    viewModel.event.collect { event -&gt;<br>        when (event) {<br>            is TodoEvent.ShowToast -&gt; {<br>                Toast.makeText(context, event.message, Toast.LENGTH_SHORT).show()<br>            }<br>        }<br>    }<br>}</pre><h3>🚀 My Final Take</h3><p>After using this pattern in real projects, here’s what I believe:</p><ul><li><strong>StateFlow keeps your UI predictable</strong></li><li><strong>SharedFlow keeps your events clean</strong></li><li>And <strong>SUA naming just makes your brain relax</strong></li></ul><p>Because at the end of the day, we’re not writing theory…</p><p>We’re building apps.</p><h3>🧩 Conclusion</h3><p>You can call it MVI if you want. That’s fine.</p><p>But for me?</p><p>👉 <strong>SUA (State UI Action)</strong> just clicks better.</p><p>And honestly… once you start thinking this way, you won’t go back.</p><h3>⭐ GitHub Repository</h3><p>Check out the full project here:<br> 👉 <a href="https://github.com/orbitalsonic/MVI-Sample-Android">https://github.com/orbitalsonic/MVI-Sample-Android</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=321628f6606f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SonicOPT Offline Prayer & Fasting Time Library for Android]]></title>
            <link>https://orbitalsonic.medium.com/sonicopt-offline-prayer-fasting-time-library-for-android-8e6b1dabaa2c?source=rss-e5fc16dbbf3b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e6b1dabaa2c</guid>
            <category><![CDATA[prayer-times]]></category>
            <category><![CDATA[fasting-timetables]]></category>
            <category><![CDATA[islamic-prayer-times]]></category>
            <category><![CDATA[prayer-time-library]]></category>
            <category><![CDATA[world-prayer-time]]></category>
            <dc:creator><![CDATA[Muhammad Yaqoob]]></dc:creator>
            <pubDate>Sat, 28 Mar 2026 12:05:32 GMT</pubDate>
            <atom:updated>2026-04-06T04:57:21.540Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f7xQYUSClw9KJ-iY-Nn6ng.png" /></figure><h3>🤯 The Problem Nobody Talks About</h3><p>If you’ve ever built an Islamic app (Prayer, Ramadan, or Fasting apps), you’ve probably faced this:</p><ul><li>You depend on APIs for prayer times</li><li>Users complain when internet is slow</li><li>Accuracy varies based on API providers</li><li>Apps fail in remote/offline areas</li></ul><p>And the worst part?</p><p>👉 Your core feature <strong>breaks without internet</strong></p><p>That’s not acceptable for something as critical as <strong>prayer timing</strong>.</p><h3>💡 The Idea Behind SonicOPT</h3><p>I wanted a solution that works:</p><p>✔ Without internet<br>✔ With high accuracy<br>✔ With customizable calculation methods</p><p>So I built <strong>SonicOPT</strong>.</p><h3>🧠 What is SonicOPT?</h3><p><strong>SonicOPT</strong> is a lightweight Android/Kotlin library that provides:</p><ul><li>📍 Accurate prayer times calculation</li><li>🌍 Offline functionality (no API needed)</li><li>⚙️ Customizable calculation methods</li><li>🕌 Support for different regions &amp; high-latitude adjustments</li></ul><p>👉 It’s designed specifically for <strong>Islamic apps, prayer apps, and fasting trackers</strong></p><h3>🔁 How Prayer Time Calculation Works (Concept)</h3><p>Behind the scenes, prayer times are calculated using:</p><ul><li>Sun position (astronomical calculations)</li><li>Latitude &amp; longitude</li><li>Calculation methods (MWL, ISNA, Umm Al-Qura, etc.)</li><li>Time adjustments (high-latitude regions)</li></ul><p>👉 SonicOPT abstracts all of this complexity for you.</p><h3>✨ Features</h3><ul><li>✅ <strong>Offline Functionality </strong>No internet required</li><li>📅 <strong>Daily, Monthly, Yearly Prayer Times</strong></li><li>📆 <strong>Specific Date / Date Range Support</strong></li><li>🌙 <strong>Fasting Times Calculation (Sehri &amp; Iftar)</strong></li><li>🕒 <strong>Multiple Time Formats (12h / 24h / Floating)</strong></li><li>⚙️ <strong>Manual Time Adjustments (-59 to +59 min)</strong></li><li>📐 <strong>Custom Prayer Angles</strong></li><li>🕌 <strong>Asr Calculation (Hanafi &amp; Shafi)</strong></li><li>🌍 <strong>High Latitude Adjustments</strong></li><li>📊 <strong>Multiple Prayer Conventions Supported</strong></li></ul><h3>Setup</h3><h4>Step 1: Add Maven Repository</h4><p>Add the following to your project-level build script (build.gradle or settings.gradle) for Groovy or Kotlin DSL:</p><h4>Groovy DSL</h4><pre>repositories {<br>   google()<br>   mavenCentral()<br>   maven { url &quot;https://jitpack.io&quot; }<br>}</pre><h4>Kotlin DSL</h4><pre>repositories {<br>    google()<br>    mavenCentral()<br>    maven { setUrl(&quot;https://jitpack.io&quot;) }<br>}</pre><h3>Step 2: Add Dependency</h3><p>Include the OPT library in your app-level build script (build.gradle or build.gradle.kts). Replace x.x.x with the <a href="https://github.com/orbitalsonic/SonicOPT">latest version</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/91/0*TN1TNryuKVwaUwZu" /></figure><h4>Groovy DSL</h4><pre>implementation &#39;com.github.orbitalsonic:SonicOPT:1.0.3&#39;</pre><h4>Kotlin DSL</h4><pre>implementation(&quot;com.github.orbitalsonic:SonicOPT:1.0.3&quot;)</pre><h3>Step 3: Sync Gradle</h3><p>Sync your Gradle project to fetch the dependency.</p><h3>Usage</h3><h4>Prayer Time Manager</h4><p>The PrayerTimeManager class is designed to fetch and calculate prayer and fasting times efficiently. To use the PrayerTimeManager class, begin by initializing it:</p><pre>val prayerTimeManager = PrayerTimeManager()</pre><h4>Fetching Prayer Times</h4><p>Prayer times are calculated based on the provided latitude, longitude, high latitude adjustment, Asr juristic method, prayer time convention, and time format.</p><ul><li>Manual Corrections: You can adjust prayer times manually within a range of -59 to +59 minutes. If the adjustment exceeds this range, it defaults to 0 (no correction).</li><li>Custom Angles: When the PrayerTimeConvention is set to CUSTOM, you can define specific angles for Fajr and Isha prayers. The default custom angles are: Fajr: 9.0°, Isha: 14.0°</li></ul><p>By utilizing these features, you can calculate accurate and tailored prayer times for any location and customize them to meet your specific needs.</p><h4>Fetch Today&#39;s Prayer Times:</h4><pre>prayerTimeManager.fetchTodayPrayerTimes(<br>    latitude = 33.4979105, // Example latitude (Islamabad, Pakistan)<br>    longitude = 73.0722461, // Example longitude (Islamabad, Pakistan)<br>    highLatitudeAdjustment = HighLatitudeAdjustment.NO_ADJUSTMENT,<br>    asrJuristicMethod = AsrJuristicMethod.HANAFI,<br>    prayerTimeConvention = PrayerTimeConvention.KARACHI,<br>    timeFormat = TimeFormat.HOUR_12,<br>    prayerManualCorrection = PrayerManualCorrection(fajrMinute = 0, zuhrMinute = 0, asrMinute = 0, maghribMinute = 0, ishaMinute = 2),<br>    prayerCustomAngle = PrayerCustomAngle(fajrAngle = 9.0, ishaAngle = 14.0)<br>) { result -&gt;<br>    result.onSuccess { prayerItem -&gt;<br>        val dateFormatter = SimpleDateFormat(&quot;dd MMM, yyyy&quot;, Locale.getDefault())<br>        val formattedDate = dateFormatter.format(Date(prayerItem.date))<br>        Log.d(&quot;PrayerTimeTag&quot;, &quot;Date: $formattedDate&quot;)<br>        prayerItem.prayerList.forEach {<br>            Log.d(&quot;PrayerTimeTag&quot;, &quot;${it.prayerName}: ${it.prayerTime}&quot;)<br>        }<br>    }.onFailure { exception -&gt;<br>        Log.e(&quot;PrayerTimeTag&quot;, &quot;Error fetching daily prayer times&quot;, exception)<br>    }<br>}</pre><h4>Fetch Current Month Prayer Times:</h4><pre>prayerTimeManager.fetchCurrentMonthPrayerTimes(<br>    latitude = 33.4979105, // Example latitude (Islamabad, Pakistan)<br>    longitude = 73.0722461, // Example longitude (Islamabad, Pakistan)<br>    highLatitudeAdjustment = HighLatitudeAdjustment.NO_ADJUSTMENT,<br>    asrJuristicMethod = AsrJuristicMethod.HANAFI,<br>    prayerTimeConvention = PrayerTimeConvention.KARACHI,<br>    timeFormat = TimeFormat.HOUR_12,<br>    prayerManualCorrection = PrayerManualCorrection(fajrMinute = 0, zuhrMinute = 0, asrMinute = 0, maghribMinute = 0, ishaMinute = 2),<br>    prayerCustomAngle = PrayerCustomAngle(fajrAngle = 9.0, ishaAngle = 14.0)<br>) { result -&gt;<br>    result.onSuccess { prayerItems -&gt;<br>        val dateFormatter = SimpleDateFormat(&quot;dd MMM, yyyy&quot;, Locale.getDefault())<br>        prayerItems.forEachIndexed { index, prayerItem -&gt;<br>            val formattedDate = dateFormatter.format(Date(prayerItem.date))<br>            Log.d(&quot;PrayerTimeTag&quot;, &quot;Day ${index + 1} (${formattedDate}):&quot;)<br>            prayerItem.prayerList.forEach {<br>                Log.d(&quot;PrayerTimeTag&quot;, &quot;${it.prayerName}: ${it.prayerTime}&quot;)<br>            }<br>        }<br>    }.onFailure { exception -&gt;<br>        Log.e(&quot;PrayerTimeTag&quot;, &quot;Error fetching monthly prayer times&quot;, exception)<br>    }<br>}</pre><h4>Fetch Current Year Prayer Times:</h4><pre>prayerTimeManager.fetchCurrentYearPrayerTimes(<br>    latitude = 33.4979105, // Example latitude (Islamabad, Pakistan)<br>    longitude = 73.0722461, // Example longitude (Islamabad, Pakistan)<br>    highLatitudeAdjustment = HighLatitudeAdjustment.NO_ADJUSTMENT,<br>    asrJuristicMethod = AsrJuristicMethod.HANAFI,<br>    prayerTimeConvention = PrayerTimeConvention.KARACHI,<br>    timeFormat = TimeFormat.HOUR_12,<br>    prayerManualCorrection = PrayerManualCorrection(fajrMinute = 0, zuhrMinute = 0, asrMinute = 0, maghribMinute = 0, ishaMinute = 2),<br>    prayerCustomAngle = PrayerCustomAngle(fajrAngle = 9.0, ishaAngle = 14.0)<br>) { result -&gt;<br>    result.onSuccess { prayerItems -&gt;<br>      val dateFormatter = SimpleDateFormat(&quot;dd MMM, yyyy&quot;, Locale.getDefault())<br>        prayerItems.forEachIndexed { monthIndex, monthlyPrayerItems -&gt;<br>            Log.d(&quot;PrayerTimeTag&quot;, &quot;Month ${monthIndex + 1}:&quot;)<br>            monthlyPrayerItems.forEachIndexed { dayIndex, prayerItem -&gt;<br>                val formattedDate = dateFormatter.format(Date(prayerItem.date))<br>                Log.d(&quot;PrayerTimeTag&quot;, &quot;Day ${dayIndex + 1} (${formattedDate}):&quot;)<br>                prayerItem.prayerList.forEach {<br>                    Log.d(&quot;PrayerTimeTag&quot;, &quot;${it.prayerName}: ${it.prayerTime}&quot;)<br>                }<br>            }<br>        }<br>    }.onFailure { exception -&gt;<br>        Log.e(&quot;PrayerTimeTag&quot;, &quot;Error fetching yearly prayer times&quot;, exception)<br>    }<br>}</pre><h4>Fetch Specific Date Prayer Time:</h4><pre>// Create a Calendar instance and set it to June 5, 2025<br>val calendar = GregorianCalendar(2025, Calendar.JUNE, 5)<br>// Convert the Calendar instance to a Date object<br>val date = calendar.time<br><br>prayerTimeManager.fetchSpecificDatePrayerTimes(<br>  latitude = 33.4979105,<br>  longitude = 73.0722461,<br>  date = date,<br>  highLatitudeAdjustment = HighLatitudeAdjustment.NO_ADJUSTMENT,<br>  asrJuristicMethod = AsrJuristicMethod.HANAFI,<br>  prayerTimeConvention = PrayerTimeConvention.KARACHI,<br>  timeFormat = TimeFormat.HOUR_12,<br>  prayerManualCorrection = PrayerManualCorrection(),<br>  prayerCustomAngle = PrayerCustomAngle()<br>) { result -&gt;<br>  result.onSuccess { prayerItem -&gt;<br>    val dateFormatter = SimpleDateFormat(&quot;dd MMM, yyyy&quot;, Locale.getDefault())<br>    val formattedDate = dateFormatter.format(Date(prayerItem.date))<br>    Log.d(&quot;PrayerTimeTag&quot;, &quot;Date: $formattedDate&quot;)<br>    prayerItem.prayerList.forEach {<br>      Log.d(&quot;PrayerTimeTag&quot;, &quot;${it.prayerName}: ${it.prayerTime}&quot;)<br>    }<br>  }.onFailure { exception -&gt;<br>    Log.e(&quot;PrayerTimeTag&quot;, &quot;Error fetching prayer times&quot;, exception)<br>  }<br>}</pre><h4>Fetch Date Range Prayer Time:</h4><pre>// Create a Calendar instance and set it to June 5, 2025<br>val startCalendar = GregorianCalendar(2025, Calendar.JUNE, 25)<br>// Convert the Calendar instance to a Date object<br>val startDate = startCalendar.time<br><br>// Create a Calendar instance and set it to July 7, 2025<br>val endCalendar = GregorianCalendar(2025, Calendar.JULY, 7)<br>// Convert the Calendar instance to a Date object<br>val endDate = endCalendar.time<br>prayerTimeManager.fetchPrayerTimesForDateRange(<br>  latitude = 33.4979105,<br>  longitude = 73.0722461,<br>  startDate = startDate,<br>  endDate = endDate,<br>  highLatitudeAdjustment = HighLatitudeAdjustment.NO_ADJUSTMENT,<br>  asrJuristicMethod = AsrJuristicMethod.HANAFI,<br>  prayerTimeConvention = PrayerTimeConvention.KARACHI,<br>  timeFormat = TimeFormat.HOUR_12,<br>  prayerManualCorrection = PrayerManualCorrection(),<br>  prayerCustomAngle = PrayerCustomAngle()<br>) { result -&gt;<br>  result.onSuccess { prayerItems -&gt;<br>    val dateFormatter = SimpleDateFormat(&quot;dd MMM, yyyy&quot;, Locale.getDefault())<br>    prayerItems.forEach { prayerItem -&gt;<br>      val formattedDate = dateFormatter.format(Date(prayerItem.date))<br>      Log.d(&quot;PrayerTimeTag&quot;, &quot;Date: $formattedDate&quot;)<br>      prayerItem.prayerList.forEach {<br>        Log.d(&quot;PrayerTimeTag&quot;, &quot;${it.prayerName}: ${it.prayerTime}&quot;)<br>      }<br>    }<br>  }.onFailure { exception -&gt;<br>    Log.e(&quot;PrayerTimeTag&quot;, &quot;Error fetching prayer times&quot;, exception)<br>  }<br>}</pre><h4>Fetching Fasting Times</h4><p>Fasting times are calculated based on the Fajr and Maghrib prayer times. Sehri ends at the start time of the Fajr prayer, and Iftar begins at the start time of the Maghrib prayer. To calculate these times, provide the latitude, longitude, high latitude adjustment, and prayer time convention.</p><ul><li>Sehri (Pre-Dawn Meal): Ends at the start time of the Fajr prayer.</li><li>Iftar (Breaking Fast): Begins at the start time of the Maghrib prayer.</li><li>Manual Corrections: Fasting times can be adjusted using manual corrections within a range of -59 to +59 minutes. If the adjustment exceeds this range, it defaults to 0 (no correction).</li><li>Custom Angles: When PrayerTimeConvention is set to CUSTOM, specific angles for Fajr and Isha prayers can be defined. The default custom angles are: Fajr: 9.0°, Isha: 14.0°</li></ul><h4>Fetch Today Fasting Times</h4><pre>prayerTimeManager.fetchTodayFastingTimes(<br>    latitude = 33.4979105, // Example latitude (Islamabad, Pakistan)<br>    longitude = 73.0722461, // Example longitude (Islamabad, Pakistan)<br>    highLatitudeAdjustment = HighLatitudeAdjustment.NO_ADJUSTMENT,<br>    prayerTimeConvention = PrayerTimeConvention.KARACHI,<br>    timeFormat = TimeFormat.HOUR_12,<br>    prayerManualCorrection = PrayerManualCorrection(fajrMinute = 0,maghribMinute = 0),<br>    prayerCustomAngle = PrayerCustomAngle(fajrAngle = 9.0, ishaAngle = 14.0)<br>) { result -&gt;<br>    result.onSuccess { fastingItem -&gt;<br>        val dateFormatter = SimpleDateFormat(&quot;dd MMM, yyyy&quot;, Locale.getDefault())<br>        val formattedDate = dateFormatter.format(Date(fastingItem.date))<br>        Log.d(&quot;FastingTimeTag&quot;, &quot;Date: $formattedDate&quot;)<br>        Log.d(&quot;FastingTimeTag&quot;, &quot;Sehri: ${fastingItem.sehriTime}, Iftar: ${fastingItem.iftaarTime}&quot;)<br>    }.onFailure { exception -&gt;<br>        Log.e(&quot;FastingTimeTag&quot;, &quot;Error fetching daily fasting times&quot;, exception)<br>    }<br>}</pre><h4>Fetch Current Month Fasting Times</h4><pre>prayerTimeManager.fetchCurrentMonthFastingTimes(<br>    latitude = 33.4979105, // Example latitude (Islamabad, Pakistan)<br>    longitude = 73.0722461, // Example longitude (Islamabad, Pakistan)<br>    highLatitudeAdjustment = HighLatitudeAdjustment.NO_ADJUSTMENT,<br>    prayerTimeConvention = PrayerTimeConvention.KARACHI,<br>    timeFormat = TimeFormat.HOUR_12,<br>    prayerManualCorrection = PrayerManualCorrection(fajrMinute = 0,maghribMinute = 0),<br>    prayerCustomAngle = PrayerCustomAngle(fajrAngle = 9.0, ishaAngle = 14.0)<br>) { result -&gt;<br>    result.onSuccess { fastingTimes -&gt;<br>        val dateFormatter = SimpleDateFormat(&quot;dd MMM, yyyy&quot;, Locale.getDefault())<br>        fastingTimes.forEachIndexed { index, fastingItem -&gt;<br>            val formattedDate = dateFormatter.format(Date(fastingItem.date))<br>            Log.d(&quot;FastingTimeTag&quot;, &quot;Day ${index + 1} (${formattedDate}): Sehri: ${fastingItem.sehriTime}, Iftar: ${fastingItem.iftaarTime}&quot;)<br>        }<br>    }.onFailure { exception -&gt;<br>        Log.e(&quot;FastingTimeTag&quot;, &quot;Error fetching monthly fasting times&quot;, exception)<br>    }<br>}</pre><h4>Fetch Current Year Fasting Times</h4><pre>prayerTimeManager.fetchCurrentYearFastingTimes(<br>   latitude = 33.4979105, // Example latitude (Islamabad, Pakistan)<br>   longitude = 73.0722461, // Example longitude (Islamabad, Pakistan)<br>   highLatitudeAdjustment = HighLatitudeAdjustment.NO_ADJUSTMENT,<br>   prayerTimeConvention = PrayerTimeConvention.KARACHI,<br>   timeFormat = TimeFormat.HOUR_12,<br>   prayerManualCorrection = PrayerManualCorrection(fajrMinute = 0,maghribMinute = 0),<br>   prayerCustomAngle = PrayerCustomAngle(fajrAngle = 9.0, ishaAngle = 14.0)<br>) { result -&gt;<br>   result.onSuccess { fastingTimes -&gt;<br>      val dateFormatter = SimpleDateFormat(&quot;dd MMM, yyyy&quot;, Locale.getDefault())<br>      fastingTimes.forEachIndexed { monthIndex, monthlyFastingList -&gt;<br>         Log.d(&quot;FastingTimeTag&quot;, &quot;Month ${monthIndex + 1}:&quot;)<br>         monthlyFastingList.forEachIndexed { dayIndex, fastingItem -&gt;<br>            val formattedDate = dateFormatter.format(Date(fastingItem.date))<br>            Log.d(&quot;FastingTimeTag&quot;, &quot;Day ${dayIndex + 1} (${formattedDate}): Sehri: ${fastingItem.sehriTime}, Iftar: ${fastingItem.iftaarTime}&quot;)<br>         }<br>      }<br>   }.onFailure { exception -&gt;<br>      Log.e(&quot;FastingTimeTag&quot;, &quot;Error fetching yearly fasting times&quot;, exception)<br>   }<br>}</pre><h4>Fetch Specific Date Fasting Time</h4><pre>// Create a Calendar instance and set it to June 5, 2025<br>val calendar = GregorianCalendar(2025, Calendar.JUNE, 5)<br>// Convert the Calendar instance to a Date object<br>val date = calendar.time<br><br>prayerTimeManager.fetchSpecificDateFastingTimes(<br>  latitude = 33.4979105,<br>  longitude = 73.0722461,<br>  date = date,<br>  highLatitudeAdjustment = HighLatitudeAdjustment.NO_ADJUSTMENT,<br>  prayerTimeConvention = PrayerTimeConvention.KARACHI,<br>  timeFormat = TimeFormat.HOUR_12,<br>  prayerManualCorrection = PrayerManualCorrection(),<br>  prayerCustomAngle = PrayerCustomAngle()<br>) { result -&gt;<br>  result.onSuccess { fastingItem -&gt;<br>    val dateFormatter = SimpleDateFormat(&quot;dd MMM, yyyy&quot;, Locale.getDefault())<br>    val formattedDate = dateFormatter.format(Date(fastingItem.date))<br>    Log.d(&quot;FastingTimeTag&quot;, &quot;Date: $formattedDate&quot;)<br>    Log.d(&quot;FastingTimeTag&quot;, &quot;Sehri: ${fastingItem.sehriTime}, Iftar: ${fastingItem.iftaarTime}&quot;)<br>  }.onFailure { exception -&gt;<br>    Log.e(&quot;FastingTimeTag&quot;, &quot;Error fetching fasting times&quot;, exception)<br>  }<br>}</pre><h4>Fetch Date Range Fasting Time</h4><pre>// Create a Calendar instance and set it to June 5, 2025<br>val startCalendar = GregorianCalendar(2025, Calendar.JUNE, 25)<br>// Convert the Calendar instance to a Date object<br>val startDate = startCalendar.time<br><br>// Create a Calendar instance and set it to July 7, 2025<br>val endCalendar = GregorianCalendar(2025, Calendar.JULY, 7)<br>// Convert the Calendar instance to a Date object<br>val endDate = endCalendar.time<br>prayerTimeManager.fetchFastingTimesForDateRange(<br>  latitude = 33.4979105,<br>  longitude = 73.0722461,<br>  startDate = startDate,<br>  endDate = endDate,<br>  highLatitudeAdjustment = HighLatitudeAdjustment.NO_ADJUSTMENT,<br>  prayerTimeConvention = PrayerTimeConvention.KARACHI,<br>  timeFormat = TimeFormat.HOUR_12,<br>  prayerManualCorrection = PrayerManualCorrection(),<br>  prayerCustomAngle = PrayerCustomAngle()<br>) { result -&gt;<br>  result.onSuccess { fastingItems -&gt;<br>    val dateFormatter = SimpleDateFormat(&quot;dd MMM, yyyy&quot;, Locale.getDefault())<br>    fastingItems.forEach { fastingItem -&gt;<br>      val formattedDate = dateFormatter.format(Date(fastingItem.date))<br>      Log.d(&quot;FastingTimeTag&quot;, &quot;Date: $formattedDate&quot;)<br>      Log.d(&quot;FastingTimeTag&quot;, &quot;Sehri: ${fastingItem.sehriTime}, Iftar: ${fastingItem.iftaarTime}&quot;)<br>    }<br>  }.onFailure { exception -&gt;<br>    Log.e(&quot;FastingTimeTag&quot;, &quot;Error fetching fasting times&quot;, exception)<br>  }<br>}</pre><h3>Models</h3><h4>PrayerItem</h4><pre>/**<br> * Represents the prayer times for a specific day.<br> *<br> * @property date Date of the prayer times in milliseconds.<br> * @property prayerList List of individual prayers and their times.<br> */<br>data class PrayerItem(<br>    var date: Long,<br>    var prayerList: List&lt;PrayerTimes&gt;<br>)</pre><h4>PrayerTimes</h4><pre>/**<br> * Represents the details of an individual prayer time.<br> *<br> * @property prayerName The name of the prayer (e.g., Fajr, Dhuhr, Asr, Maghrib, Isha).<br> * @property prayerTime The time of the prayer as a string, formatted based on user preferences.<br> * @property prayerTimeMillis The time of the prayer in milliseconds.<br> */<br>data class PrayerTimes(<br>  var prayerName: String,<br>  var prayerTime: String,<br>  var prayerTimeMillis: Long<br>)</pre><h4>PrayerManualCorrection</h4><pre>/**<br> * Represents manual corrections to prayer times.<br> * <br> * Each correction is specified in minutes and applied to adjust prayer times.<br> * Corrections are restricted to a range of -59 to +59 minutes.<br> * If a correction exceeds this range, it is reset to 0 (no correction).<br> *<br> * @property fajrMinute Manual adjustment for Fajr prayer.<br> * @property zuhrMinute Manual adjustment for Zuhr prayer.<br> * @property asrMinute Manual adjustment for Asr prayer.<br> * @property maghribMinute Manual adjustment for Maghrib prayer.<br> * @property ishaMinute Manual adjustment for Isha prayer.<br> */<br>data class PrayerManualCorrection(<br>    var fajrMinute: Int = 0,<br>    var zuhrMinute: Int = 0,<br>    var asrMinute: Int = 0,<br>    var maghribMinute: Int = 0,<br>    var ishaMinute: Int = 0<br>)</pre><h4>PrayerCustomAngle</h4><pre>/**<br> * Represents custom angles for Fajr and Isha prayers.<br> * <br> * These angles are used when the prayer time convention is set to CUSTOM.<br> *<br> * @property fajrAngle The custom angle for calculating Fajr prayer time.<br> * @property ishaAngle The custom angle for calculating Isha prayer time.<br> */<br>data class PrayerCustomAngle(<br>    val fajrAngle: Double = 9.0,<br>    val ishaAngle: Double = 14.0<br>)</pre><h4>FastingItem</h4><pre>/**<br> * Represents fasting times for a specific day, including Sehri and Iftaar times.<br> *<br> * @property date The date of the fasting times in milliseconds since epoch.<br> * @property sehriTime The time for Sehri (pre-dawn meal), equivalent to the Fajr prayer time.<br> * @property sehriTimeMillis The time for Sehri (pre-dawn meal), equivalent to the Fajr prayer time.<br> * @property iftaarTime The time for Iftaar (breaking the fast), equivalent to the Maghrib prayer time.<br> * @property iftaarTimeMillis The time for Iftaar (breaking the fast), equivalent to the Maghrib prayer time.<br> */<br>data class FastingItem(<br>  var date: Long,<br>  val sehriTime: String,<br>  val sehriTimeMillis: Long,<br>  val iftaarTime: String,<br>  val iftaarTimeMillis: Long<br>)</pre><h3>Configuration Options</h3><h4>High Latitude Adjustment (HighLatitudeAdjustment)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*8Iu3K_XRiYoUQ0tJWdDGgQ.png" /></figure><h4>Asr Time Calculation (AsrJuristicMethod)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*Y6EfwMuD7YXLgw_hbT5z-Q.png" /></figure><h4>Prayer Time Convention (PrayerTimeConvention)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*o3tfkECq25tSw2-hJRxbbQ.png" /></figure><h4>Time Format (TimeFormat)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*WKjELOsetimNAGFqhSJqng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_e3PEmgfyVuphxOX-bAzBw.png" /></figure><h3>⭐ GitHub Repository</h3><p>Check out the full project here:<br> 👉<a href="https://github.com/orbitalsonic/SonicOPT"> https://github.com/orbitalsonic/SonicOPT</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e6b1dabaa2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>