<?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 Vikas Bharti on Medium]]></title>
        <description><![CDATA[Stories by Vikas Bharti on Medium]]></description>
        <link>https://medium.com/@awesomeAndroid?source=rss-5a9f2819b916------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*e3LLYEZWspubXWLuceiTxA.jpeg</url>
            <title>Stories by Vikas Bharti on Medium</title>
            <link>https://medium.com/@awesomeAndroid?source=rss-5a9f2819b916------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 22:16:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@awesomeAndroid/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[ How Thinking Like a PM Helped Me Cut VAPT Cycles in Half (with Cursor)]]></title>
            <link>https://medium.com/@awesomeAndroid/how-thinking-like-a-pm-helped-me-cut-vapt-cycles-in-half-with-cursor-dc84a7ab1a6f?source=rss-5a9f2819b916------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc84a7ab1a6f</guid>
            <dc:creator><![CDATA[Vikas Bharti]]></dc:creator>
            <pubDate>Sun, 14 Sep 2025 07:03:52 GMT</pubDate>
            <atom:updated>2025-09-14T07:12:32.136Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6arxQiaI3XkoVpU4zw95Tw.png" /></figure><h3>The Pain of VAPT Cycles</h3><p>If you’ve ever worked on a large codebase, you know this pain:<br> ✔ Fix one module → break another<br> ✔ Ship build → get security feedback → rework → repeat</p><p>In the <em>best case</em>, it takes two iterations.<br>In the <em>worst case</em>… QA teams lose sleep.</p><p>For developers and PMs alike, this isn’t just a tech problem — it’s a <strong>timeline killer, morale buster, and trust eroder</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A-0HFBI9KjDpH3ylExZwRQ.png" /><figcaption>Traditional Vapt flow</figcaption></figure><h3>Building on My Previous Work</h3><p>A couple of weeks ago, I shared how I use <a href="https://medium.com/awesomeandroid/how-to-use-coderabbit-in-cursor-for-vibe-checked-ai-code-reviews-a-beginner-friendly-guide-94edd1a734ac"><strong>Cursor + Coderabbit</strong></a> for AI-powered code reviews to catch issues early (read that here 👉 <a href="https://medium.com/awesomeandroid/how-to-use-coderabbit-in-cursor-for-vibe-checked-ai-code-reviews-a-beginner-friendly-guide-94edd1a734ac">link</a>).<br> That was all about preventing bugs before they happen.</p><p>This time, I wanted to see if I could speed up <em>security remediation</em> — by integrating Cursor not just as a reviewer, but as an active part of the delivery process.</p><p>Spoiler alert: <em>it worked better than expected.</em></p><h3>🔎 The Challenge</h3><p>We were preparing for VAPT and had two high-severity issues flagged:</p><ol><li><strong>Root Detection Bypass</strong></li><li><strong>SSL Pinning Bypass</strong></li></ol><p>Normally, this is how it plays out:</p><ol><li>Ship build #1 → security finds gaps</li><li>Patch → ship build #2 → more gaps</li><li>Repeat until clean</li></ol><p>At least two builds. Sometimes three. Definitely stressful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*6O4hQJfctBCF3yJi8WPKZQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*LAmg6YXEohGp3tToy18KEQ.jpeg" /><figcaption>📸 sample vapt issues</figcaption></figure><p>When I asked my team how they normally solve this, the answer was familiar: patch → submit → repeat until clean.</p><h3>💡 The Experiment with Cursor</h3><p>Instead of repeating the cycle, I demoed something different with Cursor.</p><p>I gave it this structured instruction (simplified version below):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*u83H29U8OikfTWdkGI1oDA.png" /><figcaption>📸 <em>simplified prompt</em></figcaption></figure><p>Cursor didn’t just give vague advice — it produced a structured remediation workflow. Here’s a high-level view of the steps it took (this is just an overview; each step was detailed with context-specific actions and code references — all with only one prompt):</p><p>✔ <strong>Executive Summary:</strong> A short description of the issues and their impact<br> ✔ <strong>Root Cause Analysis:</strong> File paths, line numbers, and exact causes<br> ✔ <strong>Remediation Plan:</strong> Clear steps on what to change and why<br> ✔ <strong>Patch Creation:</strong> Unified diff files ready to apply<br> ✔ <strong>Test Case Suggestions:</strong> New or updated tests to prevent regressions<br> ✔ <strong>Verification Commands:</strong> Instructions on how to test the fixes locally<br> ✔ <strong>Regression Risk Notes:</strong> Possible side effects and how to test them<br> ✔ <strong>Dependency Management:</strong> Recommended updates or version pinning<br> ✔ <strong>Git Workflow:</strong> Suggested branch names, commit messages, and PR templates<br> ✔ <strong>Follow-up Actions:</strong> Recommended next steps for monitoring and retesting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xB6WGxpqgnuXPuENHDP48A.png" /><figcaption>📸 <em>screenshot of Cursor’s diff/patch suggestion view</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mt2nDiPVzc9T-hk95ihCAw.png" /><figcaption>📸 <em>screenshot of Cursor’s diff/patch suggestion view</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DJZuXwOWnXqpT2vKtvk_qw.png" /><figcaption>📸 <em>screenshot of Cursor’s diff/patch suggestion view</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EgYw4dtUkbBicS0PrixSlg.png" /><figcaption>📸 <em>screenshot of Cursor’s diff/patch suggestion view</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8_kr-cTICJuAIXufmED9nA.png" /><figcaption>📸 <em>screenshot of Cursor’s diff/patch suggestion view</em></figcaption></figure><p>The result? Instead of 2 builds, we shipped <strong>one clean build that passed VAPT on the first go.</strong> 🚀</p><h3>✋ Wait, What Prompt Did You Use?</h3><p>At this point, you might be wondering:<br> <em>“Okay, but what was the exact prompt that got Cursor to deliver production-ready fixes?”</em></p><p>I’ve already shared the <strong>core workflow</strong> here — how I framed the problem, structured the input, and how Cursor responded. That’s enough for many PMs and developers to start experimenting right away.</p><p>If you’d like the <strong>full detailed breakdown of the exact prompts I use in practice</strong>, DM me on <strong>LinkedIn</strong>. I’m happy to share the working version I rely on with those who are serious about trying it out.</p><p>📌 Stay tuned — I’ll be sharing more case studies like this on <a href="https://medium.com/awesomeandroid"><strong>Medium</strong></a> and <a href="https://www.linkedin.com/in/bhartivikas/"><strong>LinkedIn</strong></a>.</p><h3>🎯 Why This Matters</h3><p>This experiment showed me something powerful:<br><strong>When developers think like PMs, they don’t just fix code — they ship better products.</strong></p><p>Tools like Cursor turn into more than just autocomplete engines:<br> ⚡ Validate ideas faster<br> ⚡ Cut endless feedback loops<br> ⚡ Bridge the business ↔ engineering gap seamlessly</p><p>Cursor isn’t just for developers — it’s a <strong>PM’s superpower</strong>.</p><h3>👏 Before You Go</h3><p>If this story resonated with you, tap <strong>Clap 👏</strong> — it helps other devs and PMs discover it too.</p><p>👉 Follow me here on <a href="https://medium.com/awesomeandroid"><strong>Medium</strong></a> for practical workflows and hands-on guides you can apply in your next sprint.<br> 👉 Connect with me on <a href="https://www.linkedin.com/in/bhartivikas/"><strong>LinkedIn</strong></a> if you want to dive deeper — I often share behind-the-scenes prompts, playbooks, and real-world cases there.</p><p>If this helped you or your team, pass it on to someone working on app security or product delivery — it might save them a build (or two). 🙌</p><p>Thank you for reading and being part of this journey. Until next time — <strong>happy coding, and safer shipping 🚀</strong></p><p><a href="https://medium.com/awesomeandroid"><strong>Follow on Medium</strong></a><strong> | </strong><a href="https://www.linkedin.com/in/bhartivikas/"><strong>Connect on LinkedIn</strong></a><strong> | </strong><a href="https://medium.com/awesomeandroid/how-i-built-a-netflix-style-resume-in-minutes-using-chatgpt-cursor-db289a1fb74a"><strong>Read more articles</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc84a7ab1a6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Building AI for AgriTech: The Inside Story]]></title>
            <link>https://medium.com/awesomeandroid/building-ai-for-agritech-the-inside-story-9f0888ffb872?source=rss-5a9f2819b916------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f0888ffb872</guid>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[predictive-maintenance]]></category>
            <category><![CDATA[agritech]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[Vikas Bharti]]></dc:creator>
            <pubDate>Sun, 07 Sep 2025 09:11:37 GMT</pubDate>
            <atom:updated>2025-09-07T09:11:37.451Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GAzhKUgPDMZGLHar9ZR5YA.png" /></figure><h3>🌱 Introduction</h3><p>In 2022, I chose to join Carnot Technologies (A Mahindra &amp; Mahindra Group Company) — not because it was the safest option, but because it was the most meaningful. Carnot wasn’t just another company chasing growth; it was solving real problems in Indian agriculture.</p><p>Pushkar Limaye’s vision resonated with me: building technology that doesn’t just live in boardrooms but impacts lives in the fields, villages, and everyday realities of farmers.</p><p>This is the inside story of building AI for AgriTech — the challenges, solutions, and impact.</p><h3>🌾 The Problem: Fragmented Agriculture &amp; Limited Tech Adoption</h3><p>Agriculture in India is massive but fragmented:</p><ul><li>Millions of farmers operate on small landholdings.</li><li>They face unpredictable weather, rising input costs, and limited access to credit.</li><li>Tractors and farm equipment are often underutilized.</li><li>Service providers lack transparency, and trust in digital solutions is low.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bl2F7KTG0V6DNLMbbGgiNg.png" /></figure><p>Carnot had already laid a strong foundation with <strong>SimhaKit</strong>, an IoT device connecting tractors and farm equipment to the cloud. But the next frontier was clear:</p><p>👉 How do we leverage AI to make these devices not just data recorders, but decision enablers?</p><h3>🔍 The Challenge: Making AI Relevant for Farmers</h3><p>AI in agriculture isn’t about futuristic robots or fancy dashboards. It’s about solving simple but high-impact problems:</p><ul><li>Can a farmer know if his tractor is being misused or underutilized?</li><li>Can we detect fuel theft or anomalies early?</li><li>Can we recommend the right time for servicing to avoid breakdowns?</li><li>Can we provide personalized advisory instead of generic tips?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RjN0g1l7ZIV61QF3vHSDZw.png" /></figure><p>The real challenge: make AI trustworthy, usable, and value-adding in a farmer’s daily life.</p><h3>⚙️ The Solution: Layering AI on IoT Data</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5QnSuDALYMTrZ55nSJuIaw.png" /></figure><p>With thousands of SimhaKit devices in tractors, we had a goldmine of telemetry:</p><ul><li>GPS &amp; location trails</li><li>Fuel levels</li><li>Engine performance</li><li>Hours of operation</li><li>Error codes</li></ul><p>Our approach:</p><ul><li><strong>Data Cleaning &amp; Validation</strong> — handling noisy, patchy, rural connectivity.</li><li><strong>Anomaly Detection Models</strong> — spotting theft, idling, misuse, or sudden efficiency drops.</li><li><strong>Predictive Maintenance</strong> — predicting service needs to reduce downtime.</li><li><strong>Personalized Advisory</strong> — delivering localized insights based on actual usage.</li></ul><p>💡 The secret wasn’t just building ML models. It was integrating insights into apps farmers already used (<strong>Mera Swaraj, myOja, mPragati, Krish-e Smart Kit</strong>) so they saw <strong>actions, not raw data</strong>.</p><h3>🚔 Real-World Proof: Recovering a Stolen Tractor</h3><p>We help farmers resolve a wide range of issues every day — fuel savings, service predictions, misuse detection. But one particular incident showed the <strong>real power of what we do</strong>.</p><p>👉 A farmer’s <strong>brand-new tractor was stolen before it even got an RTO registration number.</strong> Normally, this would mean a devastating financial loss.</p><p>But because it had our <strong>telematics kit</strong> installed, the farmer tracked it in real time. Police traced the location and recovered the tractor within hours.</p><p>This story was even covered in local newspapers — where the farmer himself credited GPS tracking for saving his tractor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*JG0kMR0GjrkRbZ9lhawbVw.jpeg" /></figure><p>For us, this was proof that what we build doesn’t just save fuel or optimize usage — it <strong>protects livelihoods in critical moments</strong>.</p><h3>👨‍🌾 The Human Element: Building Trust</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9siiWhOrz1AxWhDPZYgLEw.png" /></figure><p>AI alone doesn’t guarantee adoption. Farmers trust <strong>people first, then technology</strong>. Which meant we had to:</p><ul><li>Design experiences in <strong>local languages and icons</strong>.</li><li>Show <strong>tangible ROI</strong>: “this saved you ₹500 in fuel last week.”</li><li>Work with Mahindra’s dealer ecosystem to ensure alerts translated into <strong>real-world service and support</strong>.</li></ul><p>The formula became clear: <strong>Technology + Trust + Distribution.</strong></p><h3>📈 The Business Impact</h3><p>Over time, AI became a <strong>strategic differentiator</strong> for Carnot:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zWHFWaoDVCbHe6x_RmcZdQ.png" /></figure><ul><li>🤝 <strong>OEM Partnerships</strong> — Mahindra &amp; Swaraj tractors positioned IoT as a <strong>value-driven offering</strong>.</li><li>🏬 <strong>Dealer Engagement</strong> — better prediction of service demand, upselling opportunities, stronger farmer relationships.</li><li>🌾 <strong>Farmer Retention</strong> — once farmers saw value, churn dropped significantly.</li><li>💰 <strong>New Revenue Streams</strong> — subscription models, premium insights, insurance and financing integrations.</li></ul><h3>🚀 My Journey: Why This Matters</h3><p>Before Carnot, I had built products that scaled revenue and growth. But I wanted to create something with <strong>lasting impact</strong>.</p><p>Working with Pushkar and the Carnot team has been a <strong>masterclass in blending deep tech with grassroots reality</strong>.</p><p>Every new feature we launch is tested not just on staging servers but in <strong>fields across India</strong>.</p><p>When a farmer tells us:</p><ul><li><em>“Your app saved me a trip to the field.”</em></li><li><em>“I caught fuel theft because of your alert.”</em></li><li><em>Or when a stolen tractor is recovered thanks to our GPS…”</em></li></ul><p>👉 That’s when all the hard work feels truly worth it.</p><h3>🌍 The Road Ahead</h3><p>We’re only at the beginning. The road ahead includes:</p><ul><li><strong>AI-powered credit scoring</strong> based on tractor usage.</li><li><strong>Market linkage models</strong> connecting farmers directly to buyers.</li><li><strong>Sustainability insights</strong> helping farmers cut emissions and save fuel.</li></ul><p>The vision is simple yet ambitious: <strong>AI as a trusted farm assistant in every farmer’s journey.</strong></p><h3>✅ Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gzjx1BUWBst1vqcRtraQlw.png" /></figure><p>Building AI for AgriTech isn’t about hype. It’s about humility. It’s about <strong>listening to farmers, solving their problems, and scaling solutions responsibly</strong>.</p><p>For me, joining Carnot was not just a career move — it was a commitment to building <strong>technology that matters</strong>.</p><p>This story is just the beginning. In my next articles, I’ll dive deeper into how <strong>AI-powered credit scoring</strong> and <strong>data analytics</strong> are becoming pillars of our work in AgriTech.</p><p>👉 Stay tuned for the next chapter in this series.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f0888ffb872" width="1" height="1" alt=""><hr><p><a href="https://medium.com/awesomeandroid/building-ai-for-agritech-the-inside-story-9f0888ffb872">🚜 Building AI for AgriTech: The Inside Story</a> was originally published in <a href="https://medium.com/awesomeandroid">Awesome Android</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ How I Built a Netflix-Style Resume in Minutes Using ChatGPT + Cursor]]></title>
            <link>https://medium.com/awesomeandroid/how-i-built-a-netflix-style-resume-in-minutes-using-chatgpt-cursor-db289a1fb74a?source=rss-5a9f2819b916------2</link>
            <guid isPermaLink="false">https://medium.com/p/db289a1fb74a</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[career-development]]></category>
            <category><![CDATA[webdesign-and-development]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Vikas Bharti]]></dc:creator>
            <pubDate>Sun, 31 Aug 2025 13:56:15 GMT</pubDate>
            <atom:updated>2025-08-31T13:56:15.572Z</atom:updated>
            <content:encoded><![CDATA[<p>A few days ago, I set out to do something simple but fun — create a <strong>Netflix-inspired resume</strong>.</p><p>I thought it would take hours of fiddling with design tools, tweaking CSS, and writing code. Instead, it took me just a few minutes.</p><p>The secret? 👉 I stopped treating ChatGPT like a coding assistant and started using it like a <strong>product manager’s co-pilot</strong>.</p><p>✨ Check it out live here: <a href="https://android-guru-vikas.github.io/cv-flix/">My Netflix Resume</a></p><h3>🧠 The Mindset Shift That Changed Everything</h3><p>For a long time, I approached ChatGPT like a developer:</p><ul><li>🧑‍💻 Asking it for code snippets</li><li>🐛 Debugging step by step</li><li>📚 Treating it like a stackoverflow replacement</li></ul><p>This worked… but it wasn’t magical.</p><p>Then, I switched hats 🎩. Instead of giving raw technical instructions, I started thinking like a <strong>product manager</strong>:</p><ul><li>📌 Breaking down my goal into smaller milestones</li><li>📖 Giving clear context at every step</li><li>✅ Reviewing outputs and nudging in the right direction</li></ul><p>That shift changed the <strong>speed ⚡, the quality 💎, and even the fun 🎉 of building</strong>. Suddenly, ChatGPT wasn’t just writing code — it was <strong>delivering projects</strong>.</p><h3>🚀 The Process: From Idea → Resume in Minutes</h3><p>Here’s how it unfolded:</p><ol><li>🎥 <strong>Vision:</strong> I wanted my resume to look like Netflix. A playful, creative twist that stands out.</li><li>🎨 <strong>Direction:</strong> I asked ChatGPT to design a web layout inspired by Netflix’s UI.</li><li>🗂️ <strong>Breakdown:</strong> Together, we split the project into milestones → layout → styling → responsiveness → deployment.</li><li>🤖 <strong>Execution:</strong> Cursor (my AI coding environment) + ChatGPT handled the heavy lifting. I just gave inputs and reviewed outputs.</li><li>🍿 <strong>Delivery:</strong> In less time than it takes to watch an episode, my Netflix-style resume was live.</li></ol><p>And the best part? I didn’t need to dive deep into the weeds of front-end frameworks or CSS hacks.</p><h3>💻 Snippets From the Build</h3><p>Here are a few examples of what Cursor generated, step by step 👇</p><h3>1️⃣ The Netflix-Style Grid Layout</h3><pre>&lt;div class=&quot;resume-section&quot;&gt;<br>  &lt;h2&gt;Featured Roles&lt;/h2&gt;<br>  &lt;div class=&quot;card-grid&quot;&gt;<br>    &lt;div class=&quot;card&quot;&gt;<br>      &lt;img src=&quot;company-logo.png&quot; alt=&quot;Company Logo&quot; /&gt;<br>      &lt;h3&gt;Product Manager&lt;/h3&gt;<br>      &lt;p&gt;Carnot Technologies&lt;/p&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;card&quot;&gt;<br>      &lt;img src=&quot;company-logo2.png&quot; alt=&quot;Company Logo&quot; /&gt;<br>      &lt;h3&gt;Engineering Manager&lt;/h3&gt;<br>      &lt;p&gt;DigiSense&lt;/p&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><h3>2️⃣ The CSS Styling That Made It “Netflix-like”</h3><pre>.card-grid {<br>  display: grid;<br>  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));<br>  gap: 1rem;<br>}<br>.card {<br>  background-color: #141414;<br>  color: #fff;<br>  border-radius: 12px;<br>  overflow: hidden;<br>  transition: transform 0.3s ease-in-out;<br>}<br>.card:hover {<br>  transform: scale(1.08);<br>}</pre><h3>3️⃣ The Hero Banner With a Call to Action</h3><pre>&lt;header class=&quot;hero-banner&quot;&gt;<br>  &lt;h1&gt;Vikas Bharti&lt;/h1&gt;<br>  &lt;p&gt;Engineering Manager • Product Builder • AI Explorer&lt;/p&gt;<br>  &lt;button class=&quot;cta-btn&quot;&gt;View Resume&lt;/button&gt;<br>&lt;/header&gt;</pre><h3>🎯 Why This Matters</h3><p>This isn’t just about building a fancy resume — it’s about <strong>how we work with AI</strong>.</p><ul><li>👶 If you treat AI like a junior developer, it will act like one.</li><li>🤝 If you treat AI like a collaborator, giving it structure, clarity, and checkpoints, it can execute like a whole team.</li></ul><p>The “resume experiment” was small. But scale this approach to <strong>real-world projects</strong>, and the impact is huge:<br> ⚡ Faster delivery<br> 💡 Higher quality<br> 🎨 More creative output</p><h3>🔑 My Key Takeaways</h3><ol><li>🧠 <strong>Mindset matters more than tech skills.</strong> The way you frame tasks determines the outcome.</li><li>🗂️ <strong>Break big goals into small steps.</strong> AI thrives on structure.</li><li>👩‍✈️ <strong>Be the product manager.</strong> Direct, review, refine.</li><li>⚡ <strong>Speed + Creativity = Leverage.</strong> What used to take days now takes minutes.</li></ol><h3>🔮 What’s Next</h3><p>I’ll be sharing more about this and other experiments where I use AI as a <strong>builder’s partner</strong> — not just for code, but for product design, content, and workflows.</p><p>So if you’re curious about how AI can help you <strong>work smarter, not harder</strong>, stay tuned.</p><h3>✨ Over to You</h3><p>Most devs still overcomplicate MVPs. The ones who adopt <strong>AI-first workflows</strong> will ship faster 🚀, validate quicker ✅, and win bigger 🏆.</p><p>👉 How are you using AI today? Are you treating it like a <strong>developer</strong>, or like a <strong>co-pilot</strong>? The difference might be the unlock you’re looking for 🔑.</p><h3>🤝 Let’s Connect</h3><p>And if you want to stay connected and engage more with my work, feel free to connect with me on LinkedIn:</p><p>👉 <a href="https://www.linkedin.com/in/vikas-bharti/"><strong>Connect with Me on LinkedIn</strong></a></p><h3>👏 Share and Clap If This Article Helped You!</h3><p>If you found this story helpful and enjoyed the journey of building a Netflix-style resume with AI, share it with your fellow developers and give it a round of applause 👏👏👏.</p><p>Your support and feedback inspire me to continue sharing knowledge and insights in the ever-evolving world of <strong>AI + Product + Development</strong>.</p><p>Armed with this newfound wisdom, go forth and unlock the full potential of AI in your projects! 🚀👨‍💻✨</p><p>#AI #DeveloperTools #Productivity #Cursor #ChatGPT #Resume #AIworkflow</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db289a1fb74a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/awesomeandroid/how-i-built-a-netflix-style-resume-in-minutes-using-chatgpt-cursor-db289a1fb74a">🎬 How I Built a Netflix-Style Resume in Minutes Using ChatGPT + Cursor</a> was originally published in <a href="https://medium.com/awesomeandroid">Awesome Android</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 Use CodeRabbit in Cursor for “Vibe-Checked” AI Code Reviews: A Beginner-Friendly Guide]]></title>
            <link>https://medium.com/awesomeandroid/how-to-use-coderabbit-in-cursor-for-vibe-checked-ai-code-reviews-a-beginner-friendly-guide-94edd1a734ac?source=rss-5a9f2819b916------2</link>
            <guid isPermaLink="false">https://medium.com/p/94edd1a734ac</guid>
            <dc:creator><![CDATA[Vikas Bharti]]></dc:creator>
            <pubDate>Sat, 09 Aug 2025 13:11:30 GMT</pubDate>
            <atom:updated>2025-08-09T13:11:30.937Z</atom:updated>
            <content:encoded><![CDATA[<p>Code reviews can be stressful and time-consuming — but with <strong>CodeRabbit</strong> in <strong>Cursor</strong> (an AI-powered fork of VS Code), you can supercharge your workflow with instant “vibe checks” for code style, logic, bugs, and even security. This article will teach you how to set up CodeRabbit, get the most from its live reviews, integrate with git, and solve common issues — <em>with step-by-step illustrated guides and clear code formatting throughout</em>.</p><h3>Table of Contents</h3><ul><li>What is CodeRabbit and Cursor?</li><li>Step-by-Step Setup: Extension, Enabling, and Git Init</li><li>How to Trigger and Use AI-Powered Vibe Checks</li><li>Using Git Integration for Automated Reviews</li><li>Customizing Review Criteria in Cursor (.cursorrules)</li><li>Troubleshooting Common Issues</li><li>Code and Review Formatting Examples</li></ul><h3>What are CodeRabbit and Cursor?</h3><ul><li><strong>Cursor</strong> is a next-generation code editor, built atop VS Code and powered by AI, enabling enhanced developer productivity.</li><li><strong>CodeRabbit</strong> is an AI agent/extension for code review — offering automated feedback on your code’s style, logic, bugs, and best practices, directly inside Cursor.</li></ul><h3>Step-by-Step Setup</h3><h3>1. Installing CodeRabbit in Cursor</h3><ul><li>Open <strong>Cursor</strong>.</li><li>Go to the <strong>Extensions</strong> panel and search for “CodeRabbit”.</li><li>Click <strong>Install</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fjkKtv5nkE-wmbK7VLuG1Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JE8tYibbo5Snc8zvaGIZDg.png" /><figcaption>Image: Cursor IDE interface showing CodeRabbit in the installed extensions list.</figcaption></figure><p>2. Enabling CodeRabbit and Initializing Git</p><ul><li>Make sure CodeRabbit is <strong>Enabled</strong> in the extensions panel.</li><li>To enable git, open a project folder in Cursor and run:ba</li></ul><pre>git init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hxmTFKIXRJ4zGeBhBvFcxQ.png" /><figcaption>Image: Cursor UI with a terminal running git init.</figcaption></figure><p>This prepares your project for version control and lets CodeRabbit track and review changes against your git history.</p><p>Live Workflow: Triggering, Reviewing, and Iterating</p><h3>1. Vibe Checks on Code Changes</h3><ul><li>As you save, commit, or push code, CodeRabbit automatically analyzes your work.</li><li>Feedback appears in the <strong>CodeRabbit Panel</strong> or as inline comments within your editor.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VYFcK0NpcWVtJobhq1FkVg.png" /><figcaption>Image: CodeRabbit side panel in Cursor, displaying style, logic, and bug review comments.</figcaption></figure><h3>2. Incorporating Feedback</h3><ul><li>Click on flagged issues to see explanations, suggestions, or code snippets.</li><li>You can apply suggested fixes directly, or have CodeRabbit refactor problematic code with one click.</li></ul><h3>Example Workflow: Reviewing with Git</h3><ul><li>Make code changes.</li><li>Run git commit -m &quot;My update&quot; or click the <strong>Commit</strong> button.</li><li>CodeRabbit reviews the staged code before the commit completes.</li></ul><h3>Showcasing Feedback: Code and Comments</h3><p>CodeRabbit’s suggestions appear as <em>formatted blocks</em> in Cursor and your commits.</p><pre>function add(a: number, b: number): number {<br>  // Adds two numbers and returns the result<br>  return a + b;<br>}</pre><p><strong>CodeRabbit Review Example:</strong></p><pre>Good job! Function correctly adds two numbers.  <br>Consider adding input validation to handle non-number cases.</pre><h3>Feature Highlights</h3><ul><li><strong>Vibe Check Coverage:</strong> Style, logical errors, potential bugs, security flaws.</li><li><strong>Git Integration:</strong> Pre-review on commit and push — catch bugs <em>before</em> team reviews.</li><li><strong>Customization:</strong> Tailor reviews with .cursorrules for your project’s code standards.</li></ul><h3>Customizing Reviews: .cursorrules Example</h3><p>Place a .cursorrules file in your project root:</p><pre>{<br>  &quot;requireExplicitReturnTypes&quot;: true,<br>  &quot;maxFunctionLength&quot;: 30,<br>  &quot;disallowAny&quot;: true<br>}</pre><p>CodeRabbit will now tailor its reviews according to these criteria — <em>no more one-size-fits-all comments!</em></p><p><em>Image: Example </em><em>.cursorrules config file in Cursor, customizing review rules.</em></p><h3>Troubleshooting: Common Issues &amp; Solutions</h3><ul><li><strong>Git Branch Not Visible?</strong><br>Make sure you initialized git with git init and have made at least one commit.</li><li><strong>Extension Not Activating?</strong><br>Restart Cursor. Check Extension panel for activation status; reinstall CodeRabbit if needed.</li><li><strong>No Review Triggered?</strong><br>Confirm you saved the file, and that CodeRabbit is enabled.</li></ul><h3>Jargon Explained (Quick Glossary)</h3><ul><li><strong>Vibe Check:</strong> An informal review for style, logic, and “overall feel.”</li><li><strong>Commit/Push:</strong> Recording changes to your code (commit = local; push = remote/GitHub).</li><li><strong>IDE:</strong> Integrated Development Environment — a code editor with developer tools.</li><li><strong>Cursor:</strong> VS Code fork, optimized for AI-powered workflows.</li></ul><h3>Actionable Advice</h3><ul><li><strong>Get immediate feedback:</strong> Learn from AI suggestions while coding, not after.</li><li><strong>Customize your reviews:</strong> Use .cursorrules so comments align with your team/project.</li><li><strong>Verify before sharing:</strong> Run a CodeRabbit review before every push to catch mistakes early.</li><li><strong>Start small:</strong> Let CodeRabbit review simple changes, then scale up to bigger features as you grow comfortable.</li></ul><p>By adding CodeRabbit to your Cursor IDE, you get real-time, actionable, and beginner-friendly code reviews that you can customize to your exact needs — making your workflow more productive, collaborative, and stress-free. Try these steps today and let AI help you write safer, cleaner code!</p><p>If you found this guide valuable, don’t forget to explore more insights and tutorials on my Medium channel. Your feedback and questions are always welcome, fostering a community of continuous learning. Let’s connect, share experiences, and delve deeper into the world of Android app development.</p><p>👏 If you enjoyed this article, show your support with a round of applause. Your claps fuel the motivation to bring you more quality content. Let’s grow together! 🚀</p><p>Follow my Medium channel for regular updates, tutorials, and deep dives into the evolving landscape of mobile development. Your reachability and engagement make this community vibrant and enriching.</p><p>Thank you for being part of this journey. Until next time, happy coding!</p><p><a href="https://medium.com/@awesomeAndroid">Follow me on Medium</a> | <a href="https://medium.com/awesomeandroid/unlocking-the-power-of-heatmaps-in-android-apps-a-step-by-step-guide-4b68690f2f4a">Read more articles</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94edd1a734ac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/awesomeandroid/how-to-use-coderabbit-in-cursor-for-vibe-checked-ai-code-reviews-a-beginner-friendly-guide-94edd1a734ac">How to Use CodeRabbit in Cursor for “Vibe-Checked” AI Code Reviews: A Beginner-Friendly Guide</a> was originally published in <a href="https://medium.com/awesomeandroid">Awesome Android</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 Use CodeRabbit in Cursor for “Vibe-Checked” AI Code Reviews: A Beginner-Friendly Guide]]></title>
            <link>https://medium.com/@awesomeAndroid/how-to-use-coderabbit-in-cursor-for-vibe-checked-ai-code-reviews-a-beginner-friendly-guide-3be2d0146c70?source=rss-5a9f2819b916------2</link>
            <guid isPermaLink="false">https://medium.com/p/3be2d0146c70</guid>
            <dc:creator><![CDATA[Vikas Bharti]]></dc:creator>
            <pubDate>Sat, 09 Aug 2025 13:05:50 GMT</pubDate>
            <atom:updated>2025-08-09T13:05:50.474Z</atom:updated>
            <content:encoded><![CDATA[<p>Code reviews can be stressful and time-consuming — but with <strong>CodeRabbit</strong> in <strong>Cursor</strong> (an AI-powered fork of VS Code), you can supercharge your workflow with instant “vibe checks” for code style, logic, bugs, and even security. This article will teach you how to set up CodeRabbit, get the most from its live reviews, integrate with git, and solve common issues — <em>with step-by-step illustrated guides and clear code formatting throughout</em>.</p><h3>Table of Contents</h3><ul><li>What is CodeRabbit and Cursor?</li><li>Step-by-Step Setup: Extension, Enabling, and Git Init</li><li>How to Trigger and Use AI-Powered Vibe Checks</li><li>Using Git Integration for Automated Reviews</li><li>Customizing Review Criteria in Cursor (.cursorrules)</li><li>Troubleshooting Common Issues</li><li>Code and Review Formatting Examples</li></ul><h3>What are CodeRabbit and Cursor?</h3><ul><li><strong>Cursor</strong> is a next-generation code editor, built atop VS Code and powered by AI, enabling enhanced developer productivity.</li><li><strong>CodeRabbit</strong> is an AI agent/extension for code review — offering automated feedback on your code’s style, logic, bugs, and best practices, directly inside Cursor.</li></ul><h3>Step-by-Step Setup</h3><h3>1. Installing CodeRabbit in Cursor</h3><ul><li>Open <strong>Cursor</strong>.</li><li>Go to the <strong>Extensions</strong> panel and search for “CodeRabbit”.</li><li>Click <strong>Install</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fjkKtv5nkE-wmbK7VLuG1Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JE8tYibbo5Snc8zvaGIZDg.png" /><figcaption><em>Image: Cursor IDE interface showing CodeRabbit in the installed extensions list.</em></figcaption></figure><p>2. Enabling CodeRabbit and Initializing Git</p><ul><li>Make sure CodeRabbit is <strong>Enabled</strong> in the extensions panel.</li><li>To enable git, open a project folder in Cursor and run:ba</li></ul><pre>git init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hxmTFKIXRJ4zGeBhBvFcxQ.png" /><figcaption><em>Image: Cursor UI with a terminal running </em><em>git init.</em></figcaption></figure><p>This prepares your project for version control and lets CodeRabbit track and review changes against your git history.</p><p>Live Workflow: Triggering, Reviewing, and Iterating</p><h3>1. Vibe Checks on Code Changes</h3><ul><li>As you save, commit, or push code, CodeRabbit automatically analyzes your work.</li><li>Feedback appears in the <strong>CodeRabbit Panel</strong> or as inline comments within your editor.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VYFcK0NpcWVtJobhq1FkVg.png" /><figcaption><em>Image: CodeRabbit side panel in Cursor, displaying style, logic, and bug review comments.</em></figcaption></figure><h3>2. Incorporating Feedback</h3><ul><li>Click on flagged issues to see explanations, suggestions, or code snippets.</li><li>You can apply suggested fixes directly, or have CodeRabbit refactor problematic code with one click.</li></ul><h3>Example Workflow: Reviewing with Git</h3><ul><li>Make code changes.</li><li>Run git commit -m &quot;My update&quot; or click the <strong>Commit</strong> button.</li><li>CodeRabbit reviews the staged code before the commit completes.</li></ul><h3>Showcasing Feedback: Code and Comments</h3><p>CodeRabbit’s suggestions appear as <em>formatted blocks</em> in Cursor and your commits.</p><pre>function add(a: number, b: number): number {<br>  // Adds two numbers and returns the result<br>  return a + b;<br>}</pre><p><strong>CodeRabbit Review Example:</strong></p><pre>Good job! Function correctly adds two numbers.  <br>Consider adding input validation to handle non-number cases.</pre><h3>Feature Highlights</h3><ul><li><strong>Vibe Check Coverage:</strong> Style, logical errors, potential bugs, security flaws.</li><li><strong>Git Integration:</strong> Pre-review on commit and push — catch bugs <em>before</em> team reviews.</li><li><strong>Customization:</strong> Tailor reviews with .cursorrules for your project’s code standards.</li></ul><h3>Customizing Reviews: .cursorrules Example</h3><p>Place a .cursorrules file in your project root:</p><pre>{<br>  &quot;requireExplicitReturnTypes&quot;: true,<br>  &quot;maxFunctionLength&quot;: 30,<br>  &quot;disallowAny&quot;: true<br>}</pre><p>CodeRabbit will now tailor its reviews according to these criteria — <em>no more one-size-fits-all comments!</em></p><p><em>Image: Example </em><em>.cursorrules config file in Cursor, customizing review rules.</em></p><h3>Troubleshooting: Common Issues &amp; Solutions</h3><ul><li><strong>Git Branch Not Visible?</strong><br> Make sure you initialized git with git init and have made at least one commit.</li><li><strong>Extension Not Activating?</strong><br> Restart Cursor. Check Extension panel for activation status; reinstall CodeRabbit if needed.</li><li><strong>No Review Triggered?</strong><br> Confirm you saved the file, and that CodeRabbit is enabled.</li></ul><h3>Jargon Explained (Quick Glossary)</h3><ul><li><strong>Vibe Check:</strong> An informal review for style, logic, and “overall feel.”</li><li><strong>Commit/Push:</strong> Recording changes to your code (commit = local; push = remote/GitHub).</li><li><strong>IDE:</strong> Integrated Development Environment — a code editor with developer tools.</li><li><strong>Cursor:</strong> VS Code fork, optimized for AI-powered workflows.</li></ul><h3>Actionable Advice</h3><ul><li><strong>Get immediate feedback:</strong> Learn from AI suggestions while coding, not after.</li><li><strong>Customize your reviews:</strong> Use .cursorrules so comments align with your team/project.</li><li><strong>Verify before sharing:</strong> Run a CodeRabbit review before every push to catch mistakes early.</li><li><strong>Start small:</strong> Let CodeRabbit review simple changes, then scale up to bigger features as you grow comfortable.</li></ul><p>By adding CodeRabbit to your Cursor IDE, you get real-time, actionable, and beginner-friendly code reviews that you can customize to your exact needs — making your workflow more productive, collaborative, and stress-free. Try these steps today and let AI help you write safer, cleaner code!</p><p>If you found this guide valuable, don’t forget to explore more insights and tutorials on my Medium channel. Your feedback and questions are always welcome, fostering a community of continuous learning. Let’s connect, share experiences, and delve deeper into the world of Android app development.</p><p>👏 If you enjoyed this article, show your support with a round of applause. Your claps fuel the motivation to bring you more quality content. Let’s grow together! 🚀</p><p>Follow my Medium channel for regular updates, tutorials, and deep dives into the evolving landscape of mobile development. Your reachability and engagement make this community vibrant and enriching.</p><p>Thank you for being part of this journey. Until next time, happy coding!</p><p><a href="https://medium.com/@awesomeAndroid">Follow me on Medium</a> | <a href="https://medium.com/awesomeandroid/unlocking-the-power-of-heatmaps-in-android-apps-a-step-by-step-guide-4b68690f2f4a">Read more articles</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3be2d0146c70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhancing Android Bottom NavigationView with Custom Disabled Items]]></title>
            <link>https://medium.com/awesomeandroid/enhancing-android-bottom-navigationview-with-custom-disabled-items-a819dbdbb6e4?source=rss-5a9f2819b916------2</link>
            <guid isPermaLink="false">https://medium.com/p/a819dbdbb6e4</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[bottomnavigationview]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[bottom-navigation]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Vikas Bharti]]></dc:creator>
            <pubDate>Tue, 12 Dec 2023 13:50:38 GMT</pubDate>
            <atom:updated>2023-12-12T13:50:38.486Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In the dynamic landscape of Android app development, user interface plays a pivotal role in shaping the overall user experience. The BottomNavigationView has become a staple for navigation in Android applications, providing a sleek and intuitive way for users to switch between different sections of an app.</p><p>However, as developers, we often encounter scenarios where certain navigation options need to be temporarily disabled. The default appearance of disabled items might not always align with the app’s design language, and this is where customisation becomes crucial. In this article, we’ll delve into the process of enhancing the Android BottomNavigationView by creating a visually distinct and customisable representation for disabled items.</p><p>We will cover everything from setting up a new Android project to designing a custom layout for disabled items and integrating it seamlessly into the BottomNavigationView. By the end of this journey, you&#39;ll not only have a well-rounded understanding of the implementation process but also gain insights into the significance of UI customisation in delivering a polished and user-friendly app.</p><p>So, let’s embark on this exploration of elevating the user experience through thoughtful customisation of the BottomNavigationView.</p><h3>Setting Up the Project</h3><ol><li>Create a New Android Project</li></ol><ul><li>Use Android Studio to create a new project.</li></ul><pre>&lt;!-- app/build.gradle --&gt;<br>android {<br>    // ... other configurations<br>    defaultConfig {<br>        // ... other configurations<br>        vectorDrawables.useSupportLibrary = true<br>    }<br>}</pre><ol><li>Implementing BottomNavigationView</li></ol><ul><li>Add the BottomNavigationView widget to the layout.</li><li>Create menu items in the XML file for the navigation items.</li></ul><pre>&lt;!-- res/layout/activity_main.xml --&gt;<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;RelativeLayout<br>    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;<br>    tools:context=&quot;.MainActivity&quot;&gt;<br><br>    &lt;!-- Your other layout components --&gt;<br><br>    &lt;com.google.android.material.bottomnavigation.BottomNavigationView<br>        android:id=&quot;@+id/bottom_navigation&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_alignParentBottom=&quot;true&quot;<br>        app:menu=&quot;@menu/bottom_navigation_menu&quot;/&gt;<br>&lt;/RelativeLayout&gt;ode</pre><pre>&lt;!-- res/menu/bottom_navigation_menu.xml --&gt;<br>&lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;<br>    &lt;item<br>        android:id=&quot;@+id/menu_item1&quot;<br>        android:title=&quot;Item 1&quot;<br>        android:icon=&quot;@drawable/ic_item1&quot; /&gt;<br><br>    &lt;!-- Add other menu items here --&gt;<br><br>    &lt;item<br>        android:id=&quot;@+id/menu_item_id_to_disable&quot;<br>        android:title=&quot;Disabled Item&quot;<br>        android:icon=&quot;@drawable/ic_disabled_item&quot; /&gt;<br>&lt;/menu&gt;</pre><p>These snippets set up the foundation of our Android project and introduce the BottomNavigationView along with its menu items. In the next sections, we&#39;ll explore how to make a menu item disabled and create a custom layout for it.</p><h3>Making a Menu Item Disabled</h3><ol><li>Find the Menu Item</li></ol><ul><li>Use the findItem() method to get a reference to the desired menu item.</li></ul><pre>// MainActivity.java<br>import android.os.Bundle;<br>import androidx.annotation.NonNull;<br>import com.google.android.material.bottomnavigation.BottomNavigationView;<br>import androidx.appcompat.app.AppCompatActivity;<br>import android.view.Menu;<br>import android.view.MenuItem;<br><br>public class MainActivity extends AppCompatActivity {<br>@Override<br>    protected void onCreate(Bundle savedInstanceState) {<br>        super.onCreate(savedInstanceState);<br>        setContentView(R.layout.activity_main);<br>        BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_navigation);<br>        Menu menu = bottomNavigationView.getMenu();<br>        // Disable a specific menu item by ID<br>        MenuItem menuItem = menu.findItem(R.id.menu_item_id_to_disable);<br>        menuItem.setEnabled(false);<br>    }<br>}</pre><p>These code snippets demonstrate how to find a specific menu item by its ID and disable it. The next sections will cover creating a custom layout for the disabled item and integrating it into the BottomNavigationView.</p><h3>Creating a Custom Layout for Disabled Item</h3><ol><li>Design a Custom Layout</li></ol><ul><li>Create a new XML layout file for the disabled item (e.g., layout_disabled_item.xml).</li><li>Use a TextView with a drawable on top for customisation.</li></ul><pre>&lt;!-- res/layout/layout_disabled_item.xml --&gt;<br>&lt;TextView<br>    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    android:layout_width=&quot;wrap_content&quot;<br>    android:layout_height=&quot;wrap_content&quot;<br>    android:text=&quot;Disabled Item&quot;<br>    android:drawableTop=&quot;@drawable/ic_disabled_item&quot;<br>    android:gravity=&quot;center&quot;<br>    style=&quot;@style/DisabledBottomNavigationItem&quot; /&gt;</pre><ol><li>Define Styles for Disabled Bottom Navigation Items</li></ol><ul><li>Create a style in the styles.xml file to customize the appearance of disabled items.</li></ul><pre>&lt;!-- res/values/styles.xml --&gt;<br>&lt;style name=&quot;DisabledBottomNavigationItem&quot;&gt;<br>    &lt;!-- Customize the style properties for disabled items --&gt;<br>    &lt;item name=&quot;android:textColor&quot;&gt;@color/disabledTextColor&lt;/item&gt;<br>    &lt;item name=&quot;android:background&quot;&gt;@drawable/disabledBackground&lt;/item&gt;<br>    &lt;!-- Add other style properties as needed --&gt;<br>&lt;/style&gt;</pre><p>These code snippets illustrate the process of creating a custom layout for the disabled item, incorporating a TextView with a drawable on top, and defining styles to customize the appearance. The next sections will cover how to integrate this custom layout with the disabled item in the BottomNavigationView.</p><h3>Integrating Custom Layout with Disabled Item</h3><ol><li>Set Custom Layout for Disabled Item</li></ol><ul><li>Use setActionView() to set the custom layout for the disabled item.</li></ul><pre>// MainActivity.java<br>import android.os.Bundle;<br>import androidx.annotation.NonNull;<br>import com.google.android.material.bottomnavigation.BottomNavigationView;<br>import androidx.appcompat.app.AppCompatActivity;<br>import android.view.Menu;<br>import android.view.MenuItem;<br><br>public class MainActivity extends AppCompatActivity {<br>    @Override<br>    protected void onCreate(Bundle savedInstanceState) {<br>        super.onCreate(savedInstanceState);<br>        setContentView(R.layout.activity_main);<br>        BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_navigation);<br>        Menu menu = bottomNavigationView.getMenu();<br>        // Disable a specific menu item by ID<br>        MenuItem menuItem = menu.findItem(R.id.menu_item_id_to_disable);<br>        menuItem.setEnabled(false);<br>        // Set a custom layout for the disabled item<br>        menuItem.setActionView(R.layout.layout_disabled_item);<br>    }<br>}</pre><ol><li>Define Styles for Disabled Bottom Navigation Items</li></ol><ul><li>Customize text color, background, and other style properties.</li></ul><pre>&lt;!-- res/values/styles.xml --&gt;<br>&lt;style name=&quot;DisabledBottomNavigationItem&quot;&gt;<br>    &lt;!-- Customize the style properties for disabled items --&gt;<br>    &lt;item name=&quot;android:textColor&quot;&gt;@color/disabledTextColor&lt;/item&gt;<br>    &lt;item name=&quot;android:background&quot;&gt;@drawable/disabledBackground&lt;/item&gt;<br>    &lt;!-- Add other style properties as needed --&gt;<br>&lt;/style&gt;</pre><p>These code snippets illustrate the process of setting a custom layout for the disabled item using setActionView() and defining styles for disabled bottom navigation items.</p><p>Run you code….and you’ll get the desired results!</p><h3>Final Thoughts: Elevate Your App’s Navigation Experience!</h3><p>Congratulations on successfully enhancing your Android app’s navigation with a customized BottomNavigationView! By now, you&#39;ve not only mastered the art of making navigation more intuitive but also added a touch of uniqueness to your app&#39;s design.</p><p>If you found this guide valuable, don’t forget to explore more insights and tutorials on my Medium channel. Your feedback and questions are always welcome, fostering a community of continuous learning. Let’s connect, share experiences, and delve deeper into the world of Android app development.</p><p>👏 If you enjoyed this article, show your support with a round of applause. Your claps fuel the motivation to bring you more quality content. Let’s grow together! 🚀</p><p>Follow my Medium channel for regular updates, tutorials, and deep dives into the evolving landscape of mobile development. Your reachability and engagement make this community vibrant and enriching.</p><p>Thank you for being part of this journey. Until next time, happy coding!</p><p><a href="https://medium.com/@awesomeAndroid">Follow me on Medium</a> | <a href="https://medium.com/awesomeandroid/unlocking-the-power-of-heatmaps-in-android-apps-a-step-by-step-guide-4b68690f2f4a">Read more articles</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a819dbdbb6e4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/awesomeandroid/enhancing-android-bottom-navigationview-with-custom-disabled-items-a819dbdbb6e4">Enhancing Android Bottom NavigationView with Custom Disabled Items</a> was originally published in <a href="https://medium.com/awesomeandroid">Awesome Android</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring the Exciting Changes in Android 14: Google IO 2023 Highlights]]></title>
            <link>https://medium.com/awesomeandroid/exploring-the-exciting-changes-in-android-14-google-io-2023-highlights-8c4e334175cc?source=rss-5a9f2819b916------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c4e334175cc</guid>
            <dc:creator><![CDATA[Vikas Bharti]]></dc:creator>
            <pubDate>Wed, 26 Jul 2023 06:02:04 GMT</pubDate>
            <atom:updated>2023-07-26T06:02:04.714Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*ALckT3DsKpd7NzEY1K7YSQ.png" /></figure><h3><strong>Introduction</strong></h3><p>The tech world has been eagerly awaiting the annual Google I/O conference, and this year, the event didn’t disappoint. Among the many exciting announcements, one of the most anticipated was the unveiling of Android 14. Packed with new features, enhancements, and optimizations, Android 14 promises to deliver an even more seamless and innovative mobile experience. In this article, we’ll dive deep into the key changes that arrived with Android 14, as presented at Google I/O 2023.</p><h4><strong>Material NEXT: A Redesigned UI Paradigm</strong></h4><p>Android 14 introduces “Material NEXT,” a complete revamp of the Material Design language. Building on the principles of Material Design, Material NEXT brings a fresh look and feel to the Android user interface. It incorporates enhanced animations, smoother transitions, and a more intuitive navigation system. The UI adapts better to different screen sizes and resolutions, offering a consistent experience across all devices.</p><h4>Enhanced Privacy and Security Features</h4><p>With Android 14, Google has placed a strong emphasis on user privacy and security. The new version comes with enhanced permissions management, giving users more control over their data. Apps now require explicit permission to access sensitive information, such as location, camera, and microphone.</p><p>Moreover, Android 14 introduces a new “Privacy Dashboard” that provides users with an overview of how apps are accessing their data. This feature empowers users to understand and manage app permissions more effectively. Additionally, the OS includes strengthened security measures to protect against potential security breaches and vulnerabilities.</p><h4>AI-Driven Features</h4><p>Artificial Intelligence plays a central role in Android 14, enhancing various aspects of the user experience. The OS integrates AI capabilities into the camera app, enabling smart scene recognition and improved photo enhancements. The gallery app uses AI to organize photos intelligently and create meaningful albums automatically.</p><p>Additionally, Android 14 introduces a new AI-powered personal assistant, “DroidAssist.” DroidAssist leverages machine learning to better understand user preferences and provides more relevant and accurate suggestions, reminders, and contextual information.</p><h4>Seamless Cross-Platform Integration</h4><p>Android 14 aims to improve the integration between Android devices and other platforms. Users can now answer and make calls directly from their Android tablets and laptops when connected to the same Google account. Messages and notifications sync seamlessly across devices, allowing users to pick up conversations and tasks from where they left off.</p><p>Furthermore, Google has introduced “Nearby Sharing” for cross-platform file sharing, enabling Android users to share files effortlessly with other devices, including iPhones and Windows PCs.</p><h4>Performance and Battery Optimizations</h4><p>Performance improvements are always a significant part of Android updates, and Android 14 is no exception. The new version is designed to deliver smoother animations, faster app launch times, and overall better responsiveness. Google’s focus on optimizing power usage also results in improved battery life, ensuring devices can last longer on a single charge.</p><h4>Foldable Devices Support</h4><p>With the increasing popularity of foldable devices, Android 14 brings enhanced support for this emerging form factor. The OS is now better optimized to work seamlessly with foldable displays, enabling developers to create innovative apps that take advantage of these unique screen configurations.</p><h4>5G and Network Enhancements</h4><p>Android 14 embraces the 5G era, providing developers with new APIs to leverage the power of 5G networks. This opens up opportunities for apps and services that require high-speed and low-latency connections. Additionally, Android 14 implements better network management to optimize data usage and prioritize network resources effectively.</p><h4>Conclusion</h4><p>Android 14, as unveiled during Google I/O 2023, ushers in a new era of mobile experiences with its redesigned UI, improved privacy features, AI-driven enhancements, seamless cross-platform integration, and optimized performance. With a strong focus on user privacy and security, Android 14 empowers users to take control of their data like never before. As the Android community eagerly awaits the official release, developers and users alike are excited about the future possibilities that this latest version of Android brings to the table.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c4e334175cc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/awesomeandroid/exploring-the-exciting-changes-in-android-14-google-io-2023-highlights-8c4e334175cc">Exploring the Exciting Changes in Android 14: Google IO 2023 Highlights</a> was originally published in <a href="https://medium.com/awesomeandroid">Awesome Android</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Power of Heatmaps in Android Apps: A Step-by-Step Guide]]></title>
            <link>https://medium.com/awesomeandroid/unlocking-the-power-of-heatmaps-in-android-apps-a-step-by-step-guide-4b68690f2f4a?source=rss-5a9f2819b916------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b68690f2f4a</guid>
            <dc:creator><![CDATA[Vikas Bharti]]></dc:creator>
            <pubDate>Tue, 25 Jul 2023 16:27:18 GMT</pubDate>
            <atom:updated>2023-07-25T16:27:18.844Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/230/1*pf2mp5tVjgAvO4ohBPddjA.png" /><figcaption><a href="https://github.com/android-guru-vikas/Google-HeatMap">image from my sample project</a></figcaption></figure><p>Have you ever found yourself needing to visualize large and complex datasets on a map within your Android app? If so, you’re in for a treat! In this comprehensive guide, we will delve into the captivating world of heatmaps and unveil the secrets of harnessing the Google Maps Android Heatmap Utility to create stunning, insightful, and interactive visualizations.</p><p><strong>What is a Heatmap? Unraveling the Beauty of Data Visualization</strong></p><p>Before we dive into the technicalities, let’s take a moment to appreciate the elegance of heatmaps. A heatmap is a compelling and intuitive data visualization technique that conveys data density on a map using color gradients. It allows us to identify patterns, hotspots, and trends based on the intensity of data points in a given area.</p><p><strong>Getting Started: Setting the Stage for Your Data Masterpiece</strong></p><p>The first step towards creating awe-inspiring heatmaps within your Android app is to ensure you have the Google Maps SDK for Android installed in your project. Fear not; the setup is straightforward, and once you have the foundation laid, we’ll move on to the real magic!</p><p><strong>Adding the Heatmap Utility: Unlocking the Google Maps Android Heatmap Utility</strong></p><p>The real secret sauce that will elevate your heatmap game is the Google Maps Android Heatmap Utility. This marvelous library is specifically designed to streamline the process of adding heatmaps to your map with utmost ease. To get started, you’ll need to include the following dependency in your app’s build.gradle file:</p><pre>dependencies {<br>    implementation &#39;com.google.maps.android:maps-utils:2.2.2&#39;<br>}</pre><p>With this simple addition, you’ll have unlocked a world of possibilities!</p><p><strong>Creating the Heatmap: Embrace the Art of Data Storytelling</strong></p><p>Let’s now embark on the journey of creating your very own captivating heatmap. Imagine you have a list of LatLng objects at your disposal, each representing a unique data point to be visualized. Fear not if this concept seems a bit abstract; we&#39;ll tie it all together in a moment!</p><pre>// Create a list of LatLng objects representing data points<br>val dataPoints = mutableListOf&lt;LatLng&gt;()<br>dataPoints.add(LatLng(37.7749, -122.4194)) // San Francisco<br>dataPoints.add(LatLng(34.0522, -118.2437)) // Los Angeles<br>// Add more data points as needed</pre><pre>// Create a HeatmapTileProvider<br>val provider = HeatmapTileProvider.Builder()<br>    .data(dataPoints)<br>    .build()<br>// Add the HeatmapTileProvider to the map<br>val heatmapOverlay = map.addTileOverlay(TileOverlayOptions().tileProvider(provider))</pre><p>Bravo! You’ve just breathed life into your data by visualizing it on the map with vibrant colors that speak volumes.</p><p><strong>Customizing the Heatmap: Unleash Your Creativity</strong></p><p>Like any true artist, you now have the freedom to tailor your masterpiece to perfection. The HeatmapTileProvider.Builder offers a wealth of options to customize your heatmap and make it truly your own.</p><pre>val provider = HeatmapTileProvider.Builder()<br>    .data(dataPoints)<br>    .radius(50) // Adjust the radius of each data point&#39;s influence on the heatmap<br>    .opacity(0.8) // Set the opacity of the heatmap (0.0 to 1.0)<br>    .gradient(Gradient(colors, startPoints)) // Customize the color gradient<br>    .build()</pre><p>Play around with the radius, opacity, and color gradients to find the perfect balance that complements your app’s design and leaves your users in awe.</p><p><a href="https://github.com/android-guru-vikas/Google-HeatMap">Check Out My Project</a>!</p><p>As a demonstration of the concepts covered in this article, I’ve created my very own Android app that leverages the Google Maps Android Heatmap Utility. You can find the complete source code and implementation details on my GitHub profile:</p><p><a href="https://github.com/android-guru-vikas/Google-HeatMap.git">Android Heatmap Project — GitHub Repository</a></p><p>Feel free to explore the code, contribute, or use it in your own projects. Let’s keep learning and building together! 🙌 #AndroidDev #GoogleMapsSDK #Heatmaps #DataVisualization #AppDevelopment</p><p><strong>For other useful tips on Google Maps API: An Aladdin’s Cave of Knowledge</strong></p><p>As an intrepid explorer in the realm of Android development, you might find yourself seeking even more gems of knowledge. Fear not; the benevolent sages at Google have prepared a treasure trove of wisdom for you. For in-depth information on obtaining a Google Maps API key and a plethora of valuable insights on using the Google Maps API in your Android app, venture forth and read the official Google Developer Blog post here:</p><p><a href="https://developers.googleblog.com/2023/01/how-to-get-google-maps-api-key.html">How to Get a Google Maps API Key — Google Developer Blog</a></p><p>And if you want to stay connected and engage more with my work, feel free to connect with me on LinkedIn:</p><p><a href="https://www.linkedin.com/in/bhartivikas/">Connect with Me on LinkedIn</a></p><p>Share and Clap If This Article Helped You!</p><p>If you found this guide helpful and enjoyed the journey of unlocking the power of heatmaps in your Android apps, I invite you to share it with your fellow developers and give it a round of applause by clapping 👏. Your support and feedback inspire me to continue sharing knowledge and insights in the ever-evolving world of Android development.</p><p>Armed with this newfound wisdom, go forth and unlock the full potential of heatmaps in your Android app! Happy mapping and happy coding! 🗺️📱 #AndroidDev #GoogleMapsSDK #Heatmaps #DataVisualization #AppDevelopment</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b68690f2f4a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/awesomeandroid/unlocking-the-power-of-heatmaps-in-android-apps-a-step-by-step-guide-4b68690f2f4a">Unlocking the Power of Heatmaps in Android Apps: A Step-by-Step Guide</a> was originally published in <a href="https://medium.com/awesomeandroid">Awesome Android</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Coil: A Powerful Image Loading Library for Android]]></title>
            <link>https://medium.com/@awesomeAndroid/exploring-coil-a-powerful-image-loading-library-for-android-a5d12d96e5f6?source=rss-5a9f2819b916------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5d12d96e5f6</guid>
            <category><![CDATA[image-loading-and-caching]]></category>
            <category><![CDATA[glide]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[image]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Vikas Bharti]]></dc:creator>
            <pubDate>Fri, 14 Jul 2023 05:24:52 GMT</pubDate>
            <atom:updated>2023-07-14T05:24:52.098Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*laDB5szDSZ-6cURjOEKYHQ.png" /></figure><p><strong>Introduction</strong> :</p><p>In the world of Android app development, displaying images efficiently is crucial for delivering a smooth and visually appealing user experience. Handling image loading, caching, and displaying can be challenging, but thankfully, there are libraries available to simplify the process. One such library is Coil, a lightweight and versatile image loading library for Android. In this article, we’ll explore the benefits of using Coil and provide a step-by-step guide on integrating it into your Android application.</p><p><strong>What is Coil?</strong></p><p>Coil is an open-source image loading library developed by Colin White, designed to make image loading on Android simple and efficient. It is built on Kotlin Coroutines and is known for its simplicity, small footprint, and excellent performance. Coil aims to provide a hassle-free way of loading, caching, and displaying images in Android applications, regardless of the data source.</p><p><strong>Key Features of Coil:</strong></p><ol><li>Lightweight and Fast: Coil is built to be lightweight and focused, resulting in faster image loading and improved overall performance.</li><li>Kotlin Coroutines Integration: Coil leverages Kotlin Coroutines for performing image requests asynchronously, ensuring smooth and responsive user interfaces.</li><li>Extensive Caching: Coil offers comprehensive caching capabilities, including both memory and disk caching. It automatically handles cache management, ensuring that images are efficiently stored and retrieved.</li><li>Image Request Prioritization: Coil allows you to prioritize image requests, ensuring that critical images are loaded first while maintaining a smooth user experience.</li><li>Customization Options: Coil provides various options for customization, such as transformations, which allow you to modify images before displaying them, and error handling, which allows you to handle image loading errors gracefully.</li></ol><p><strong>Integrating Coil into your Android Application:</strong></p><p><strong>Step 1:</strong> Add Coil Dependency To start using Coil, add the Coil dependency to your app-level build.gradle file:</p><pre>dependencies {<br>    implementation &#39;io.coil-kt:coil:1.4.0&#39;<br>}</pre><p><strong>Step 2:</strong> Load an Image To load an image using Coil, you need to provide an ImageView and the image URL or resource ID. Here’s an example:</p><pre>val imageView: ImageView = findViewById(R.id.imageView)<br>val imageUrl = &quot;https://example.com/image.jpg&quot;<br><br>imageView.load(imageUrl) {<br>    // Optional: Apply transformations if needed<br>    transformations(CircleCropTransformation())<br><br>    // Optional: Set placeholder and error drawable<br>    placeholder(R.drawable.placeholder)<br>    error(R.drawable.error)<br><br>    // Optional: Configure image loading behavior<br>    crossfade(true)<br>    size(300, 300)<br>}</pre><p><strong>Step 3:</strong></p><p>Advanced Usage Coil offers additional functionality for more advanced use cases. For example, you can load images from local storage, handle image loading callbacks, and apply custom transformations. Refer to Coil’s documentation for more information on these features.</p><p><strong>Conclusion:</strong></p><p>Thank you for reading! Join me on my Medium channel, <a href="https://medium.com/@awesomeAndroid">Awesome Android</a>, for more Android app development content. Don’t forget to clap if you found this article helpful. Let’s continue our Android journey together!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5d12d96e5f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Caching in Android using Retrofit & OkHttp]]></title>
            <link>https://medium.com/awesomeandroid/caching-in-android-using-retrofit-fdd134d3c205?source=rss-5a9f2819b916------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdd134d3c205</guid>
            <dc:creator><![CDATA[Vikas Bharti]]></dc:creator>
            <pubDate>Wed, 21 Dec 2022 13:11:24 GMT</pubDate>
            <atom:updated>2022-12-22T11:57:14.545Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*VJPxJlogQvPj5WmajjmyZQ.png" /><figcaption>image from shutterstock</figcaption></figure><p>In this article, we are going to learn how to cache HTTP responses in Android using OkHttp Interceptor and Retrofit for building offline-first Android apps.</p><p><strong>Caching</strong> is nothing but a way to store network fetched data on a device’s storage and access later when the device is offline or we want the same data again and again. Some image loading library like <a href="https://futurestud.io/tutorials/picasso-getting-started-simple-loading">Picasso</a> or <a href="https://futurestud.io/tutorials/glide-getting-started">Glide</a> provide this caching when loading and displaying images but retrofit does not use this by default for its requests.</p><p>Let’s understand how caching is going to help us in our Android applications.</p><ul><li>When we make a network call to fetch the data from the server.</li><li>For the very first time, it will get the data from the server and it will cache the HTTP response on the client.</li><li>Then, if we make the same API call again, it will return the data from the cache instantly.</li></ul><p>This way, our Android applications can do two very important things:</p><ul><li>Work even if there is no internet connection. This will helps us in <a href="https://medium.com/awesomeandroid/how-to-build-an-online-offline-application-on-native-android-f25d81729386">building the offline-first apps</a>.</li><li>Work faster as the response is cached locally.</li></ul><p>Now, let’s learn how to enable caching in OkHttp and Retrofit. Before that, we need to understand that Retrofit uses the OkHttp client for HTTP operations, which means that whatever we have to do to enable caching, we need to do with the OkHttp. We do not have to do anything extra for Retrofit as it will use our configured OkHttp client.</p><p>Things become easier when we already have the Cache-Control header enabled from the server, then OkHttp will respect that header and cache the response for a specific time that is being sent from the server.</p><p>But what if the Cache-Control is not enabled from the server? We can still cache the response from OkHttp Client using Interceptor. We will learn how.</p><p>For this, we need to implement Interceptor like below:</p><pre>class AppCacheInterceptor : Interceptor {<br>    override fun intercept(chain: Interceptor.Chain): Response {<br>        val response: Response = chain.proceed(chain.request())<br>        val cacheControl = CacheControl.Builder()<br>            .maxAge(1, TimeUnit.DAYS)<br>            .build()<br>        return response.newBuilder()<br>            .header(&quot;Cache-Control&quot;, cacheControl.toString())<br>            .build()<br>    }<br>}          </pre><p>Here, we created AppCacheInterceptor by implementing Interceptor and we have a CacheControl builder that is used to provide the header for the Cache-Control.</p><p>Then, we need to add this AppCacheInterceptor to the OkHttpClient using addNetworkInterceptor.</p><pre>val okHttpClient = OkHttpClient().newBuilder() <br>.addNetworkInterceptor(AppCacheInterceptor())<br>.build();</pre><p>After that, we can use this okHttpClient directly or with Retrofit.</p><p>But, there is a catch that we need to understand while building the offline-first app.</p><p>OkHttp is designed in such a way that it returns the cached response only when the Internet is available.</p><ul><li>It returns the data from the cache only when the Internet is available and the data is cached.</li><li>It returns with the error &quot;no internet available&quot; even when the data is cached and but the Internet is not available.</li></ul><p>How to solve this issue?</p><p>We can create a ForceAppCacheInterceptor in addition to the above one (AppCacheInterceptor, only if Cache-Control header is not enabled from the server).</p><pre>class ForceAppCacheInterceptor : Interceptor {<br>    override fun intercept(chain: Interceptor.Chain): Response {<br>        val builder: Request.Builder = chain.request().newBuilder()<br>        if (!IsInternetAvailable()) {<br>            builder.cacheControl(CacheControl.FORCE_CACHE);<br>        }<br>        return chain.proceed(builder.build());<br>    }<br>}</pre><p>Then, add the interceptor in OkHttpClient like below:</p><pre>val okHttpClient = OkHttpClient().newBuilder()<br>.addNetworkInterceptor(AppCacheInterceptor()) // only if Cache-Control header is not enabled from the server<br>.addInterceptor(ForceAppCacheInterceptor())<br>.build();</pre><p>Here, we need to notice that we are adding ForceAppCacheInterceptor to OkHttpClient using addInterceptor() and not addNetworkInterceptor().</p><ul><li>addInterceptor: used to add the interceptor at the application level.</li><li>addNetworkInterceptor: As the name says, used to add the interceptor at the network level.</li></ul><p>After that, we can use this okHttpClient directly or with Retrofit and it will work as expected.</p><p>This is how we can cache HTTP responses in Android using OkHttp Interceptor and Retrofit for building offline-first Android apps.</p><p>👏 Few claps if you found this article useful.<strong> </strong>That&#39;s it for now.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdd134d3c205" width="1" height="1" alt=""><hr><p><a href="https://medium.com/awesomeandroid/caching-in-android-using-retrofit-fdd134d3c205">Caching in Android using Retrofit &amp; OkHttp</a> was originally published in <a href="https://medium.com/awesomeandroid">Awesome Android</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>