<?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 Parth Munjpara on Medium]]></title>
        <description><![CDATA[Stories by Parth Munjpara on Medium]]></description>
        <link>https://medium.com/@parthm7396?source=rss-5469e53e147a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0Uff0Yfng6AmcHbXeKoNww.jpeg</url>
            <title>Stories by Parth Munjpara on Medium</title>
            <link>https://medium.com/@parthm7396?source=rss-5469e53e147a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 16:55:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@parthm7396/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[Android 17 Contact Picker Series — Part 2: Building a Complete Jetpack Compose Implementation]]></title>
            <link>https://proandroiddev.com/android-17-contact-picker-series-part-2-building-a-complete-jetpack-compose-implementation-ae280facbbb1?source=rss-5469e53e147a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae280facbbb1</guid>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Parth Munjpara]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 19:01:51 GMT</pubDate>
            <atom:updated>2026-06-23T03:10:19.744Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zqpJ_1-3hD3oWG3nkyMOOA.png" /></figure><h3>Introduction</h3><p>In <a href="https://proandroiddev.com/android-17-contact-picker-series-part-1-understanding-the-new-permissionless-contacts-api-965092427817"><strong>Part 1</strong></a>, we explored what the new Android 17 Contact Picker is, why it exists, and how it improves user privacy by eliminating the need for READ_CONTACTS permission in many scenarios.</p><p>Now let’s build a complete implementation using Jetpack Compose.</p><p>By the end of this article you’ll have:</p><ul><li>Single contact selection</li><li>Multiple contact selection</li><li>Phone-only selection</li><li>Permissionless contact access on Android 17+</li><li>Backward compatibility for Android 16 and below</li><li>A production-ready architecture</li></ul><h3>Why Android 17 Contact Picker Matters</h3><p>Before Android 17, selecting a contact typically required:</p><pre>&lt;uses-permission android:name=&quot;android.permission.READ_CONTACTS&quot;/&gt;</pre><p>And a runtime permission request:</p><pre>ActivityResultContracts.RequestPermission()</pre><p>This approach had several drawbacks:</p><ul><li>Users were asked to grant access to their entire contact database.</li><li>Many users denied the permission.</li><li>Apps often needed only one or two contacts.</li></ul><p>Android 17 changes this completely.</p><p>The system picker grants temporary access only to the contacts selected by the user.</p><h3>The User Experience</h3><p>Our sample supports three different modes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*lSIH3AiqD9VPn0ZzvINHsg.png" /></figure><h3>Project Setup</h3><p>Our project targets Android 17 while remaining compatible with older versions.</p><pre>android {<br>    minSdk = 24<br>    targetSdk = 37<br>}</pre><h3>Contact Model</h3><p>We’ll use a simple model representing a selected contact.</p><pre>data class Contact(<br>    val lookupKey: String,<br>    val name: String,<br>    val emails: List&lt;String&gt;,<br>    val phones: List&lt;String&gt;<br>)</pre><p>This model works for:</p><ul><li>Single contact selection</li><li>Multiple contact selection</li><li>Phone-only selection</li></ul><p>without requiring different data structures.</p><h3>Step 1 — Register the Contact Picker Launcher</h3><p>The Android 17 Contact Picker returns a session URI containing all selected results.</p><pre>val pickContact =<br>    rememberLauncherForActivityResult(<br>        ActivityResultContracts.StartActivityForResult()<br>    ) {<br>        if (it.resultCode == Activity.RESULT_OK) {<br>            val resultUri =<br>                it.data?.data ?: return@rememberLauncherForActivityResult<br><br>            coroutine.launch {<br>                contacts =<br>                    processContactPickerResultUri(<br>                        resultUri,<br>                        context<br>                    )<br>            }<br>        }<br>    }</pre><p>Notice that we never request READ_CONTACTS.</p><p>The picker handles user consent for us.</p><h3>Step 2 — Single Contact Selection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*chxxKdjDPDv-cZDVbq95IA.gif" /></figure><p>Let’s start with the simplest use case.</p><pre>val requestedFields = arrayListOf(<br>    ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE,<br>    ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE<br>)<br><br>val pickContactIntent = Intent(ACTION_PICK_CONTACTS).apply {<br>    putExtra(EXTRA_USE_SYSTEM_CONTACTS_PICKER, true)<br><br>    putStringArrayListExtra(<br>        EXTRA_PICK_CONTACTS_REQUESTED_DATA_FIELDS,<br>        requestedFields<br>    )<br>}<br><br>pickContact.launch(pickContactIntent)</pre><p>The important part here is:</p><pre>EXTRA_PICK_CONTACTS_REQUESTED_DATA_FIELDS</pre><p>which tells the system exactly which data we need.</p><h3>Step 3 — Multiple Contact Selection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*wAK_tSdImN4l-J9Pf4HHsg.gif" /></figure><p>One of the most exciting additions in Android 17 is native multi-select support.</p><pre>val pickContactIntent = Intent(ACTION_PICK_CONTACTS).apply {<br><br>    putExtra(EXTRA_USE_SYSTEM_CONTACTS_PICKER, true)<br><br>    putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true)<br><br>    putExtra(<br>        EXTRA_PICK_CONTACTS_SELECTION_LIMIT,<br>        5<br>    )<br><br>    putStringArrayListExtra(<br>        EXTRA_PICK_CONTACTS_REQUESTED_DATA_FIELDS,<br>        requestedFields<br>    )<br>}</pre><p>The selection limit allows us to control how many contacts the user can choose.</p><p>For example:</p><pre>putExtra(EXTRA_PICK_CONTACTS_SELECTION_LIMIT, 5)</pre><p>limits the selection to five contacts.</p><h3>Step 4 — Phone-Only Selection</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*JehKhp2CAJ0y8wce6DbbKA.png" /></figure><p>Sometimes an app needs only a phone number.</p><p>Android 17 supports this directly.</p><pre>val pickContactIntent = Intent(ACTION_PICK_CONTACTS).apply {<br><br>    putExtra(EXTRA_USE_SYSTEM_CONTACTS_PICKER, true)<br><br>    putStringArrayListExtra(<br>        EXTRA_PICK_CONTACTS_REQUESTED_DATA_FIELDS,<br>        arrayListOf(<br>            ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE<br>        )<br>    )<br>}</pre><p>The picker automatically changes its behavior and allows users to select individual phone numbers instead of entire contacts.</p><p>This creates a much better user experience than querying all contact data manually.</p><h3>Step 5 — Processing the Result URI</h3><p>After the picker returns, we receive a session URI.</p><p>The URI can be queried using the Content Resolver.</p><pre>val projection = arrayOf(<br>    ContactsContract.Contacts.LOOKUP_KEY,<br>    ContactsContract.Contacts.DISPLAY_NAME_PRIMARY,<br>    ContactsContract.Data.MIMETYPE,<br>    ContactsContract.Data.DATA1<br>)</pre><p>Each row contains:</p><ul><li>Contact identifier</li><li>Display name</li><li>Data type</li><li>Data value</li></ul><h3>Aggregating Contact Data</h3><p>A single contact may produce multiple rows.</p><p>To merge them correctly we aggregate by lookup key.</p><pre>val contactsMap = mutableMapOf&lt;String, Contact&gt;()</pre><p>When another row for the same contact appears:</p><pre>contactsMap[lookupKey] =<br>    existingContact.copy(<br>        emails = existingContact.emails + email,<br>        phones = existingContact.phones + phone<br>    )</pre><p>The final result becomes:</p><pre>Contact(<br>    name = &quot;John Doe&quot;,<br>    emails = listOf(<br>        &quot;john@gmail.com&quot;<br>    ),<br>    phones = listOf(<br>        &quot;+91 9999999999&quot;,<br>        &quot;+91 8888888888&quot;<br>    )<br>)</pre><h3>Step 6 — Backward Compatibility</h3><p>Android 17 APIs aren’t available on older devices.</p><p>For Android 16 and below we fall back to the traditional contact picker.</p><pre>if (Build.VERSION.SDK_INT &gt;= 37) {<br>    launchAndroid17Picker()<br>} else {<br>    launchLegacyPicker()<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VeSGnJxIkVh2OyTN3KZHOw.png" /></figure><h3>Runtime Permission Handling</h3><p>Older Android versions still require:</p><pre>&lt;uses-permission<br>    android:name=&quot;android.permission.READ_CONTACTS&quot;/&gt;</pre><p>and:</p><pre>ActivityResultContracts.RequestPermission()</pre><p>before reading contact data.</p><p>This ensures the sample remains usable on devices running Android 16 and below.</p><h3>Limitations on Older Android Versions</h3><p>The legacy picker cannot fully match Android 17 functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*MQq1bWKZ_r3wHVjZrPO9zQ.png" /></figure><p>This limitation comes from the platform itself rather than our implementation.</p><h3>Compose UI</h3><p>Displaying results is straightforward.</p><pre>LazyColumn {<br>    items(contacts) { contact -&gt;<br>        ListItem(<br>            headlineContent = {<br>                Text(contact.name)<br>            },<br>            supportingContent = {<br>                Column {<br><br>                    if (contact.emails.isNotEmpty())<br>                        Text(<br>                            &quot;Emails: ${<br>                                contact.emails.joinToString()<br>                            }&quot;<br>                        )<br><br>                    if (contact.phones.isNotEmpty())<br>                        Text(<br>                            &quot;Phones: ${<br>                                contact.phones.joinToString()<br>                            }&quot;<br>                        )<br>                }<br>            }<br>        )<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*h8dj9xysbFVbTci-SxuL0w.png" /></figure><h3>Production Considerations</h3><p>Before shipping this feature, consider:</p><h4>Limit Requested Fields</h4><p>Request only data you actually need.</p><pre>ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE</pre><p>instead of requesting every field.</p><h4>Handle Missing Data</h4><p>Some contacts may have:</p><ul><li>No phone numbers</li><li>No email addresses</li><li>Multiple phone numbers</li></ul><p>Always design your UI accordingly.</p><h4>Respect Privacy</h4><p>The new Contact Picker is designed around data minimization.</p><p>Avoid falling back to broad contact access unless absolutely necessary.</p><h3>Final Thoughts</h3><p>Android 17’s Contact Picker is one of the most impactful privacy improvements for apps that interact with user contacts.</p><p>It allows developers to:</p><ul><li>Remove unnecessary permission requests</li><li>Improve user trust</li><li>Support multiple contact selection</li><li>Retrieve only the data they actually need</li></ul><p>And with a small amount of compatibility code, you can still provide a good experience for users on older Android versions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae280facbbb1" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/android-17-contact-picker-series-part-2-building-a-complete-jetpack-compose-implementation-ae280facbbb1">Android 17 Contact Picker Series — Part 2: Building a Complete Jetpack Compose Implementation</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android 17 Contact Picker Series — Part 1: Understanding the New Permissionless Contacts API]]></title>
            <link>https://proandroiddev.com/android-17-contact-picker-series-part-1-understanding-the-new-permissionless-contacts-api-965092427817?source=rss-5469e53e147a------2</link>
            <guid isPermaLink="false">https://medium.com/p/965092427817</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[android17]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[android-development]]></category>
            <dc:creator><![CDATA[Parth Munjpara]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 19:01:40 GMT</pubDate>
            <atom:updated>2026-06-23T03:08:30.319Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FGSHv-lGar0wAVtiV0TRoA.png" /></figure><p>Android has been steadily moving toward a privacy-first ecosystem over the last few releases.</p><p>We saw this shift with the introduction of the Photo Picker, which allowed users to share specific photos with an application without granting access to their entire media library.</p><p>With Android 17, Google is applying the same philosophy to contacts through the new Contact Picker.</p><p>At first glance, it might seem like Android is replacing traditional contact access entirely. Many developers have even wondered whether this means the end of READ_CONTACTS.</p><p>The reality is a bit more nuanced.</p><p>The new Contact Picker is an excellent solution for many common workflows, but there are still valid scenarios where full contact access remains necessary.</p><p>In this article, we’ll explore:</p><ul><li>What the new Contact Picker is</li><li>Why it was introduced</li><li>How contact access worked before Android 17</li><li>Real-world scenarios where Contact Picker shines</li><li>Situations where READ_CONTACTS is still the right choice</li><li>How to decide which approach your application should use</li></ul><h3>Contact Access Before Android 17</h3><p>Before discussing what’s new, it’s worth understanding how Android applications have traditionally worked with contacts.</p><p>Historically, developers had two primary approaches.</p><h4>Approach 1: Read Contacts Directly</h4><p>Applications could request:</p><pre>&lt;uses-permission<br>    android:name=&quot;android.permission.READ_CONTACTS&quot; /&gt;</pre><p>Once granted, the application could query ContactsContract and access the user&#39;s contact database.</p><p>This approach provided complete flexibility.</p><p>Developers could:</p><ul><li>Display all contacts</li><li>Implement search functionality</li><li>Filter contacts</li><li>Sync contacts with backend services</li><li>Import contacts into the application</li></ul><p>However, there was a downside.</p><p>Even if an application only needed a single phone number, it still had to request permission to access every contact stored on the device.</p><p>For users, this often felt excessive.</p><h4>Approach 2: Launch the System Contact Picker</h4><p>Android has supported contact picking for many years.</p><p>Developers could launch a system-provided picker and allow users to select a contact manually.</p><p>The application would then receive information about the selected contact.</p><p>This worked well for simple use cases, but it wasn’t designed around modern privacy expectations and lacked some of the flexibility provided by newer Android platform features.</p><h3>Why Did Android Introduce a New Contact Picker?</h3><p>Consider a simple feature found in many applications:</p><p><strong>Add Emergency Contact</strong></p><p>The user taps a button and selects a family member.</p><p>In this workflow, the application needs exactly one contact.</p><p>Not ten.</p><p>Not one hundred.</p><p>Not the user’s entire address book.</p><p>Just one contact.</p><p>Yet historically, many applications would request READ_CONTACTS to accomplish this task.</p><p>From a privacy perspective, that’s difficult to justify.</p><p>The new Contact Picker embraces the principle of least privilege.</p><p>Instead of giving applications broad access to personal information, users explicitly choose which contacts they want to share.</p><p>The application receives only the information necessary to complete the task.</p><p>This creates a better balance between functionality and privacy.</p><h3>The Real Question Developers Should Ask</h3><p>When implementing contact-related features, developers often ask:</p><blockquote>Should I use the new Contact Picker or continue using READ_CONTACTS?</blockquote><p>A better question is:</p><blockquote>Does my application need specific contacts selected by the user, or does it need access to the entire contact database?</blockquote><p>The answer usually makes the decision obvious.</p><p>Let’s look at some real-world examples.</p><h3>Scenario 1: Emergency Contact Setup</h3><p>Imagine you’re building a healthcare, safety, or fitness application.</p><p>During onboarding, the user is asked to add an emergency contact.</p><p>The workflow is straightforward:</p><ol><li>Tap “Add Emergency Contact”</li><li>Select a person</li><li>Save the information</li></ol><p>The application only needs a single contact.</p><p>It doesn’t need:</p><ul><li>Search across all contacts</li><li>Contact synchronization</li><li>Access to every stored phone number</li></ul><p>In this case, the Contact Picker is the ideal solution.</p><h4>Recommendation</h4><p>✅ Use Contact Picker</p><h3>Scenario 2: Sending Money to a Contact</h3><p>Many payment applications allow users to select a recipient directly from their contacts.</p><p>The user chooses a person and proceeds with the transaction.</p><p>The application only needs:</p><ul><li>Name</li><li>Phone number</li></ul><p>It doesn’t need visibility into every contact on the device.</p><p>Requesting broad contact access for this workflow creates unnecessary permission friction.</p><h4>Recommendation</h4><p>✅ Use Contact Picker</p><h3>Scenario 3: Inviting a Few Friends</h3><p>Suppose you’re building an event-planning application.</p><p>A user creates an event and wants to invite a few friends.</p><p>The workflow might look like this:</p><ol><li>Tap “Invite Friends”</li><li>Select three contacts</li><li>Send invitations</li></ol><p>The application only needs the contacts explicitly chosen by the user.</p><p>It doesn’t need to analyze the entire address book.</p><h4>Recommendation</h4><p>✅ Use Contact Picker</p><h3>Scenario 4: Building a Messaging App</h3><p>Now let’s consider a completely different type of application.</p><p>Messaging platforms often provide features such as:</p><ul><li>Contacts already using the app</li><li>Suggested connections</li><li>Automatic contact discovery</li><li>Contact synchronization</li></ul><p>To support these features, the application needs access to the user’s broader contact list.</p><p>The application isn’t waiting for the user to manually select a contact.</p><p>Instead, it needs to analyze contacts, compare them with backend records, and determine which users are already registered.</p><p>This cannot be achieved through Contact Picker alone.</p><h4>Recommendation</h4><p>✅ Use READ_CONTACTS</p><h3>Scenario 5: Referral and Invite Systems</h3><p>Many applications include an “Invite Friends” screen that immediately displays the user’s entire contact list.</p><p>The user can:</p><ul><li>Search contacts</li><li>Scroll through contacts</li><li>Select multiple contacts</li></ul><p>The key difference here is that the application itself is rendering the contact list.</p><p>To do that, it must first read the contact database.</p><p>The Contact Picker doesn’t provide the application with the entire address book.</p><p>It only returns contacts the user explicitly selects.</p><h4>Recommendation</h4><p>✅ Use READ_CONTACTS</p><h3>Scenario 6: CRM and Business Applications</h3><p>Customer Relationship Management (CRM) applications often allow users to:</p><ul><li>Import contacts</li><li>Search contacts</li><li>Organize contacts</li><li>Manage leads</li><li>Sync customer information</li></ul><p>These applications are fundamentally built around contact management.</p><p>Without access to the full contact database, many core features would not function.</p><h4>Recommendation</h4><p>✅ Use READ_CONTACTS</p><h3>Contact Picker vs READ_CONTACTS</h3><p>The following table summarizes the decision-making process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*Hkt2GnDft6BTToLdB4YvJg.png" /></figure><h3>A Common Misconception</h3><p>One misconception I’ve seen since the Android 17 announcement is:</p><blockquote>“The new Contact Picker replaces READ_CONTACTS.”</blockquote><p>It doesn’t.</p><p>The Contact Picker solves a specific problem:</p><p>Allowing users to share individual contacts without granting broad access to their entire address book.</p><p>For many applications, this is exactly what’s needed.</p><p>For others, especially those built around contact discovery, synchronization, or management, full contact access remains a legitimate requirement.</p><p>The goal isn’t to eliminate READ_CONTACTS.</p><p>The goal is to avoid requesting it when it isn’t actually necessary.</p><h3>The Bigger Privacy Trend</h3><p>The Contact Picker is part of a larger Android trend.</p><p>Over the last few years, Android has increasingly favored user-selected access over blanket permissions.</p><p>We’ve seen this with:</p><ul><li>Media access</li><li>Photos</li><li>Videos</li><li>Notifications</li><li>Nearby devices</li></ul><p>And now contacts.</p><p>The platform is encouraging developers to request the minimum amount of data required to complete a task.</p><p>Applications that embrace this approach often benefit from:</p><ul><li>Higher user trust</li><li>Better onboarding experiences</li><li>Fewer permission denials</li><li>Improved privacy compliance</li></ul><h3>Final Thoughts</h3><p>The Android 17 Contact Picker is one of those features that seems small at first glance but has meaningful implications for application design.</p><p>Before reaching for READ_CONTACTS, ask yourself a simple question:</p><blockquote>Does my application really need access to the entire contact database?</blockquote><p>If the answer is no, the Contact Picker is likely the better choice.</p><p>If the answer is yes because your application genuinely depends on contact discovery, synchronization, search, or management, then READ_CONTACTS remains the correct solution.</p><p>The key is choosing the right tool for the right use case.</p><p>In Part 2, we’ll build a production-ready Contact Picker implementation, explore backward compatibility, handle edge cases, and integrate the feature into a modern Android architecture.</p><p>📖 Continue reading: <a href="https://proandroiddev.com/android-17-contact-picker-series-part-2-building-a-complete-jetpack-compose-implementation-ae280facbbb1"><strong>Android 17 Contact Picker Series — Part 2: Building a Complete Jetpack Compose Implementation</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=965092427817" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/android-17-contact-picker-series-part-1-understanding-the-new-permissionless-contacts-api-965092427817">Android 17 Contact Picker Series — Part 1: Understanding the New Permissionless Contacts API</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ How to Integrate AI in Android Apps (Real-World, Practical Guide)]]></title>
            <link>https://proandroiddev.com/how-to-integrate-ai-in-android-apps-real-world-practical-guide-90cf4f7a64c1?source=rss-5469e53e147a------2</link>
            <guid isPermaLink="false">https://medium.com/p/90cf4f7a64c1</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Parth Munjpara]]></dc:creator>
            <pubDate>Thu, 14 May 2026 00:13:33 GMT</pubDate>
            <atom:updated>2026-05-14T00:13:33.917Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fHNNGZQl1T59WrxNfOdMCw.png" /></figure><h3>🚀 Introduction: AI Is No Longer Optional</h3><p>A few years ago, adding AI to an Android app felt like an advanced, “nice-to-have” feature.</p><p>Today, it’s becoming a <strong>core user expectation</strong>.</p><p>From chat assistants to smart recommendations, AI is quietly powering the apps users spend the most time on. The real question is no longer <em>“Should I use AI?”</em> — it’s:</p><blockquote>“How do I integrate AI in a clean, scalable, production-ready way?”</blockquote><p>In this blog, I’ll walk you through a <strong>real-world Android use case</strong>, explain <strong>how AI fits into your architecture</strong>, and show <strong>practical implementation strategies</strong> you can actually use in production.</p><h3>🧩 Real-World Scenario: Smart Chat Support in an App</h3><p>Let’s take a realistic example:</p><h4>🛒 Problem</h4><p>You’re building an <strong>e-commerce Android app</strong>, and users often:</p><ul><li>Ask repetitive questions</li><li>Struggle to find products</li><li>Need quick assistance</li></ul><h4>💡 Solution</h4><p>Integrate an <strong>AI-powered chat assistant</strong> that can:</p><ul><li>Answer FAQs instantly</li><li>Recommend products</li><li>Help users navigate the app</li></ul><h3>🏗️ Where AI Fits in Android Architecture</h3><p>If you’re already using <strong>MVVM</strong>, don’t break your structure. Instead, extend it cleanly.</p><h4>🔁 Updated Flow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*rR-_9aBipIYlHQdPeBiyZQ.png" /></figure><h4>📌 Key Idea:</h4><blockquote>Treat AI just like a <strong>data source</strong>, not a special case.</blockquote><h3><strong>⚙️ Approach 1: Using AI APIs (Recommended for Most Apps)</strong></h3><p>This is the <strong>fastest and most scalable approach</strong>.</p><h4>🔹 How it works:</h4><ol><li>User enters a query</li><li>App sends it to an AI API</li><li>API returns a response</li><li>UI displays it</li></ol><h4><strong>🧠 Example Flow</strong></h4><h4><strong>1. ViewModel</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c55293819e3e1f94d4d42ce8bf748f5/href">https://medium.com/media/9c55293819e3e1f94d4d42ce8bf748f5/href</a></iframe><h4>2. Repository</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5b41ec24b01b40709b321b8965f0baf/href">https://medium.com/media/e5b41ec24b01b40709b321b8965f0baf/href</a></iframe><h4>3. API Layer</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b44fe57f7ab39ff392481d4cb9d6b319/href">https://medium.com/media/b44fe57f7ab39ff392481d4cb9d6b319/href</a></iframe><h4>📌 Pro Tip:</h4><ul><li>Keep AI logic <strong>outside ViewModel</strong></li><li>Always go through <strong>Repository layer</strong></li><li>Makes testing and scaling easier</li></ul><h3><strong>⚡ Approach 2: On-Device AI (Offline Capabilities)</strong></h3><p>If your app needs:</p><ul><li>Offline functionality</li><li>Faster responses</li><li>Privacy-first features</li></ul><p>You can use <strong>on-device ML models</strong>.</p><h4>🔹 Use cases:</h4><ul><li>Text recognition (e.g. recognize bills images and fetch amount)</li><li>Image classification (e.g auto categorize the bunch of images in specific categories)</li><li>Language translation (e.g. translate language based on user preferences)</li></ul><h4>🧠 Example Use Case:</h4><p>Scan product labels using camera → detect text → suggest search results</p><h4>📦 Tools You Can Use:</h4><ul><li>ML Kit</li><li>TensorFlow Lite</li></ul><h3>🎯 Best Practices (From Real Projects)</h3><h4>✅ 1. Don’t Overuse AI</h4><p>Adding AI everywhere will:</p><ul><li>Slow down your app</li><li>Increase cost</li><li>Confuse users</li></ul><p>👉 Use it only where it adds <strong>real value</strong></p><h4>✅ 2. Handle Errors Gracefully</h4><p>AI APIs can fail or give unexpected results.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6f6a7ea610c26af6d2a2406edec2725e/href">https://medium.com/media/6f6a7ea610c26af6d2a2406edec2725e/href</a></iframe><h4>✅ 3. Add Loading States</h4><p>AI responses are not instant.</p><p>👉 Always show:</p><ul><li>Typing indicator</li><li>Skeleton UI</li></ul><h4>✅ 4. Cache Responses</h4><p>Avoid repeated API calls for same queries.</p><h4>✅ 5. Secure Your API Keys</h4><p>Never expose keys in:</p><ul><li>APK</li><li>Client-side code</li></ul><p>👉 Use backend proxy if needed</p><h3>📊 When Should You Use AI in Android Apps?</h3><p><strong>Use AI when:</strong></p><p>✔ Users need <strong>assistance or guidance</strong><br>✔ There’s <strong>repetitive manual work</strong><br>✔ You want <strong>personalization</strong><br>✔ You can improve <strong>decision-making</strong></p><p><strong>Avoid AI when:</strong></p><p>❌ Simple logic can solve the problem<br>❌ Latency is critical<br>❌ Cost outweighs benefit</p><h3>🔥 Advanced Ideas You Can Build</h3><ul><li>Smart search (AI-powered filtering)</li><li>Voice assistant inside app</li><li>Personalized home screen</li><li>Auto-reply systems</li><li>Image-based product search</li></ul><h3>🏁 Conclusion</h3><p>AI in Android is not about adding complexity — it’s about adding <strong>intelligence where it matters</strong>.</p><p>If done right:</p><ul><li>Your app feels smarter</li><li>Users stay longer</li><li>Engagement increases</li></ul><blockquote>Start small. Solve one real problem. Then scale.</blockquote><h3>✨ Final Thought</h3><blockquote>“The best AI feature is the one users don’t notice — but can’t live without.”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90cf4f7a64c1" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/how-to-integrate-ai-in-android-apps-real-world-practical-guide-90cf4f7a64c1">🤖 How to Integrate AI in Android Apps (Real-World, Practical Guide)</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Common Mistakes Developers Make in MVVM (And How to Fix Them)]]></title>
            <link>https://medium.com/@parthm7396/common-mistakes-developers-make-in-mvvm-and-how-to-fix-them-5b3774ee74ee?source=rss-5469e53e147a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b3774ee74ee</guid>
            <category><![CDATA[viewmodel]]></category>
            <category><![CDATA[repository-pattern]]></category>
            <category><![CDATA[android-mvvm]]></category>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[mvvm]]></category>
            <dc:creator><![CDATA[Parth Munjpara]]></dc:creator>
            <pubDate>Sat, 25 Apr 2026 12:05:58 GMT</pubDate>
            <atom:updated>2026-04-25T12:05:58.584Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hMizRlXnkgB-tYe2XHEPpg.png" /></figure><p>After 8+ years of building Android apps, reviewing codebases, and mentoring developers…<br>I’ve realized one thing:</p><blockquote>Most developers “use” MVVM — but very few implement it correctly.</blockquote><h3>🎯 Why This Matters</h3><p>MVVM is not just about separating files.</p><p>It’s about:</p><ul><li>Scalability 📈</li><li>Testability 🧪</li><li>Maintainability 🛠️</li></ul><p>But when implemented incorrectly, it actually creates <strong>more complexity than it solves</strong>.</p><h3>⚠️ Mistake #1: The “God ViewModel”</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*5Fb6ETXMQFUkwy6otpvV2w.gif" /></figure><p>👀 <strong>What it looks like:</strong></p><ul><li>800–1500 lines ViewModel</li><li>API calls inside ViewModel</li><li>Business logic + UI logic mixed together</li></ul><p>📉 <strong>Why it’s a problem:</strong></p><ul><li>Hard to test</li><li>Hard to scale</li><li>Difficult for new devs to understand</li></ul><p>✅ <strong>Fix: Introduce a Domain Layer</strong></p><p>Your ViewModel should only <strong>coordinate</strong>, not execute everything.</p><p>👉 <strong>Proper flow:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*14rrtm0n_OdxubgPGk7-Og.png" /></figure><p>💡 <strong>Pro Tip:</strong><br> If your ViewModel has logic that can be reused elsewhere → it belongs in a <strong>UseCase</strong>.</p><h3>⚠️ Mistake #2: Direct API Calls in ViewModel</h3><p>👀 <strong>What it looks like:</strong></p><pre>val users = apiService.getUsers()</pre><p>📉 <strong>Why it’s a problem:</strong></p><ul><li>Tight coupling with network layer</li><li>Difficult to mock in tests</li><li>Breaks abstraction</li></ul><p>✅ <strong>Fix: Use Repository Pattern</strong></p><pre>interface UserRepository {<br>    suspend fun getUsers(): List&lt;User&gt;<br>}</pre><p>✔ ViewModel talks to Repository<br>✔ Repository decides data source (API / DB)</p><p>💡 <strong>Pro Tip:</strong><br> Think of Repository as a <strong>data manager</strong>, not just a wrapper.</p><h3>⚠️ Mistake #3: Exposing Raw API Models to UI</h3><p>👀 <strong>What it looks like:</strong></p><ul><li>Passing API response directly to UI</li></ul><p>📉 <strong>Why it’s a problem:</strong></p><ul><li>UI tightly coupled with backend</li><li>Small API change = UI break</li></ul><p>✅ <strong>Fix: Use UI State Models :</strong></p><p>Use <strong>sealed classes</strong> or state holders:</p><pre>sealed class UiState {<br>    object Loading : UiState()<br>    data class Success(val data: List&lt;User&gt;) : UiState()<br>    data class Error(val message: String) : UiState()<br>}</pre><p>💡 <strong>Pro Tip:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*ehT_fqBT-NpnDCkLgtC6zQ.png" /></figure><p>Always design your UI to handle: <strong>Loading, Success &amp; Error</strong></p><p>Anything else is incomplete UX.</p><blockquote>“A well-structured MVVM screen always moves between these 3 predictable states”</blockquote><h3>⚠️ Mistake #4: Poor State Management</h3><p>👀 <strong>What it looks like:</strong></p><ul><li>Multiple LiveData / StateFlow variables</li><li>UI observing 5–6 different streams</li></ul><p>📉 <strong>Why it’s a problem:</strong></p><ul><li>Hard to track UI state</li><li>Bug-prone</li></ul><p><strong>✅ Fix: Single Source of Truth:</strong></p><p>Instead of:</p><pre>val loading = LiveData&lt;Boolean&gt;()<br>val users = LiveData&lt;List&lt;User&gt;&gt;()<br>val error = LiveData&lt;String&gt;()</pre><p>👉 Use:</p><pre>val uiState = StateFlow&lt;UiState&gt;</pre><p>💡 <strong>Pro Tip:</strong></p><blockquote>One screen = One state object</blockquote><h3>⚠️ Mistake #5: Ignoring Lifecycle Awareness</h3><p>👀 <strong>What it looks like:</strong></p><ul><li>Using wrong coroutine scope</li><li>Memory leaks</li><li>Crashes on rotation</li></ul><p><strong>✅ Fix: Use Lifecycle-aware scopes</strong></p><p>✔ viewModelScope<br> ✔ lifecycleScope</p><p>💡 <strong>Pro Tip:</strong><br> Never launch long-running work without lifecycle awareness.</p><h3>🏗️ Recommended MVVM + Clean Architecture Structure</h3><p>Here’s the structure I follow in production apps:</p><p><strong>📦 Presentation Layer</strong></p><ul><li>UI (Jetpack Compose / XML)</li><li>ViewModel</li><li>UI State</li></ul><p><strong>📦 Domain Layer</strong></p><ul><li>UseCases</li><li>Business logic</li></ul><p><strong>📦 Data Layer</strong></p><ul><li>Repository</li><li>API (Retrofit)</li><li>Local DB (Room)</li></ul><h3>🔥 Real Impact (From Experience)</h3><p>After applying this structure:</p><p>✅ Faster debugging<br>✅ Easier onboarding of new developers<br>✅ Better scalability<br>✅ Cleaner code reviews</p><h3>🧠 Final Thought</h3><blockquote><strong>MVVM </strong>is not about folders and classes.<br>It’s about <strong>responsibility separation</strong>.</blockquote><p>If your ViewModel is doing everything…<br>👉 You’re not using MVVM. You’re just organizing chaos.</p><h3>📩 Want to Learn This Practically?</h3><p>I’m mentoring developers to:</p><ul><li>Build real-world Android apps</li><li>Implement MVVM + Clean Architecture properly</li><li>Become job-ready</li></ul><p>👉 If you’re interested, connect with me on <a href="https://www.linkedin.com/in/parth-munjpara/">LinkedIn</a> or DM me <strong>“MVVM”</strong></p><h3>🚀 Bonus: What You Should Do Next</h3><ul><li>Refactor one existing project using this structure</li><li>Replace multiple LiveData with a single UI state</li><li>Introduce UseCases step by step</li></ul><blockquote><strong><em>“Good architecture doesn’t make your app work — it makes your app </em>work well at scale<em>.”</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b3774ee74ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android Development Got Simpler When I Started Using Kotlin Flow]]></title>
            <link>https://medium.com/@parthm7396/android-development-got-simpler-when-i-started-using-kotlin-flow-af6fd8e8a844?source=rss-5469e53e147a------2</link>
            <guid isPermaLink="false">https://medium.com/p/af6fd8e8a844</guid>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[kotlin-flow]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[mobile-development]]></category>
            <dc:creator><![CDATA[Parth Munjpara]]></dc:creator>
            <pubDate>Thu, 16 Apr 2026 18:01:49 GMT</pubDate>
            <atom:updated>2026-04-16T18:16:47.673Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NFez73ReyEiXvjUVGGM8pw.png" /></figure><p>Early in my Android development journey, I relied heavily on callbacks.<br>They were simple, direct, and got the job done.</p><p>As my apps became more complex, I transitioned to RxJava and RxKotlin.<br>It was a big upgrade — more powerful, more reactive, and far more scalable.</p><p>But over time, I started noticing something:</p><blockquote>Even with all that power, my code wasn’t getting simpler.</blockquote><h3>The Real Problem Wasn’t the Tools</h3><p>Callbacks worked… until they didn’t.</p><p>RxKotlin solved many problems… but introduced its own complexity.</p><p>And the more features I built — real-time updates, search, multiple API calls — the more I realized:</p><blockquote>The problem wasn’t async code.<br>It was how I was <strong>managing data over time</strong>.</blockquote><h3>A Problem Every Android Developer Has Faced</h3><p>Let’s take a simple example: <strong>search</strong>.</p><p>User types fast → multiple API calls → results return out of order.</p><p>Result?</p><p>Old data overrides new UI.<br>Inconsistent results.<br>Frustrating bugs.</p><h3>How I Solved It Before With Callbacks (Early Days 😅)</h3><pre>var latestQuery: String? = null <br>fun search(query: String) { <br>  latestQuery = query api.search(query) { result -&gt; <br>    if (query == latestQuery) { <br>      updateUI(result) <br>    } <br>  } <br>}</pre><p>It worked.</p><p>But:</p><ul><li><em>manual state tracking</em></li><li><em>easy to break</em></li><li><em>hard to scale</em></li></ul><h3>With RxKotlin (Better, But Heavier)</h3><pre>searchQueryObservable <br>  .debounce(300, TimeUnit.MILLISECONDS) <br>  .distinctUntilChanged() <br>  .switchMap { query -&gt; api.search(query).toObservable() } <br>  .observeOn(AndroidSchedulers.mainThread()) <br>  .subscribe(::updateUI)</pre><p>This is already much better than callbacks — and I used this pattern a lot in production.</p><p>But compared to what came next, it still felt more <em>mechanical</em> than <em>natural</em>.</p><h3>Then I Tried Kotlin Flow</h3><p>Same problem.<br>Much simpler solution.</p><pre>searchQuery <br>  .debounce(300) <br>  .distinctUntilChanged() <br>  .flatMapLatest { query -&gt; <br>    searchApi(query) <br>  }</pre><p>That’s it.</p><p>No disposables.<br>No manual cancellation.<br>No race condition.</p><h3>The Shift That Changed Everything</h3><p>Before Flow, I used to think:</p><blockquote><em>“Call this function and handle the result”</em></blockquote><p>With Rx:</p><blockquote><em>“Build a reactive chain and manage it”</em></blockquote><p>With Flow:</p><blockquote><em>“Describe how data should behave over time”</em></blockquote><p>That shift changed how I design apps.</p><h3>Why Flow Felt Better (In Real Projects)</h3><h4>1. 🧠 Simpler Mental Model</h4><p>Rx gives you everything.<br>Flow gives you what you actually need.</p><ul><li>fewer operators</li><li>less confusion</li><li>easier onboarding for teams</li></ul><h4>2. 🧵 Coroutines Make It Natural</h4><p>RxKotlin:</p><pre>.subscribeOn(Schedulers.io())<br>.observeOn(AndroidSchedulers.mainThread())</pre><p>Flow:</p><pre>.flowOn(Dispatchers.IO)</pre><p>And collection happens in your coroutine scope.<br>Cleaner and easier to reason about.</p><h4>3. ❌ No Disposable Headaches</h4><p>With Rx:</p><ul><li>you manage disposables</li><li>you worry about leaks</li></ul><p>With Flow:</p><ul><li>cancellation is handled by coroutines</li></ul><p>Less boilerplate. Less risk.</p><h4>4. 🔄 Cancellation Just Works</h4><p>flatMapLatest cancels previous requests automatically.</p><p>This solves one of the most common bugs in Android:</p><blockquote><em>outdated data updating the UI</em></blockquote><h4>5. 📖 Code That Reads Like Intent</h4><pre>searchQuery<br>    .debounce(300)<br>    .distinctUntilChanged()<br>    .flatMapLatest { searchApi(it) }</pre><p>Even someone new to your codebase can understand this quickly.</p><p>That’s a huge win.</p><h3>Cold Flows = Predictable Execution</h3><p>One subtle but powerful concept:</p><blockquote><em>Flow doesn’t run until you collect it.</em></blockquote><pre>val flow = flow {<br>    println(&quot;Started&quot;)<br>    emit(1)<br>}</pre><p>Nothing happens… until:</p><pre>flow.collect()</pre><p>This gives:</p><ul><li>control</li><li>no hidden execution</li><li>predictable behavior</li></ul><h3>Where Flow Made the Biggest Impact</h3><p>After switching, I started using Flow for:</p><h4>📱 UI State</h4><p>Using StateFlow for clean, reactive state</p><h4>🔄 Data Streams</h4><p>Combining API, database, and user input</p><h4>⚡ Real-time Features</h4><p>Search, filters, live updates</p><h3>StateFlow vs SharedFlow (My Simple Rule)</h3><ul><li><strong>StateFlow</strong> → UI state</li><li><strong>SharedFlow</strong> → events</li></ul><p>That’s it. No overthinking.</p><h3>What Actually Got Simpler</h3><p>Flow didn’t remove complexity. It <strong>organized it properly</strong>.</p><p>Instead of:</p><ul><li>scattered logic</li><li>manual fixes</li><li>defensive coding</li></ul><p>Now:</p><ul><li>one clear pipeline</li><li>predictable transformations</li><li>easier debugging</li></ul><h3>Final Thought</h3><p>Callbacks taught me control.<br>RxKotlin taught me reactive thinking.<br>Flow gave me <strong>clarity</strong>.</p><p>And in real-world apps, clarity is what matters most.</p><p>Because Android development is not just about making things work.</p><p>It’s about making them <strong>easy to understand, scale, and maintain</strong>.</p><blockquote><strong>Everything gets simpler when your data starts flowing.</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af6fd8e8a844" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>