<?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 Ravishankar Ahirwar on Medium]]></title>
        <description><![CDATA[Stories by Ravishankar Ahirwar on Medium]]></description>
        <link>https://medium.com/@ravishankar.ahirwar?source=rss-f6b2c4929df8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vANBJ10qr6nab8C-US-Ktg.jpeg</url>
            <title>Stories by Ravishankar Ahirwar on Medium</title>
            <link>https://medium.com/@ravishankar.ahirwar?source=rss-f6b2c4929df8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 12:42:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ravishankar.ahirwar/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[ 4 Amazing Forts Near Pune You Must Visit — A Journey Through Maratha Glory]]></title>
            <link>https://medium.com/@ravishankar.ahirwar/4-amazing-forts-near-pune-you-must-visit-a-journey-through-maratha-glory-76b4f92a7475?source=rss-f6b2c4929df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/76b4f92a7475</guid>
            <category><![CDATA[trekking-forts-near-pune]]></category>
            <category><![CDATA[1-day-road-trips-pune]]></category>
            <category><![CDATA[go-pune-google-play-store]]></category>
            <category><![CDATA[visit-near-pune-in-rain]]></category>
            <category><![CDATA[hidden-forts-and-trails]]></category>
            <dc:creator><![CDATA[Ravishankar Ahirwar]]></dc:creator>
            <pubDate>Tue, 28 Oct 2025 17:52:01 GMT</pubDate>
            <atom:updated>2025-10-28T17:52:01.931Z</atom:updated>
            <content:encoded><![CDATA[<h3>🏰 4 Amazing Forts Near Pune You Must Visit — A Journey Through Maratha Glory</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YmCqe41xRXc63KJkhzhqoA.png" /></figure><h3>1. Sinhagad Fort — Fortress of Valor and Maratha Pride</h3><p>📍 <em>Distance: ~20 km from Pune | Location: Sinhagad Road</em></p><p>Perched atop a steep cliff 4,300 feet high, Sinhagad Fort stands as a proud reminder of the Maratha spirit. Known for the legendary <strong>Battle of Sinhagad (1670)</strong>, this fort immortalizes the bravery of <strong>Tanaji Malusare</strong>, one of Shivaji Maharaj’s most loyal warriors.</p><p>The trek to Sinhagad is short but scenic, lined with local stalls selling <em>pitla-bhakri</em> and lemon juice — the perfect fuel for your climb. From the top, you’ll enjoy <strong>panoramic views of Khadakwasla Dam</strong> and Pune city. The ruins of ancient gates, memorials, and bastions add a nostalgic charm, especially when wrapped in monsoon mist.</p><blockquote>Best time to visit:<em> Early morning or monsoon months<br> </em>Tips:<em> Carry water, light snacks, and a camera — the fort is photography heaven!</em></blockquote><h3>2. Rajgad Fort — The Capital of Chhatrapati Shivaji Maharaj</h3><p>📍 <em>Distance: ~36 km from Pune | Location: Near Bhor</em></p><p>Rajgad Fort once served as the <strong>capital of the Maratha Empire</strong>, making it one of the most historically significant forts near Pune. Divided into <strong>Balekilla, Padmavati, and Suvela Machi</strong>, the fort’s design reflects brilliant medieval military architecture.</p><p>The trek to Rajgad ranges from moderate to challenging, rewarding adventurers with <strong>360° views of the Sahyadri ranges</strong>. Its strong stone walls, ancient plaques, and grand entrances whisper stories of royal strategy and Maratha valor. Camping at the top under starry skies is an experience every trekker cherishes.</p><p>Best time to visit:<em> Monsoon and winter<br> </em>Tips:<em> Ideal for night treks — pack tents, torches, and a warm jacket.</em></p><h3>3. Torna Fort (Prachandagad) — The First Fort Captured by Shivaji Maharaj</h3><p>📍 <em>Distance: ~34 km from Pune | Location: Velhe</em></p><p>Known as <strong>Prachandagad</strong> for its vast expanse, Torna Fort holds a special place in history as the <strong>first fort captured by a young Shivaji Maharaj</strong> at just 16. Standing tall at <strong>4,603 feet</strong>, Torna offers mesmerizing views of Rajgad and Sinhagad on clear days.</p><p>The trek is challenging — expect steep ascents and narrow ridges — but the reward at the top is unmatched serenity and pride. The fort’s temples, bastions, and scattered ruins tell tales of Maratha beginnings. Monsoon clouds and mist lend it a mystical aura that makes it a photographer’s dream.</p><p>Best time to visit:<em> October to February<br> </em>Tips:<em> Ideal for experienced trekkers; local guides are available at Velhe village.</em></p><h3>4. Lohagad Fort — The Majestic Twin of Visapur</h3><p>📍 <em>Distance: ~48 km from Pune | Location: Malavli (near Lonavala)</em></p><p>Lohagad, or the <strong>“Iron Fort,”</strong> is one of the most accessible and beginner-friendly treks near Pune. Built during the Satavahana period and later fortified by Shivaji Maharaj, Lohagad is connected to the nearby <strong>Visapur Fort</strong> via a scenic ridge.</p><p>The highlight here is the iconic <strong>Vinchu Kata (Scorpion’s Tail)</strong> — a long, curved rampart resembling a scorpion’s tail, offering surreal views of <strong>Pawna Lake</strong> and <strong>Bhaja Caves</strong>. During monsoons, the entire fort is draped in mist and greenery, making it one of the most photogenic spots in the region.</p><p>Best time to visit:<em> Monsoon (June–September)<br> </em>Tips:<em> Easy trek — great for families and first-time trekkers.</em></p><h3>🌄 Final Thoughts</h3><p>Exploring these forts isn’t just about trekking or sightseeing — it’s about <strong>walking through chapters of Maratha history</strong>. Each fort tells a different story of courage, strategy, and resilience that shaped the Deccan. So, the next weekend you crave adventure and history, skip the malls — head to the hills, climb a fort, and feel the echoes of valor in the Pune winds.</p><h3>📌 Quick Summary</h3><p>Fort NameDistance from PuneDifficultyHighlightsSinhagad Fort20 kmEasyBattle of Sinhagad, Tanhaji’s bravery, scenic trekRajgad Fort36 kmModerateCapital fort, night trek, panoramic SahyadrisTorna Fort34 kmDifficultShivaji’s first fort, ridge walks, vast expanseLohagad Fort48 kmEasyVinchu Kata, Pawna Lake views, beginner trek</p><h3>📱 Discover More with <strong>Go Pune App</strong></h3><p>If you love exploring forts, nature spots, and hidden gems around the city — check out the<a href="https://play.google.com/store/apps/details?id=rshankar.satinpod.gopune"> <strong>Go Pune Android App</strong></a>.<br> It brings you <strong>real-time travel info</strong>, routes for <strong>metro, bus, and local trains</strong>, and a curated list of <strong>forts, temples, and attractions near Pune</strong> — all in one place!<br><a href="https://play.google.com/store/apps/details?id=rshankar.satinpod.gopune">https://play.google.com/store/apps/details?id=rshankar.satinpod.gopune</a></p><p><em>🧭 For more amazing forts and weekend getaways around Pune, </em><strong><em>download the Go Pune app</em></strong><em> today and make your next trip smarter and easier.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76b4f92a7475" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jetpack Compose Now Supports Auto-Sizing Text with autoSize in BasicText]]></title>
            <link>https://medium.com/@ravishankar.ahirwar/jetpack-compose-now-supports-auto-sizing-text-with-autosize-in-basictext-5f82c1f74a7b?source=rss-f6b2c4929df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f82c1f74a7b</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[compose]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[ui-ux-design]]></category>
            <dc:creator><![CDATA[Ravishankar Ahirwar]]></dc:creator>
            <pubDate>Fri, 25 Apr 2025 12:47:36 GMT</pubDate>
            <atom:updated>2025-04-25T12:47:36.478Z</atom:updated>
            <content:encoded><![CDATA[<p>Jetpack Compose just got smarter when it comes to handling text inside containers. As of <strong>today’s release</strong>, developers can now use the autoSize parameter in BasicText to make text <strong>automatically scale</strong> to fit its container.</p><p>Yes, that means <strong>less manual tweaking</strong> of font sizes and layouts — Compose takes care of it for you.</p><h3>✨ What’s New?</h3><p>A new parameter autoSize has been added to the BasicText composable. When enabled, it allows the text to <strong>shrink or grow based on the container&#39;s size</strong>, ensuring that the text content fits perfectly without clipping or overflow.</p><pre>Box( modifier = Modifier.padding(top = 100.dp)){<br><br>        Column {<br>            BasicText(<br>                text = &quot;Hello World&quot;,<br>                maxLines = 1,<br>                autoSize = TextAutoSize.StepBased(),<br>            )<br><br>            BasicText(<br>                modifier = Modifier.padding(start = 50.dp, end = 50.dp),<br>                text = &quot;Hello World&quot;,<br>                maxLines = 1,<br>                autoSize = TextAutoSize.StepBased(),<br>            )<br><br>            BasicText(<br>                modifier = Modifier.padding(start = 100.dp, end = 100.dp),<br>                text = &quot;Hello World&quot;,<br>                maxLines = 1,<br>                autoSize = TextAutoSize.StepBased(),<br>            )<br><br>            BasicText(<br>                modifier = Modifier.padding(start = 150.dp, end = 150.dp),<br>                text = &quot;Hello World&quot;,<br>                maxLines = 1,<br>                autoSize = TextAutoSize.StepBased(),<br>            )<br>        }</pre><p>OutPut:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*UMmempcSbOFG0wybmlRP3w.png" /><figcaption>Text With Auto Size</figcaption></figure><h3>✅ Benefits</h3><ul><li><strong>Responsive UI</strong>: Great for dynamic layouts and varying screen sizes.</li><li><strong>Less Boilerplate</strong>: No need to calculate font size manually.</li><li><strong>Cleaner Code</strong>: More declarative, just how Compose is meant to be.</li></ul><h3>🤔 When Should You Use It?</h3><ul><li>When you&#39;re working with <strong>dynamic containers</strong> whose sizes vary.</li><li>In <strong>custom components</strong> where content length isn’t fixed.</li><li>For <strong>accessibility</strong>, where font size adapts better to layout constraints.</li></ul><p>Keep in mind, you have to update the version of Compose to: 2025.04.01</p><pre>implementation(platform(&quot;androidx.compose:compose-bom:2025.04.01&quot;))</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f82c1f74a7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplifying Dependency Injection in Android with Koin]]></title>
            <link>https://medium.com/@ravishankar.ahirwar/simplifying-dependency-injection-in-android-with-koin-eab0fd1c7a25?source=rss-f6b2c4929df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/eab0fd1c7a25</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[androiddevevent]]></category>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[koin]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Ravishankar Ahirwar]]></dc:creator>
            <pubDate>Wed, 16 Apr 2025 09:56:43 GMT</pubDate>
            <atom:updated>2025-04-16T09:56:43.027Z</atom:updated>
            <content:encoded><![CDATA[<p>In modern Android development, <strong>Dependency Injection (DI)</strong> plays a crucial role in building modular, testable, and maintainable applications. While Dagger and Hilt are powerful DI tools, they can be complex and verbose. Enter <strong>Koin</strong> — a lightweight and easy-to-use dependency injection framework built specifically for Kotlin developers.</p><h3>🌱 What is Koin?</h3><p><strong>Koin</strong> is a Kotlin-based dependency injection framework that makes DI simple and readable. It’s designed to work natively with Kotlin and Android, with minimal boilerplate and no code generation.</p><h3>⚙️ Why Use Koin?</h3><p>🔹 Pure Kotlin — no annotations, no reflection hack</p><p>🔹Lightweight and quick to integrate</p><p>🔹 Easy to understand and debug</p><p>🔹 Great for both small and large projects</p><h3>🚀 Basic Setup</h3><ol><li><strong>Add dependencies in your </strong><strong>build.gradle</strong>:</li></ol><pre>implementation &quot;io.insert-koin:koin-android:3.5.0&quot;</pre><ol><li><strong>Create your module</strong>:</li></ol><pre>kotlinCopyEditval appModule = module {<br>    single { NetworkService() }<br>    factory { MainRepository(get()) }<br>    viewModel { MainViewModel(get()) }<br>}</pre><ol><li><strong>Start Koin in your </strong><strong>Application class</strong>:</li></ol><pre>kotlinCopyEditclass MyApp : Application() {<br>    override fun onCreate() {<br>        super.onCreate()<br>        startKoin {<br>            androidContext(this@MyApp)<br>            modules(appModule)<br>        }<br>    }<br>}</pre><ol><li><strong>Inject dependencies</strong> in your ViewModel or Activity:</li></ol><pre>kotlinopyEditclass MainViewModel(private val repository: MainRepository) : ViewModel() {<br>    // your logic here<br>}</pre><p>In an Activity or Fragment:</p><pre>kotlinopyEditval viewModel: MainViewModel by viewModel()</pre><h3>✅ Benefits in Real Projects</h3><p>Using Koin helps you avoid manually wiring objects and makes your code cleaner and more scalable. It works especially well with <strong>MVVM architecture</strong>, reducing the overhead of managing dependencies across multiple layers like ViewModels, Repositories, and UseCases.</p><h3>🧪 Bonus: Koin and Testing</h3><p>Koin also makes unit testing simple — you can override modules in your test setup, allowing for fast and reliable tests without relying on production implementations.</p><h3>📌 Final Thoughts</h3><p>If you’re building an Android app with Kotlin and want a <strong>lightweight DI solution</strong> that just works, <strong>Koin</strong> is a fantastic choice. It blends seamlessly with Android architecture components and helps keep your code clean, maintainable, and testable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eab0fd1c7a25" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Pick an Image from Gallery in Jetpack Compose (Android)]]></title>
            <link>https://medium.com/@ravishankar.ahirwar/how-to-pick-an-image-from-gallery-in-jetpack-compose-android-373b3b29cdf6?source=rss-f6b2c4929df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/373b3b29cdf6</guid>
            <category><![CDATA[pick-image-and-video]]></category>
            <category><![CDATA[image]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[compose]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <dc:creator><![CDATA[Ravishankar Ahirwar]]></dc:creator>
            <pubDate>Thu, 03 Apr 2025 16:08:37 GMT</pubDate>
            <atom:updated>2025-04-03T16:08:37.216Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, we will explore how to implement image selection from the device’s gallery using Jetpack Compose. Picking an image from the gallery is a common feature in Android apps, such as for profile pictures, post creation, etc. We’ll be using the latest Compose APIs and the ActivityResultContracts API, which allows us to request and handle results from system features (like selecting an image) in a more modern, lifecycle-aware way.</p><p>Let’s break it down step by step.</p><p>Step 1: Use ActivityResultContracts to Pick an Image</p><p>In this step, we will use ActivityResultContracts.GetContent() to open the gallery and pick an image. This contract is a modern way of handling activity results and works well in Compose.</p><p>Here is how you can implement it:</p><pre> val selectedImageUri: MutableState&lt;Uri?&gt; = remember { mutableStateOf(null) }<br>    val getImage = rememberLauncherForActivityResult(<br>        contract = ActivityResultContracts.GetContent(),<br>        onResult = { uri -&gt;<br>            selectedImageUri.value = uri // Store the picked image URI<br>        }<br>    )</pre><p>Compose UI Code</p><pre>            Box(<br>                modifier = Modifier<br>                    .align(Alignment.Top)<br>                    .size(200.dp)  // Size of the circle background<br>                    .background(<br>                        bgProfileIcon,<br>                        shape = CircleShape<br>                    )  // Gray circle background<br>                    .padding(16.dp)<br>            ) {<br><br>                IconButton(<br>                    modifier = Modifier<br>                        .align(Alignment.Center)<br>                        .size(200.dp),<br>                    onClick = { getImage.launch(&quot;image/*&quot;) }) {<br>                    selectedImageUri.value?.let { uri -&gt;<br>                        Image(<br>                            painter = rememberAsyncImagePainter(uri),<br>                            contentDescription = &quot;Selected Image&quot;,<br>                            modifier = Modifier<br>                                .align(Alignment.Center)<br>                                .requiredSize(400.dp)<br>                                .size(200.dp)  // Size of the circle background<br>                                .background(<br>                                    bgProfileIcon,<br>                                    shape = CircleShape<br>                                )<br>                        )<br>                    } ?: run {<br>                        // If no image is selected, show a placeholder<br>                        Text(<br>                            text = &quot;No image selected&quot;,<br>                            modifier = Modifier.padding(8.dp),<br>                            color = Color.Black<br>                        )<br>                    }<br><br>                }<br>            }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*clupnWhGUfsgQh9RpFlUcQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K2NH1pWtZjsZJIEvkxV-4w.png" /></figure><p><strong>Explanation of the Code:</strong><br><em>Setting up ActivityResultContracts.GetContent():</em></p><ul><li>This contract provides a simple way to request content, like images, from external sources. In our case, it opens the gallery to pick an image.</li><li>The launcher is used to invoke the gallery and handle the result. We specify the type of content we’re interested in, i.e., images (“image/*”).</li></ul><p><em>Handling the result:</em></p><ul><li>The onResult callback receives the selected image URI (if one was picked) and you can handle this URI however you wish — display it in an Image composable, upload it, or save it.</li></ul><p><em>Displaying the imag</em>e:</p><ul><li>Once an image is selected, we use rememberAsyncImagePainter from the Coil library to load and display the image in the Image composable.</li></ul><p>By using ActivityResultContracts.GetContent(), Jetpack Compose makes it incredibly easy to integrate system features like picking an image from the gallery. The modern contract-based API ensures that we handle results in a lifecycle-aware manner and reduces boilerplate code significantly.</p><p>This approach, along with Compose’s declarative UI style, enables developers to create beautiful, responsive UIs with minimal effort.</p><p>Source Code on Github: <a href="https://github.com/ravishankarahirwar/ComposeSample"><strong>https://github.com/ravishankarahirwar/ComposeSample</strong></a></p><h3>Thank You for Reading! 🙌🙏✌</h3><p>Don’t forget to <strong>clap 👏</strong> and <strong>follow me</strong> for more articles about <strong>Android Development</strong>, <strong>Kotlin</strong>,<strong> Jetpack Compose,</strong> and <strong>best practices</strong>.</p><p>Feel free to reach out if you need help or have questions about Android or Kotlin. I’m always happy to help!</p><p><strong>Follow me on:</strong></p><ul><li><a href="https://www.linkedin.com/in/ravishankar-android-developer/"><strong>LinkedIn</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=373b3b29cdf6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Jetpack Compose App with a Top Bar, Bottom Navigation, and Dropdown Menu]]></title>
            <link>https://medium.com/@ravishankar.ahirwar/building-a-jetpack-compose-app-with-a-top-bar-bottom-navigation-and-dropdown-menu-1c3ca683bd06?source=rss-f6b2c4929df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c3ca683bd06</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[bottomnavigationbar]]></category>
            <category><![CDATA[toolbar-android]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <dc:creator><![CDATA[Ravishankar Ahirwar]]></dc:creator>
            <pubDate>Wed, 26 Feb 2025 10:43:54 GMT</pubDate>
            <atom:updated>2025-02-26T10:43:54.840Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I’ll walk you through the process of creating a simple Android app using Jetpack Compose, focusing on two key UI components: the top bar (with a dropdown menu) and the bottom navigation bar. If you’re new to Jetpack Compose or want to learn how to implement these features in your app, this guide is perfect for you.</p><h3>What is Jetpack Compose?</h3><p>Jetpack Compose is Android’s modern toolkit for building native UIs. It simplifies UI development with less boilerplate and more intuitive code. With Jetpack Compose, you can build beautiful UIs using Kotlin and declarative syntax, which allows for faster development and better maintainability.</p><p>The App Overview</p><p>In this app, we have two major components:</p><ol><li><strong>Top Bar</strong> with a More Button and a Dropdown Menu</li><li><strong>Bottom Navigation Bar</strong> with four navigation items: Home, Profile, Search, and Settings.</li></ol><p>The app allows users to navigate between these screens while providing a clean, modern interface. Below is the breakdown of how I implemented these features using Jetpack Compose.</p><h3>Setting Up the Project</h3><p>First, make sure your Android project is set up to use Jetpack Compose. If you haven’t done so already, you can add Compose dependencies to your build.gradle file.</p><pre>android {<br>    ...<br>    composeOptions {<br>        kotlinCompilerExtensionVersion = &#39;1.4.0&#39;<br>        kotlinCompilerVersion = &#39;1.7.20&#39;<br>    }<br>}<br><br>dependencies {<br>    implementation &#39;androidx.compose.ui:ui:1.4.0&#39;<br>    implementation &#39;androidx.compose.material3:material3:1.0.0&#39;<br>    implementation &#39;androidx.compose.ui:ui-tooling-preview:1.4.0&#39;<br>    ...<br>}</pre><h3>Creating the Top Bar with a More Button</h3><p>The <strong>Top Bar</strong> contains a simple “More” button. When clicked, it shows a dropdown menu with additional options. In Jetpack Compose, this is easily achievable with the TopAppBar and DropdownMenu components.</p><p>Here’s how you can implement it:</p><pre>import androidx.compose.foundation.layout.Row<br>import androidx.compose.material3.*<br>import androidx.compose.runtime.*<br>import androidx.compose.ui.tooling.preview.Preview<br>import androidx.compose.ui.Modifier<br>import androidx.compose.ui.graphics.Color<br><br>@Composable<br>fun TopBar() {<br>    var expanded by remember { mutableStateOf(false) }<br><br>    TopAppBar(<br>        title = { Text(&quot;Jetpack Compose App&quot;) },<br>        actions = {<br>            IconButton(onClick = { expanded = !expanded }) {<br>                Icon(Icons.Default.MoreVert, contentDescription = &quot;More&quot;)<br>            }<br>            DropdownMenu(<br>                expanded = expanded,<br>                onDismissRequest = { expanded = false }<br>            ) {<br>                DropdownMenuItem(onClick = { /* Handle Action 1 */ }) {<br>                    Text(&quot;Option 1&quot;)<br>                }<br>                DropdownMenuItem(onClick = { /* Handle Action 2 */ }) {<br>                    Text(&quot;Option 2&quot;)<br>                }<br>                DropdownMenuItem(onClick = { /* Handle Action 3 */ }) {<br>                    Text(&quot;Option 3&quot;)<br>                }<br>            }<br>        },<br>        backgroundColor = Color.Blue<br>    )<br>}<br><br>@Preview(showBackground = true)<br>@Composable<br>fun PreviewTopBar() {<br>    TopBar()<br>}</pre><p>In the code above:</p><ul><li>We use TopAppBar to create the top bar.</li><li>The IconButton with MoreVert icon triggers the dropdown when clicked.</li><li>The DropdownMenu component displays a list of items that are shown when the menu is expanded.</li></ul><h3>Creating the Bottom Navigation Bar</h3><p>Next, we’ll set up the <strong>Bottom Navigation Bar</strong> with four items: Home, Profile, Search, and Settings. Each item navigates to a corresponding screen when clicked.</p><p>We can use BottomNavigation and BottomNavigationItem to easily create this navigation component.</p><pre>import androidx.compose.material3.*<br>import androidx.compose.runtime.*<br>import androidx.compose.ui.tooling.preview.Preview<br><br>@Composable<br>fun BottomNavBar() {<br>    var selectedItem by remember { mutableStateOf(0) }<br><br>    BottomNavigation {<br>        BottomNavigationItem(<br>            selected = selectedItem == 0,<br>            onClick = { selectedItem = 0 },<br>            label = { Text(&quot;Home&quot;) },<br>            icon = { Icon(Icons.Default.Home, contentDescription = &quot;Home&quot;) }<br>        )<br>        BottomNavigationItem(<br>            selected = selectedItem == 1,<br>            onClick = { selectedItem = 1 },<br>            label = { Text(&quot;Profile&quot;) },<br>            icon = { Icon(Icons.Default.Person, contentDescription = &quot;Profile&quot;) }<br>        )<br>        BottomNavigationItem(<br>            selected = selectedItem == 2,<br>            onClick = { selectedItem = 2 },<br>            label = { Text(&quot;Search&quot;) },<br>            icon = { Icon(Icons.Default.Search, contentDescription = &quot;Search&quot;) }<br>        )<br>        BottomNavigationItem(<br>            selected = selectedItem == 3,<br>            onClick = { selectedItem = 3 },<br>            label = { Text(&quot;Settings&quot;) },<br>            icon = { Icon(Icons.Default.Settings, contentDescription = &quot;Settings&quot;) }<br>        )<br>    }<br>}<br><br>@Preview(showBackground = true)<br>@Composable<br>fun PreviewBottomNavBar() {<br>    BottomNavBar()<br>}</pre><p>Source Code on Github : https://github.com/ravishankarahirwar/ComposeSample</p><h3>Thank You for Reading! 🙌🙏✌</h3><p>Don’t forget to <strong>clap 👏</strong> and <strong>follow me</strong> for more articles about <strong>Android Development</strong>, <strong>Kotlin</strong>,<strong> Jetpack Compose,</strong> and <strong>best practices</strong>.</p><p>Feel free to reach out if you need help or have questions about Android or Kotlin. I’m always happy to help!</p><p><strong>Follow me on:</strong></p><ul><li><a href="https://www.linkedin.com/in/ravishankar-android-developer/"><strong>LinkedIn</strong></a></li><li><a href="https://github.com/ravishankarahirwar"><strong>GitHub</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c3ca683bd06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Power of Wi-Fi DirectBoost Your Android App’s Connectivity]]></title>
            <link>https://medium.com/@ravishankar.ahirwar/unlocking-the-power-of-wi-fi-directboost-your-android-apps-connectivity-5811e971b6f5?source=rss-f6b2c4929df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5811e971b6f5</guid>
            <category><![CDATA[data-transfer]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[wifi-direct]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[wifi]]></category>
            <dc:creator><![CDATA[Ravishankar Ahirwar]]></dc:creator>
            <pubDate>Wed, 12 Feb 2025 06:07:25 GMT</pubDate>
            <atom:updated>2025-02-12T06:10:23.234Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*2M8_-uB0iN1kEEwPqDtFlA.png" /><figcaption>Data Transfe-By Wifi Direct</figcaption></figure><p>In today’s increasingly connected world, the need for seamless communication between devices is more critical than ever. While traditional Wi-Fi networks rely on routers or access points to facilitate connections, Wi-Fi Direct offers a different approach — enabling devices to connect directly without the need for an intermediary. As an Android developer, you can leverage this powerful feature to create faster, more efficient connections between devices. In this blog post, we will explore Wi-Fi Direct technology, its uses, and how you can implement it in your Android projects.</p><h3>What is Wi-Fi Direct?</h3><p>Wi-Fi Direct is a wireless communication standard that allows devices to connect directly to each other over Wi-Fi without requiring a traditional router or access point. It essentially turns devices into Wi-Fi hotspots, enabling peer-to-peer communication. Wi-Fi Direct is designed to provide faster data transfers, a more stable connection, and greater flexibility than Bluetooth, making it ideal for applications that require high-speed data sharing and low latency.</p><p>Key features of Wi-Fi Direct include:</p><ul><li><strong>Direct Device-to-Device Communication:</strong> Devices can connect directly without a central access point.</li><li><strong>High-Speed Data Transfer:</strong> Wi-Fi Direct supports data transfer speeds similar to those of regular Wi-Fi networks.</li><li><strong>Low Power Consumption:</strong> Unlike traditional Wi-Fi, Wi-Fi Direct uses less power when not actively transferring data.</li><li><strong>Range:</strong> Wi-Fi Direct has a much broader range compared to Bluetooth, which is typically limited to a few meters.</li></ul><h3>How Does Wi-Fi Direct Work?</h3><p>Wi-Fi Direct works by creating a peer-to-peer network between devices. One device acts as a group owner (GO), similar to a router, and others connect to it. Devices can communicate over the same frequency bands as regular Wi-Fi, but the network is ad-hoc and does not rely on a router. Wi-Fi Direct uses the same WPA2 security protocol as traditional Wi-Fi, ensuring encrypted communication between devices.</p><p>Here’s a simplified breakdown of the process:</p><ol><li><strong>Discovery:</strong> Devices search for other Wi-Fi Direct-enabled devices in the vicinity using the Wi-Fi Direct protocol.</li><li><strong>Connection Request:</strong> When a device finds another device, it sends a connection request.</li><li><strong>Authentication:</strong> The devices authenticate each other to ensure secure communication.</li><li><strong>Data Exchange:</strong> Once connected, data can be transferred directly between devices.</li></ol><h3>Common Use Cases of Wi-Fi Direct</h3><p>Wi-Fi Direct offers a wide range of use cases, especially when direct communication between devices is required without relying on a central network infrastructure. Some of the common use cases include:</p><ol><li><strong>File Sharing:</strong> Wi-Fi Direct is often used for transferring large files between devices quickly, such as sending photos, videos, or documents from one smartphone to another without needing a cellular connection or internet.</li><li><strong>Gaming:</strong> Peer-to-peer multiplayer gaming is made easier with Wi-Fi Direct, allowing players to connect their devices directly for real-time interaction without latency issues.</li><li><strong>Media Streaming:</strong> You can stream content from one device to another (such as from a smartphone to a TV) without the need for a Wi-Fi router. Wi-Fi Direct ensures high-quality streaming of videos and music.</li><li><strong>Printing:</strong> With Wi-Fi Direct-enabled printers, you can send print jobs from mobile devices or computers without connecting to a router or network.</li></ol><h3>How to Implement Wi-Fi Direct in Android</h3><p>As an Android developer, integrating Wi-Fi Direct into your app can open up a whole new world of possibilities. Android provides a Wi-Fi Direct API that allows you to manage connections and data transfers between devices.</p><p>Here’s a basic outline for using Wi-Fi Direct in your Android app:</p><h3>1. Add Permissions</h3><p>Before using Wi-Fi Direct, make sure to add the necessary permissions in the AndroidManifest.xml file:</p><pre> &lt;uses-permission android:name=&quot;android.permission.ACCESS_WIFI_STATE&quot; /&gt;<br>    &lt;uses-permission android:name=&quot;android.permission.CHANGE_WIFI_STATE&quot; /&gt;<br>    &lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot; /&gt;<br>    &lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;<br>    &lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;<br>    &lt;uses-permission android:name=&quot;android.permission.CHANGE_NETWORK_STATE&quot; /&gt;<br>    &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;<br>    &lt;uses-permission android:name=&quot;android.permission.NEARBY_WIFI_DEVICES&quot; /&gt;</pre><h3>2. Initialize the Wi-Fi Direct Manager</h3><p>In your activity or fragment, initialize the WifiP2pManager to manage Wi-Fi Direct operations.</p><pre>WifiP2pManager wifiP2pManager;<br>WifiP2pManager.Channel channel;<br><br>wifiP2pManager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE);<br>channel = wifiP2pManager.initialize(this, getMainLooper(), null);</pre><h3>3. Discover Devices</h3><p>To discover other Wi-Fi Direct devices, you can call the discoverPeers() method. This will initiate the search for nearby devices that support Wi-Fi Direct.</p><pre>wifiP2pManager.discoverPeers(channel, new WifiP2pManager.ActionListener() {<br>    @Override<br>    public void onSuccess() {<br>        // Device discovery initiated successfully<br>    }<br><br>    @Override<br>    public void onFailure(int reason) {<br>        // Handle failure<br>    }<br>});</pre><h3>4. Establish Connection</h3><p>Once the devices are discovered, you can establish a connection using the connect() method. This will allow devices to connect and share data.</p><pre>wifiP2pManager.connect(channel, config, new WifiP2pManager.ActionListener() {<br>    @Override<br>    public void onSuccess() {<br>        // Connection successful<br>    }<br><br>    @Override<br>    public void onFailure(int reason) {<br>        // Handle failure<br>    }<br>});</pre><h3>5. Data Transfer</h3><p>For data transfer, you can use standard networking protocols like sockets or HTTP to send data between connected devices. Alternatively, Android provides the WifiP2pInfo and WifiP2pGroup objects to manage data flow between peers.</p><h3>Challenges and Considerations</h3><p>While Wi-Fi Direct is powerful, there are some challenges and considerations you should keep in mind:</p><ul><li><strong>Device Compatibility:</strong> Not all devices support Wi-Fi Direct, so it’s essential to check if the device can establish a Wi-Fi Direct connection.</li><li><strong>Battery Usage:</strong> Although Wi-Fi Direct uses less power than regular Wi-Fi, continuous peer-to-peer communication can still drain the battery, especially for high data transfers.</li><li><strong>Security:</strong> While Wi-Fi Direct supports WPA2 security, ensuring secure data transfers is essential. Developers should handle sensitive data carefully, particularly when dealing with peer-to-peer connections.</li></ul><h3>Conclusion</h3><p>Wi-Fi Direct is a powerful technology that simplifies device communication by allowing direct connections between devices. Its ability to facilitate high-speed data transfer and low-latency communication makes it a great alternative to Bluetooth, especially for use cases like file sharing, gaming, and media streaming. As an Android developer, leveraging Wi-Fi Direct in your projects can enhance your app’s functionality and improve the user experience.</p><h3>Thank You for Reading! 🙌🙏✌</h3><p>Don’t forget to <strong>clap 👏</strong> and <strong>follow me</strong> for more articles about <strong>Android Development</strong>, <strong>Kotlin</strong>,<strong> Jetpack Compose,</strong> and <strong>best practices</strong>.</p><p>Feel free to reach out if you need help or have questions about Android or Kotlin. I’m always happy to help!</p><p><strong>Follow me on:</strong></p><ul><li><a href="https://www.linkedin.com/in/ravishankar-android-developer/"><strong>LinkedIn</strong></a></li><li><a href="https://github.com/ravishankarahirwar"><strong>GitHub</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5811e971b6f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Guide to Implementing Direct Boot-Aware in Android Apps]]></title>
            <link>https://medium.com/@ravishankar.ahirwar/a-guide-to-implementing-direct-boot-aware-in-android-apps-f3970d236263?source=rss-f6b2c4929df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3970d236263</guid>
            <category><![CDATA[android-developers]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[direct-boot-aware]]></category>
            <category><![CDATA[bootaware]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Ravishankar Ahirwar]]></dc:creator>
            <pubDate>Mon, 27 Jan 2025 12:11:37 GMT</pubDate>
            <atom:updated>2025-02-11T09:09:18.129Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CecPqlcZ_iMpqNtP_BtNYA.jpeg" /></figure><p>In the world of Android development, ensuring seamless experiences for users while optimizing security and performance is a constant balancing act. One feature that helps achieve this balance is <strong>Direct Boot</strong>. Introduced in Android 7.0 (Nougat), Direct Boot allows your app to function even before the device has fully unlocked after a reboot. For developers, leveraging this feature effectively requires a thorough understanding of <strong>Direct Boot-aware</strong> apps. In this blog, we’ll explore what Direct Boot is, how it works, and how you can make your Android app Direct Boot-aware.</p><h3><strong>What is Direct Boot?</strong></h3><p>Direct Boot is a feature in Android that enables apps to run before the device is unlocked by the user. This is particularly useful for apps that need to perform tasks like sending notifications or syncing data right after the device boots up, even if the user hasn’t yet unlocked their phone.</p><p>Before the introduction of Direct Boot, apps were unable to execute tasks requiring secure data (e.g., private data protected by the lock screen) until the user unlocked the device. Direct Boot solves this problem by allowing apps to run in a restricted mode called <strong>Direct Boot mode</strong>, where they can access certain system features but not sensitive data (such as files protected by the device’s lock screen).</p><h3>How Does Direct Boot Work?</h3><p>When a device is rebooted, Android divides its apps into two categories:</p><ol><li><strong>Direct Boot-aware apps</strong>: These apps can run in a limited state and access non-sensitive data. They are not blocked from functioning during boot even if the user hasn’t unlocked the device.</li><li><strong>Non-Direct Boot-aware apps</strong>: These apps cannot run until the device is unlocked because they depend on secure data (e.g., files in the device’s private storage).</li></ol><p>The key here is that apps marked as <strong>Direct Boot-aware</strong> can continue to work in a restricted mode, with only access to non-sensitive data. Once the user unlocks the device, the app can switch to its full functionality, including accessing secure data.</p><h3>Why Should Your App Be Direct Boot-Aware?</h3><ol><li><strong>Improved User Experience</strong>: If your app can perform essential tasks (such as syncing, receiving notifications, or updating widgets) immediately after a reboot, the user will have a better experience, especially for apps that rely on timely background tasks.</li><li><strong>Optimized Performance</strong>: Apps that utilize Direct Boot can start executing without waiting for user interaction. This can save time, reduce latency, and improve the overall performance of the app.</li><li><strong>Enhanced Security</strong>: By marking your app as Direct Boot-aware, you ensure that sensitive data is only accessible after the device has been unlocked. You help maintain the integrity of the device’s security, preventing unauthorized access to private data.</li></ol><h3>How to Make Your App Direct Boot-Aware</h3><p>Making your app Direct Boot-aware involves several steps. Here’s how you can integrate Direct Boot support into your Android app:</p><h4>1. Mark Your App as Direct Boot-Aware</h4><p>To make your app Direct Boot-aware, you need to declare this in the app’s manifest file. Add the following line to the &lt;application&gt; tag:</p><pre>&lt;application<br>    android:directBootAware=&quot;true&quot;<br>    ... &gt;</pre><p>This tells Android that your app can work in Direct Boot mode.</p><h4>2. Handle Direct Boot Mode in Code</h4><p>Once your app is declared as Direct Boot-aware, you must ensure it behaves correctly in both Direct Boot mode and normal mode. In Direct Boot mode, access to sensitive data (like files or preferences protected by encryption) is restricted, so your app should adapt accordingly.</p><p>You can check if the app is running in Direct Boot mode using DevicePolicyManager or Context.getDataDir() methods, and adjust your app’s behavior.</p><p>Here’s an example of how you might detect if the app is running in Direct Boot mode:</p><pre>if (StorageManager.isUserUnlocked()) {<br>    // Full access: Your app can access all sensitive data.<br>} else {<br>    // Direct Boot mode: Limited access to non-sensitive data<br>}</pre><h4>3. Use Direct Boot-Ready APIs</h4><p>Not all APIs are available in Direct Boot mode. To ensure your app works smoothly, you’ll need to rely on APIs that are marked as <strong>Direct Boot ready</strong>. These APIs provide a subset of functionality, such as:</p><ul><li><strong>JobScheduler</strong>: Can schedule jobs that can run during Direct Boot.</li><li><strong>AlarmManager</strong>: Can set alarms that trigger during Direct Boot.</li><li><strong>Broadcast Receivers</strong>: You can listen to system broadcasts even in Direct Boot mode.</li></ul><p>You’ll want to ensure your app gracefully handles limited functionality when it’s in Direct Boot mode and falls back to using fully unlocked data once the device is unlocked.</p><h4>4. Test Your App</h4><p>Finally, thorough testing is essential to make sure your app behaves correctly in both locked and unlocked states. You can simulate a reboot and test how your app performs in Direct Boot mode by:</p><ul><li>Using <strong>adb shell reboot</strong> to simulate a reboot.</li><li>Ensuring your app performs essential background tasks like syncing or sending notifications even before the device is unlocked.</li></ul><p>You can also test the locked vs unlocked states using <strong>Android Emulator</strong> or a real device.</p><h3>What Happens After the Device is Unlocked?</h3><p>Once the device is unlocked, your app gains access to all of its data and can switch to its normal mode of operation. It’s crucial to handle the transition from Direct Boot mode to the normal unlocked state smoothly by ensuring your app behaves correctly as the user interacts with it.</p><p><a href="https://github.com/ravishankarahirwar/DirectBootAwareSample"><strong>Sample of Direct Boot Aware on Git Hub</strong></a></p><h3><a href="https://github.com/ravishankarahirwar/DirectBootAwareSample">https://github.com/ravishankarahirwar/DirectBootAwareSample</a></h3><h3>Thank You for Reading! 🙌🙏✌</h3><p>Don’t forget to <strong>clap 👏</strong> and <strong>follow me</strong> for more articles about <strong>Android Development</strong>, <strong>Kotlin</strong>,<strong> Jetpack Compose,</strong> and <strong>best practices</strong>.</p><p>Feel free to reach out if you need help or have questions about Android or Kotlin. I’m always happy to help!</p><p><strong>Follow me on:</strong></p><ul><li><a href="https://www.linkedin.com/in/ravishankar-android-developer/"><strong>LinkedIn</strong></a></li><li><a href="https://github.com/ravishankarahirwar"><strong>GitHub</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3970d236263" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamlining Application Release Management with Jira, GitHub, and Confluence.]]></title>
            <link>https://medium.com/@ravishankar.ahirwar/streamlining-application-release-management-with-jira-github-and-confluence-cea0260eea45?source=rss-f6b2c4929df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cea0260eea45</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jira]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[release-notes]]></category>
            <category><![CDATA[release-management]]></category>
            <dc:creator><![CDATA[Ravishankar Ahirwar]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 07:44:00 GMT</pubDate>
            <atom:updated>2025-01-06T07:44:00.683Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s fast-paced mobile development world, efficient release management is essential for delivering high-quality applications on time. For Android developers, coordinating tasks, tracking issues, and managing documentation during the release process can be a daunting task. However, by leveraging powerful tools like <strong>Jira</strong>, <strong>GitHub</strong>, and <strong>Confluence</strong>, developers can seamlessly manage their application releases, improve collaboration, and streamline their workflows.</p><p>In this blog, we’ll explore how these three tools can be integrated to create a robust application release management system.</p><ol><li><strong>Sprint Start: Create a version in Jira.</strong></li></ol><p><strong>Create a Release Version</strong>: In Jira, you can create versions (releases) for each iteration of the Android app. This allows you to group all the issues that are targeted for a specific release. Like <strong>Beta_V1.0.0</strong><br>Link all sprint tasks with this release using FixVersion field in a task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G4N3KTHAFPccgDlwdYIktA.jpeg" /><figcaption>Create Version in Jira</figcaption></figure><p><strong>2. Sprint End: Complete the Version and create release note</strong></p><p>Jira has a built-in feature to create release notes based on issues linked to a version. Here’s how to generate them:</p><p>Jira offers an option to create release notes directly from the Release page.<br>- Click on Version Name then “Release Notes” or Generate Release Notes (this option might differ depending on the Jira version you’re using).<br>Customize Your Release Notes:<br>- You can export these release notes in various formats like HTML, PDF, or Save into confluence as a page.<br>- You can copy the generated release notes and paste them into Confluence, emails, or other documentation tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nvO-Zf1TXim4rsCGynXPeA.png" /><figcaption>Release note in Jira</figcaption></figure><p><strong>3. Selece HTML and click on copy to clipboard, Save Release note and generate a Page in Confluence.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*yZVhdp0TTU2H8DILWTsqQg.png" /><figcaption>Release Note Page in Confluence</figcaption></figure><p><strong>4. Git Hub: Got to github and create release and Tag</strong></p><p>In the repository, go to the <strong>“Releases”</strong> tab, which is located near the top of the page, just above the code files and folders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2kSIUi7T5KFOF6wgvvf-qQ.png" /><figcaption>Release note in GitHub</figcaption></figure><p><strong>Choose a Tag for the Release</strong>: Give the tag name same you as Jira Release name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*1fFeLbu9ALKDJxe9mv8vjw.png" /></figure><p>The PASTE the HTMLcontent in the write section as you copy from the Jira create release note section</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*oPWHxme7eroqDbhlPf0Vpw.png" /></figure><p><strong>5. Publish the release : Share Jira, Confluence Page and Git hub link with the teams</strong></p><p><strong>Conclusion: </strong>In this process the naming for the release will be constaint cross Jira, Confluence Page and Git hub Tag. It will be easy to track the releases and below will be the benfits we will get</p><ul><li>Tester easily identify what tickets they have to test</li><li>Creating release not process is automated</li><li>If you get any bug in any of the release just go to github and download the code fromg version tag and check where is the issue.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cea0260eea45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering MVVM Clean Architecture in Android: A Guide to Domain Layer and Use Cases]]></title>
            <link>https://medium.com/@ravishankar.ahirwar/mastering-mvvm-clean-architecture-in-android-a-guide-to-domain-layer-and-use-cases-2c8266d3e794?source=rss-f6b2c4929df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c8266d3e794</guid>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[mvvm-architecture]]></category>
            <category><![CDATA[android-app-architecture]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Ravishankar Ahirwar]]></dc:creator>
            <pubDate>Tue, 17 Dec 2024 07:53:14 GMT</pubDate>
            <atom:updated>2024-12-17T08:14:23.754Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*9CK_pgzyuWWJrPHKc6pW9Q.jpeg" /><figcaption>MVVM Clean Architecture</figcaption></figure><p>In this article, we’ll explore how to implement the MVVM (Model-View-ViewModel) pattern with Clean Architecture in Android, using Kotlin. Specifically, we’ll focus on how to properly set up the <strong>Domain Layer</strong> and <strong>Use Cases</strong>, which play a pivotal role in decoupling business logic from the rest of your app.</p><h3>Why MVVM and Clean Architecture?</h3><p>Before we dive into the code, let’s understand the concepts:</p><ul><li><strong>MVVM</strong> (Model-View-ViewModel) is a design pattern that helps in separating the UI logic from the business logic. This makes it easier to test and maintain the application.</li><li><strong>Clean Architecture</strong> is a layered architecture where different concerns are separated into distinct layers like Presentation, Domain, and Data. It promotes code maintainability, scalability, and testability by separating responsibilities.</li></ul><p>In Clean Architecture, we typically have the following layers:</p><ol><li><strong>Presentation Layer</strong>: Includes the UI (View) and ViewModel, responsible for handling user interactions.</li><li><strong>Domain Layer</strong>: Contains business logic, including Use Cases, which define actions that can be performed in the app.</li><li><strong>Data Layer</strong>: Handles data operations and communication with APIs or databases.</li></ol><h3>Setting Up MVVM with Clean Architecture</h3><p>We’ll start by building a simple app where users can fetch a list of items from a remote server and display them in a RecyclerView.</p><h3>1. Project Structure</h3><p>app/<br> ├── data/<br> │ ├── api/<br> │ ├── repository/<br> ├── domain/<br> │ ├── model/<br> │ ├── usecase/<br> ├── presentation/<br> │ ├── ui/<br> │ ├── viewmodel/<br> ├── di/<br> ├── MainActivity.kt<br> └── App.kt</p><h3>2. Domain Layer: Use Cases</h3><p>In Clean Architecture, the Domain layer is where we define the core business logic in the form of <strong>Use Cases</strong>. A Use Case represents a specific action or operation that can be performed in the app.</p><p>Let’s define a simple Use Case: fetching a list of items from the repository.</p><p><strong>Domain Model (Item.kt)</strong></p><pre>data class Item(<br>    val id: Int,<br>    val name: String,<br>    val description: String<br>)</pre><p><strong>UseCase (GetItemsUseCase.kt)</strong></p><pre>package com.example.cleanarchitecture.domain.usecase<br><br>import com.example.cleanarchitecture.domain.model.Item<br>import com.example.cleanarchitecture.domain.repository.ItemRepository<br><br>class GetItemsUseCase(private val itemRepository: ItemRepository) {<br><br>    suspend fun execute(): List&lt;Item&gt; {<br>        return itemRepository.getItems()<br>    }<br>}</pre><p>In the <strong>GetItemsUseCase</strong>, we are calling a method from the ItemRepository. This repository will be defined in the Data layer. Notice that we’re using suspend functions to make the code asynchronous.</p><h3>3. Data Layer: Repository and Remote Data Source</h3><p>Now let’s define how the data is fetched. We’ll assume there’s a network API that provides the data.</p><p><strong>API Service (ItemApiService.kt)</strong></p><pre>package com.example.cleanarchitecture.data.api<br><br>import com.example.cleanarchitecture.domain.model.Item<br>import retrofit2.http.GET<br><br>interface ItemApiService {<br>    <br>    @GET(&quot;items&quot;)<br>    suspend fun getItems(): List&lt;Item&gt;<br>}</pre><p><strong>Repository (ItemRepositoryImpl.kt)</strong></p><pre>package com.example.cleanarchitecture.data.repository<br><br>import com.example.cleanarchitecture.data.api.ItemApiService<br>import com.example.cleanarchitecture.domain.model.Item<br>import com.example.cleanarchitecture.domain.repository.ItemRepository<br><br>class ItemRepositoryImpl(private val apiService: ItemApiService) : ItemRepository {<br>    <br>    override suspend fun getItems(): List&lt;Item&gt; {<br>        return apiService.getItems()<br>    }<br>}</pre><p>The <strong>ItemRepositoryImpl</strong> communicates with the API to fetch the data and then provides it to the <strong>Domain Layer</strong> via the ItemRepository interface.</p><h3>4. Presentation Layer: ViewModel and UI</h3><p>In the Presentation layer, we’ll define the <strong>ViewModel</strong> that will interact with the <strong>Use Case</strong> and expose the data to the <strong>View</strong>.</p><p><strong>ViewModel (ItemViewModel.kt)</strong></p><pre>package com.example.cleanarchitecture.presentation.viewmodel<br><br>import androidx.lifecycle.ViewModel<br>import androidx.lifecycle.liveData<br>import com.example.cleanarchitecture.domain.usecase.GetItemsUseCase<br><br>class ItemViewModel(private val getItemsUseCase: GetItemsUseCase) : ViewModel() {<br><br>    fun getItems() = liveData {<br>        try {<br>            val items = getItemsUseCase.execute()<br>            emit(items)<br>        } catch (exception: Exception) {<br>            emit(emptyList&lt;Item&gt;())<br>        }<br>    }<br>}</pre><p>Here, the <strong>ItemViewModel</strong> exposes the data via liveData. The UI observes this liveData and updates accordingly when the data is received.</p><p><strong>MainActivity (MainActivity.kt)</strong></p><pre>package com.example.cleanarchitecture.presentation.ui<br><br>import android.os.Bundle<br>import android.widget.Toast<br>import androidx.activity.viewModels<br>import androidx.appcompat.app.AppCompatActivity<br>import androidx.recyclerview.widget.LinearLayoutManager<br>import com.example.cleanarchitecture.databinding.ActivityMainBinding<br>import com.example.cleanarchitecture.presentation.viewmodel.ItemViewModel<br>import com.example.cleanarchitecture.presentation.adapter.ItemAdapter<br><br>class MainActivity : AppCompatActivity() {<br><br>    private val itemViewModel: ItemViewModel by viewModels()<br>    private lateinit var binding: ActivityMainBinding<br>    private val adapter = ItemAdapter()<br><br>    override fun onCreate(savedInstanceState: Bundle?) {<br>        super.onCreate(savedInstanceState)<br>        binding = ActivityMainBinding.inflate(layoutInflater)<br>        setContentView(binding.root)<br><br>        binding.recyclerView.layoutManager = LinearLayoutManager(this)<br>        binding.recyclerView.adapter = adapter<br><br>        itemViewModel.getItems().observe(this, { items -&gt;<br>            if (items.isNotEmpty()) {<br>                adapter.submitList(items)<br>            } else {<br>                Toast.makeText(this, &quot;No data found&quot;, Toast.LENGTH_SHORT).show()<br>            }<br>        })<br>    }<br>}</pre><p>In <strong>MainActivity</strong>, we observe the liveData from the ItemViewModel. When the data is loaded, we populate the RecyclerView using an ItemAdapter.</p><h3>6. Conclusion</h3><p>In this article, we’ve seen how to structure an Android app using <strong>MVVM</strong> and <strong>Clean Architecture</strong>. We implemented a simple app that fetches a list of items from a remote API, using:</p><ul><li><strong>Domain Layer</strong> for Use Cases that define the business logic.</li><li><strong>Data Layer</strong> for managing data operations.</li><li><strong>Presentation Layer</strong> for the UI and ViewModel that interact with the domain layer.</li></ul><p>By using this architecture, we ensure a clear separation of concerns, making our codebase more maintainable, scalable, and testable.</p><p><a href="https://github.com/ravishankarahirwar/AndroidAppArchitecture/tree/master">Source Code in GitHub</a>: https://github.com/ravishankarahirwar/AndroidAppArchitecture/tree/master</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c8266d3e794" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[oneAdd emergency contact in Android Phone]]></title>
            <link>https://medium.com/@ravishankar.ahirwar/oneadd-emergency-contact-in-android-phone-3990be08b0e4?source=rss-f6b2c4929df8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3990be08b0e4</guid>
            <category><![CDATA[androidfeatures]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[emergency-contact]]></category>
            <category><![CDATA[features]]></category>
            <category><![CDATA[emergency]]></category>
            <dc:creator><![CDATA[Ravishankar Ahirwar]]></dc:creator>
            <pubDate>Fri, 22 Nov 2019 07:27:15 GMT</pubDate>
            <atom:updated>2019-11-22T09:26:20.300Z</atom:updated>
            <content:encoded><![CDATA[<h3>Add/Access emergency contacts in Android Phone.</h3><p>No one knows when the emergency comes in case of an emergency we need our family, relatives, friends help as soon as possible.</p><p>Your phone is the best source to get in contact with your family, relatives, friends but the main issue generally phone is locked another can’t access your personal information without your support.</p><p>Android phone a great feature to solve the above problem, you can add emergency contact information. You can also add other valuable information like Address, Blood Type, Allergies, Organ donor this basic information is very helpful in case of emergency and you can save your life.</p><p>How to add emergency contact information in your phone</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*JJwT8h6i9CSd_dOrpXFneg.png" /></figure><p>Lock your phone once, then try to unlock, at the bottom of the screen you will find<strong> EMERGENCY </strong>text will there please click on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/299/1*fgGhzndTJ9Pzs60VjXAu9A.png" /></figure><p>Double-tap on emergency information(red colour button at the top)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*ydUcv46tbXXb_-kzftCgfg.png" /></figure><p>Please find edit icon at the top right of the above screen, as soon as you click the edit button you need to unlock the phone to edit the information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*fEMirGITF5Vgjfdu6-cn2A.png" /></figure><p>Just tap on the information you want to edit, one dialog will appear type in it.</p><p>How to access emergency information, Just follow the first 3 steps of this story.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3990be08b0e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>