<?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 Manish Singh on Medium]]></title>
        <description><![CDATA[Stories by Manish Singh on Medium]]></description>
        <link>https://medium.com/@marvel999?source=rss-7aaf76238f6d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*MOVpo0ztWUPZCTAZ8YUHfw.jpeg</url>
            <title>Stories by Manish Singh on Medium</title>
            <link>https://medium.com/@marvel999?source=rss-7aaf76238f6d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 20:24:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marvel999/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[ Kotlin Flow — Operators]]></title>
            <link>https://marvel999.medium.com/kotlin-flow-operators-c013b70ce6c8?source=rss-7aaf76238f6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c013b70ce6c8</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[flow]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Manish Singh]]></dc:creator>
            <pubDate>Sun, 15 Feb 2026 04:43:35 GMT</pubDate>
            <atom:updated>2026-02-15T04:59:20.050Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3ArDFVtnSgolssXM.png" /></figure><p>In today’s blog, we will explore <strong>operators in Kotlin Flow</strong> with clear explanations and simple code examples to help you understand the concepts easily.</p><p>I have previously published two blogs that break down the fundamentals of Flow in a simplified manner. If you haven’t read them yet, I highly recommend reviewing them first:</p><ul><li><a href="https://medium.com/@marvel999/kotlin-flow-intermediate-concepts-a4b36c2c4f5a">Part1</a></li><li><a href="https://medium.com/@marvel999/getting-started-with-kotlin-flow-core-concepts-operators-f81b72c79ef9">Part2</a></li></ul><p>These articles will provide the necessary foundation to better understand the operators we’ll discuss today.</p><h4><strong>Collect operator</strong></h4><p>This is a terminal operator. which use to to collect data on flow.</p><pre>    suspend fun coldFlow() {<br>        val flow = flow {<br>            (1..5).forEach {<br>                delay(500)<br>                emit(it)<br>            }<br>        }<br>            .flowOn(Dispatchers.IO)<br>        flow.collect {<br>            Log.d(TAG, it.toString())<br>        }<br>    }</pre><p><strong>Output</strong></p><pre>1<br>2<br>3<br>4<br>5</pre><h4>Reduce operator</h4><ul><li>takes all emitted values</li><li>Combines them into a single result</li></ul><pre>    /**<br>     * Reduce operator in flow<br>     */<br>    suspend fun coldFlowReduce() {<br>        val flow = flow {<br>            (1..5).forEach {<br>                delay(500)<br>                emit(it)<br>                emit(it)<br>            }<br>        }<br>            .flowOn(Dispatchers.IO)<br>        val reduceValue = flow.reduce { ac, value -&gt;<br>            Log.d(TAG, ac.toString()+&quot; : &quot;+value.toString())<br>            return@reduce ac+value<br>        }<br><br>        Log.d(TAG, reduceValue.toString())<br><br>    }</pre><p><strong>Output</strong></p><pre>1 : 1<br>2 : 2<br>4 : 2<br>6 : 3<br>9 : 3<br>12 : 4<br>16 : 4<br>20 : 5<br>25 : 5<br>30</pre><h4><strong>Map operator</strong></h4><p>It transforms each emitted value.</p><pre> /**<br>     * Map operator in flow<br>     */<br>    suspend fun coldFlowMap() {<br>        val flow = flow {<br>            (1..5).forEach {<br>                emit(it)<br>                delay(500)<br>            }<br>        }.map { value -&gt;<br>           value*10<br>        }<br>        flow.collect {<br>            Log.d(TAG, it.toString())<br>        }<br>    }</pre><p><strong>Output</strong></p><pre>10<br>20<br>30<br>40<br>50</pre><h4>Filter Operator</h4><p>Only emits values that satisfy the condition.</p><pre>/**<br>     * filter operator in flow<br>     */<br>    suspend fun coldFlowFilter() {<br>        val flow = flow {<br>            (1..5).forEach {<br>                emit(it)<br>                delay(500)<br>            }<br>        }.filter { value -&gt;<br>            if (value&gt;3)<br>                return@filter true<br>            else<br>                return@filter false<br>        }<br>        flow.collect {<br>            Log.d(TAG, it.toString())<br>        }<br>    }</pre><pre>4<br>5</pre><h4>DistinctUntilChanged Operator</h4><p>Removes <strong>consecutive duplicate values</strong>.</p><pre>suspend fun coldFlowWithDistinct() {<br>        val flow = flow {<br>            (1..5).forEach {<br>                delay(500)<br>                emit(it)<br>                emit(it)<br>            }<br>        }<br>            .distinctUntilChanged()<br>            .flowOn(Dispatchers.IO)<br>        flow.collect {<br>            Log.d(TAG, it.toString())<br>        }<br>    }</pre><p>Output</p><pre>1<br>2<br>3<br>4<br>5</pre><h4><strong>FlatMapLatest operator</strong></h4><ul><li>Cancels previous flow</li><li>Only the latest emission survives</li></ul><pre> suspend fun coldFlowWithFlatMapLatest() {<br>        val flow = flow {<br>            (1..5).forEach {<br>                delay(500)<br>                emit(it)<br>            }<br>        }<br>            .flatMapLatest {<br>                flow {<br>                    delay(1000)<br>                    emit(it * 100)<br>                }<br>            }<br>        flow.collect {<br>            Log.d(TAG, it.toString())<br>        }<br>    }</pre><p><strong>Output</strong></p><pre>500</pre><h4>FlatMapConcat Operator</h4><ul><li>Waits for the previous flow to complete</li><li>Executes sequentially</li></ul><pre> suspend fun coldFlowWithFlatMapConcat() {<br>        val flow = flow {<br>            (1..5).forEach {<br>                delay(500)<br>                emit(it)<br>            }<br>        }<br>            .flatMapConcat {<br>                flow {<br>                    delay(1000)<br>                    emit(it * 100)<br>                }<br>            }<br>        flow.collect {<br>            Log.d(TAG, it.toString())<br>        }<br>    }</pre><p><strong>Output</strong></p><pre>100<br>200<br>300<br>400<br>500</pre><h4>FlatMapMerge Operator</h4><ul><li>Runs inner flows in parallel</li><li>Results may come in any order</li></ul><pre> suspend fun coldFlowWithFlatMapMerge() {<br>        val flow = flow {<br>            (1..5).forEach {<br>                delay(500)<br>                emit(it)<br>            }<br>        }<br>            .flatMapMerge {<br>                flow {<br>                    delay(1000)<br>                    emit(it * 100)<br>                }<br>            }<br>        flow.collect {<br>            Log.d(TAG, it.toString())<br>        }<br>    }</pre><p><strong>Output</strong></p><pre>100<br>200<br>300<br>400<br>500</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kfYkCor-0i2dQAPY6a31uQ.png" /></figure><h3>Search Debounce mock</h3><ul><li>Ignore small values</li><li>Remove duplicates</li><li>Wait for the user to type(300ms delay)</li><li>Make an API call</li></ul><h4>Debounce Operator</h4><ul><li>Waits for 300ms of no new emission before emitting a value.</li></ul><pre> /**<br>     * Search debounce Implementation by flow<br>     */<br>    suspend fun searchDebounceFlow() {<br>        flow {<br>            (1..10).forEach {<br>                emit(it)<br>                delay(it*100L)<br>                emit(it + 100)<br>                delay(500)<br>            }<br>        }<br>            .filter {<br>                if (it &gt; 5) {<br>                    return@filter true<br>                } else {<br>                    return@filter false<br>                }<br>            }<br>            .distinctUntilChanged()<br>            .debounce(300)<br>            .flatMapMerge { value -&gt;<br>                flow {<br>                    emit(value)<br>                }<br><br>            }<br>            .collect {<br>                Log.d(TAG, &quot;API CALL &quot; + it.toString())<br><br>            }<br>    }</pre><p><strong>Output</strong></p><pre>API CALL 101<br>API CALL 102<br>API CALL 103<br>API CALL 104<br>API CALL 105<br>API CALL 6<br>API CALL 106<br>API CALL 7<br>API CALL 107<br>API CALL 8<br>API CALL 108<br>API CALL 9<br>API CALL 109<br>API CALL 10<br>API CALL 110</pre><h3>Thank you, folks, for reading till the end :)</h3><blockquote><em>“KEEP LEARNING,<br>KEEP SHARING”</em></blockquote><p><em>📱HAPPY CODING …</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c013b70ce6c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Kotlin Flow — Intermediate Concepts]]></title>
            <link>https://marvel999.medium.com/kotlin-flow-intermediate-concepts-a4b36c2c4f5a?source=rss-7aaf76238f6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4b36c2c4f5a</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[coding-best-practices]]></category>
            <category><![CDATA[kotlin-flow]]></category>
            <category><![CDATA[kotlin-flow-operators]]></category>
            <category><![CDATA[kotlin-flow-control]]></category>
            <dc:creator><![CDATA[Manish Singh]]></dc:creator>
            <pubDate>Fri, 12 Dec 2025 11:39:16 GMT</pubDate>
            <atom:updated>2025-12-12T11:39:16.833Z</atom:updated>
            <content:encoded><![CDATA[<h3>🔥 Kotlin Flow — Intermediate Concepts</h3><p>Hey Android devs 👋<br>In this blog, we’re going to dive into <strong>Kotlin Flow — Intermediate concepts</strong>, along with some <strong>real interview questions</strong> and <strong>best practices</strong> you should know in 2025 🚀</p><p>I’ll keep the language <strong>super simple</strong> and <strong>example-driven</strong>, so we focus on understanding the <strong>actual concepts</strong> instead of getting lost in heavy jargon 😄</p><p>Everything I share will be backed with <strong>facts, practical examples, and code snippets</strong>, so you can directly apply them in your projects and interviews 🔥</p><p>Let’s start today’s learning journey 👇✨</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FV7E_RvCK8-AHZPz.gif" /></figure><h3>🧊 First: Understand Cold Flow (core concept)</h3><h4>Cold Flow = Only runs when someone collects it</h4><p>Think like:</p><blockquote>A taped lecture — it starts only when you press play.</blockquote><h3>Example</h3><pre>val numbers = flow {<br>    println(&quot;Flow started&quot;)<br>    emit(1)<br>    emit(2)<br>    emit(3)<br>}<br><br>numbers.collect { println(it) }</pre><p><strong>OUTPUT</strong>:</p><pre>Flow started<br>1<br>2<br>3</pre><p>Collect again</p><pre>numbers.collect { println(it) }</pre><p>Again prints:</p><pre>Flow started<br>1<br>2<br>3</pre><p>👉 Because it restarts every time<br>👉 Like calling a function again</p><h3>🔥 Hot Flow</h3><h4>Hot flow = running whether anyone is collecting or not</h4><p>Think like:</p><blockquote><em>TV Live news. Whether you watch or not — stream is running.</em></blockquote><p><strong>When a collector joins, it gets the latest data (OR possibly misses old data)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FxlKXQQx4J_4F18eROwJzg.png" /></figure><h3>🔥 Advanced Flow Concepts</h3><p>Now real thing 👇</p><h3>1️⃣ buffer()</h3><p><strong>Allows flow to emit values without waiting for collect</strong></p><pre>flow {<br>    emit(1)<br>    emit(2)<br>    emit(3)<br>}<br>.buffer()<br>.collect {<br>    delay(1000)<br>    println(it)<br>}</pre><p>Without buffer: backpressure<br> With buffer: parallel</p><h3>2️⃣ conflate()</h3><p><strong>Skip intermediate values</strong></p><pre>flow {<br>    repeat(10){<br>        emit(it)<br>    }<br>}.conflate()<br>.collect {<br>    delay(1000)<br>    println(&quot;collected $it&quot;)<br>}</pre><p><strong>Output:-</strong></p><pre>collected 0<br>collected 9</pre><p>👉 best for live UI values<br> 👉 ignore old ones</p><h3>3️⃣ flatMapLatest()</h3><p><strong>only latest flow active<br></strong>Example:<br> Text search typing…<br> don’t search old text</p><pre>searchFlow<br>    .flatMapLatest { query -&gt;<br>        api.search(query)<br>    }</pre><p>👉 cancels previous search<br> 👉 always latest results</p><h3>4️⃣ flatMapMerge()</h3><p><strong>Multiple flows at same time</strong></p><pre>listOfFlow<br>    .flatMapMerge {<br>        api.search(it)<br>    }</pre><h3>5️⃣ flatMapConcat()</h3><p><strong>Run flows one by one</strong></p><pre>listOfFlow.flatMapConcat {<br>    api.search(it)<br>}</pre><h3>6️⃣ debounce()</h3><p><strong>Wait for idle typing</strong></p><pre>searchText<br>    .debounce(300)</pre><p>Good for search bars</p><h3>7️⃣ distinctUntilChanged()</h3><p>Only emit if changed</p><pre>state.distinctUntilChanged()</pre><h3>8️⃣ mapLatest()</h3><p>Cancel previous map operation</p><h3>🧊 StateFlow in detail</h3><pre>private val _count = MutableStateFlow(0)<br>val count = _count</pre><p>The collector always gets the latest value.</p><p>Best for UI state<br> ✔ Jetpack Compose<br> ✔ LiveData replacement</p><h3>🔥 SharedFlow in detail</h3><p>No replay by default.</p><p>For events:<br> ✔ show toast<br> ✔ navigate<br> ✔ one time actions</p><pre>private val _events = MutableSharedFlow&lt;String&gt;()<br>val events = _events.asSharedFlow()</pre><h3>🧨 replay</h3><p>Replay any number of old values</p><pre>MutableSharedFlow(replay = 1)</pre><h4>Cold Flow Example</h4><pre>fun numbers() = flow {<br>    emit(1)<br>    emit(2)<br>}</pre><h4>Hot Flow Example</h4><pre>val state = MutableStateFlow(0)<br><br>state.value = 2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AO_-xhiA5pSQRAffmoFctg.png" /></figure><h3>🔥 Best Practices (Interview gold)</h3><h3>✔ DO</h3><p>✔ use StateFlow for UI<br> ✔ expose only read version<br> ✔ use coroutineScope<br> ✔ cancel old tasks with flatMapLatest<br> ✔ use debounce on search</p><h3>❌ DON’T</h3><p>✘ don’t use SharedFlow as state<br> ✘ don’t send UI state in SharedFlow<br> ✘ don’t expose MutableFlow directly<br> ✘ don’t overuse map/flatmap<br> ✘ don’t leave flow uncancelled</p><h3>You must remember 1 thing</h3><p>🔥 <strong>StateFlow = always latest</strong><br> 🔥 <strong>SharedFlow = events</strong><br> 🔥 <strong>Flow = produces when collected</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XqbFdR7csYaRVJO1YySguQ.png" /></figure><h3>StateFlow vs LiveData</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMDIgJTKJmxGddQcWg1p0g.png" /></figure><h3>Thank you folks, for reading till end :)</h3><blockquote><em>“KEEP LEARNING,<br>KEEP SHARING”</em></blockquote><p><em>📱HAPPY CODING ….</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4b36c2c4f5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Performance & Memory Analysis ]]></title>
            <link>https://marvel999.medium.com/performance-memory-analysis-7aa9d6ff5686?source=rss-7aaf76238f6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7aa9d6ff5686</guid>
            <category><![CDATA[android-sdk]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android-apps]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Manish Singh]]></dc:creator>
            <pubDate>Fri, 05 Dec 2025 02:44:10 GMT</pubDate>
            <atom:updated>2025-12-05T02:46:48.613Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 Performance &amp; Memory Analysis</h3><p>Hey Android developers! 👋<br>In this article, we’ll dive deep into <strong>Performance and Memory Analysis</strong> — a crucial skill set for building fast, stable, and scalable Android apps. We’ll explore:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rXzzMO8As3Fa5r5M.png" /></figure><ul><li><strong>What memory leaks are</strong> and why they happen</li><li><strong>How to investigate and detect leaks</strong> using tools like Android Studio Memory Profiler and LeakCanary</li><li><strong>How to fix and prevent memory leaks</strong> with best practices</li><li><strong>Common mistakes developers make</strong> that often lead to performance or memory issues</li></ul><p>By the end of this guide, you’ll have a clear understanding of how to identify leaks, resolve them efficiently, and write leak-free, high-performance Android code.</p><h4>📌 Memory Leaks?</h4><ul><li>You know <strong>common leak patterns</strong>.</li><li>You know <strong>how to detect</strong> leaks using tools.</li><li>You understand <strong>Android lifecycle + object retention</strong>.</li></ul><h4>📌 Common Leak Sources</h4><p>❌ <strong>Long-living objects keeping Activity/Fragment reference</strong><br> → Singletons, ViewModel, static fields</p><p>❌ <strong>Anonymous classes / Runnables</strong><br> → They capture outer class reference implicitly</p><p>❌ <strong>Listeners not unregistered</strong><br> → Location, Sensor, BroadcastReceiver</p><p>❌ <strong>Flows / Coroutines not cancelled</strong><br> → Especially when tied to Activity/Fragment</p><p>❌ <strong>Fragment ViewBinding not cleared</strong><br> → Must set binding = null in onDestroyView()</p><h4>📌 How to Detect Memory Leaks</h4><p>First look into<strong> LeakCanary</strong> for development builds.<br> It performs:</p><ul><li>automatic heap dumps</li><li>identifies retained references</li><li>shows reference paths to the GC roots</li></ul><p>In Android Studio <strong>Memory Profiler</strong>, inspect:</p><ul><li>objects with <strong>high retained size</strong></li><li>allocations that <strong>grow over time</strong></li><li>objects that <strong>survive multiple GCs</strong></li></ul><p>We should also manually check lifecycle mismatches — for example, a Fragment’s view surviving after onDestroyView() indicates that the view hierarchy is leaking.</p><h4>📌 Large Bitmap Handling</h4><p>Incorrect bitmap usage is still one of the <strong>top sources of OOM</strong> in Android.</p><h3>Key Concepts</h3><ul><li>Use <strong>inSampleSize</strong> via BitmapFactory.Options</li></ul><pre>val options = BitmapFactory.Options().apply {<br>    inJustDecodeBounds = true<br>}<br><br>BitmapFactory.decodeResource(resources, R.drawable.big_image, options)<br><br>// Calculate sample size<br>options.inSampleSize = calculateInSampleSize(options, reqWidth = 300, reqHeight = 300)<br><br>options.inJustDecodeBounds = false<br><br>val bitmap = BitmapFactory.decodeResource(resources, R.drawable.big_image, options)</pre><pre>fun calculateInSampleSize(options: BitmapFactory.Options, reqWidth: Int, reqHeight: Int): Int {<br>    val height = options.outHeight<br>    val width = options.outWidth<br>    var inSampleSize = 1<br><br>    if (height &gt; reqHeight || width &gt; reqWidth) {<br>        val heightRatio = height / reqHeight<br>        val widthRatio = width / reqWidth<br>        inSampleSize = minOf(heightRatio, widthRatio)<br>    }<br><br>    return inSampleSize<br>}</pre><ul><li>Prefer <strong>RGB_565</strong> when high color accuracy isn’t needed</li><li>Use <strong>Glide / Coil</strong> for subsampling + pooling</li><li>Recycle bitmaps on pre-KitKat devices</li><li>Avoid loading <strong>original-resolution</strong> images into memory</li><li>Use <strong>hardware bitmaps</strong> for rendering when applicable</li></ul><h4>❓ <strong>How do you handle large bitmaps efficiently?</strong></h4><p>Decode metadata only using:</p><pre>options.inJustDecodeBounds = true</pre><ol><li>Compute appropriate inSampleSize</li><li>Decode scaled-down bitmap</li><li>Use image libraries that provide <strong>BitmapPool</strong> and cache management</li><li>Stream images using InputStream</li><li>Avoid large bitmaps on Main thread (StrictMode helps detect this)</li></ol><h4>📌 GPU Overdraw</h4><h4>What is Overdraw?</h4><p>When the same pixel is drawn multiple times before showing on screen.<br> → More GPU work → slower rendering → higher battery drain.</p><h4>How to Detect</h4><p>Enable <strong>Developer Options → Debug GPU Overdraw</strong>.</p><p>Color meaning:</p><ul><li><strong>Blue</strong> → 1x draw (good)</li><li><strong>Green</strong> → 2x</li><li><strong>Light Red</strong> → 3x</li><li><strong>Dark Red</strong> → 4x+ (bad)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/0*N7pdMz-SnqU_wK0T.png" /></figure><h4>How to Reduce Overdraw</h4><ul><li>Remove redundant view backgrounds</li><li>Prefer android:foreground</li><li>Use &lt;merge&gt; to flatten layouts</li><li>Replace deep LinearLayouts with <strong>ConstraintLayout</strong></li><li>Avoid nested Cards with backgrounds</li></ul><h4>📌 Thread Starvation / ThreadPool Issues</h4><h4>Causes</h4><ul><li>Too many tasks queued in a small executor</li><li>Locks / synchronization on shared resources</li><li>Long-running tasks on Main thread</li><li>Incorrect dispatcher usage (Dispatchers.IO overloaded)</li></ul><h4>Prevention</h4><ul><li>Separate <strong>CPU-bound</strong> and <strong>IO-bound</strong> executors</li><li>Never perform long-running tasks on the main — StrictMode catches violations</li><li>Tune thread pool size:</li><li>CPU: #cores</li><li>IO: larger (10–20)</li><li>Cancel unused coroutines</li><li>Avoid holding synchronized locks for expensive operations</li></ul><h4>📌ANR (Application Not Responding)</h4><h4>Triggers</h4><p>Main thread blocked longer than:</p><ul><li><strong>5s</strong> → Input</li><li><strong>10s</strong> → BroadcastReceiver</li><li><strong>200s</strong> → Service</li></ul><h4>Common Root Causes</h4><ul><li>Heavy calculations on main</li><li>Disk / Network IO</li><li>Bitmap decoding</li><li>Deadlocks</li><li>Long operations in onReceive()</li></ul><h4>Debugging ANRs</h4><ul><li>Check traces.txt</li><li>Use <strong>Perfetto / Systrace</strong></li><li>Look where <strong>main thread</strong> is blocked</li><li>StrictMode for prevention</li></ul><p><strong>How does StrictMode help?</strong></p><p><strong>StrictMode detects:</strong></p><ul><li>Disk IO on main</li><li>Network on main</li><li>Leaked closable resources</li><li>Custom violations</li></ul><p>It forces a clean main thread, which prevents ANRs.</p><pre>StrictMode.setThreadPolicy(<br>    ThreadPolicy.Builder()<br>        .detectAll()<br>        .penaltyLog()<br>        .build()<br>)</pre><h4>📌 Efficient UI Rendering</h4><h4>Checks:</h4><ul><li>Understanding of render pipeline: <strong>measure → layout → draw</strong></li><li>Ability to reduce layout passes</li><li>Good usage of:</li><li>DiffUtil</li><li>View recycling</li><li>PrecomputedText</li><li>Avoiding over-measure</li></ul><h4>Best Practices</h4><ul><li>Flatten layout hierarchy</li><li>RecyclerView.setHasFixedSize(true)</li><li>Use ListAdapter + DiffUtil</li><li>Precompute text (PrecomputedTextCompat)</li><li>Avoid wrap_content inside scrolling containers</li><li>Offload heavy work outside of onBindViewHolder</li></ul><p>Android performance isn’t about writing perfect code — it’s about writing <strong>aware code</strong>.<br> If you understand how memory works, how leaks happen, and how to investigate them, you’re already miles ahead of most developers.</p><p>By applying these practices consistently, you’ll ship apps that are:</p><ul><li>Faster ⚡</li><li>More stable 🛡️</li><li>More battery-efficient 🔋</li><li>Easier to maintain 🧩</li></ul><p>Performance is not a one-time task — it’s a habit.</p><h4>Thank you folks for reading till end :)</h4><blockquote><em>“KEEP LEARNING,<br>KEEP SHARING”</em></blockquote><p><em>📱HAPPY CODING ….</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7aa9d6ff5686" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Kotlin Flow: Core Concepts & Operators]]></title>
            <link>https://marvel999.medium.com/getting-started-with-kotlin-flow-core-concepts-operators-f81b72c79ef9?source=rss-7aaf76238f6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f81b72c79ef9</guid>
            <dc:creator><![CDATA[Manish Singh]]></dc:creator>
            <pubDate>Wed, 26 Nov 2025 11:25:51 GMT</pubDate>
            <atom:updated>2025-11-26T11:25:51.720Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey developers 👋,<br> In this blog, we’re going to dive deep into <strong>Kotlin Flow</strong> — starting from the fundamental concepts and gradually moving toward advanced patterns used in real-world Android development. We’ll break down how Flow works under the hood, how it compares to other asynchronous solutions like LiveData and RxJava, and how you can effectively use it for data streams, state management, and reactive architectures.</p><p>To make this guide even more practical, I’ve also included a dedicated section on <strong>popular interview questions</strong> related to Kotlin Flow, along with clear explanations to help you stand out in technical interviews.</p><p>Whether you’re just getting started or looking to refine your expertise, this guide will give you a solid understanding of Flow and how to use it efficiently in modern Android applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6YQv4p9KzNNEhKRX.jpeg" /></figure><h3>🤔 What is Flow?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*_8Vp5f0UxP94N_25.gif" /></figure><p>Flow is a <strong>stream of values</strong> that are produced one-by-one <strong>asynchronously</strong> using <strong>coroutines</strong>.<br>Think of Flow like:</p><h4>👉 <strong>A water tap</strong></h4><ul><li>When you open it (<strong>collect</strong>), water (<strong>values</strong>) start coming.</li><li>When you close it (stop collecting), it stops.</li></ul><p>So Flow = “I will give you values <strong>when</strong> you ask for them.”</p><h3>📄 Flow Is <strong>Asynchronous</strong></h3><p>Flow works with <strong>coroutines</strong>, so it can perform tasks like:</p><ul><li>network calls</li><li>database reading</li><li>long-running operations</li></ul><blockquote><strong>without blocking the thread.</strong></blockquote><h3>📄 Flow is <strong>Cold</strong></h3><p>This is one of the <strong>most important</strong> basic concepts.</p><blockquote>❗ <strong>Flow does NOT run until it is collected.</strong></blockquote><p>⭐ <strong>Example:</strong></p><pre>val myFlow = flow {<br>    println(&quot;Flow started&quot;)<br>    emit(1)<br>}</pre><p><strong>If you never collect</strong>:</p><pre>Flow started ❌ (will NOT print)</pre><p><strong>When you collect:</strong></p><pre>myFlow.collect { println(&quot;Value: $it&quot;) }</pre><p><strong>Output</strong>:</p><pre>Flow started<br>Value: 1</pre><h3>📄 How to Create a Basic Flow:</h3><h4>✔ Using flow { } builder</h4><pre>val numberFlow = flow {<br>    emit(1)<br>    emit(2)<br>    emit(3)<br>}</pre><p>👉 Here Flow is producing 1,2,3.</p><h3>📄 How to Collect a Flow:</h3><p>You collect inside the Coroutine:</p><pre>CoroutineScope(Dispatchers.Main).launch {<br>    numberFlow.collect { value -&gt;<br>        println(&quot;Received: $value&quot;)<br>    }<br>}</pre><p><strong>Output</strong>:</p><pre>Received: 1<br>Received: 2<br>Received: 3</pre><h3>📄 Delay Inside Flow</h3><p>You can use <strong>delay inside flow</strong>.</p><pre>val user = flow{<br>Print(&quot;Loading user..&quot;)<br>delay(3000)<br>Print(&quot;User loaded!&quot;)<br>}</pre><h3>📄 Flow Operators (Very Basic &amp; Important)</h3><h4>✔ map</h4><p>Transforms each value.</p><pre>val doubled = numberFlow.map { it * 2 }</pre><h4>✔ filter</h4><p>Filters values.</p><pre>numberFlow.filter { it % 2 == 1 }</pre><h4>✔ Full Example</h4><pre>numberFlow<br>    .filter { it % 2 == 1 }<br>    .map { it * 10 }<br>    .collect { println(it) }</pre><p><strong>Output</strong>:</p><pre>10<br>30</pre><h3>📄 Exception Handling in Basic Flow</h3><h4>✔ Using try/catch inside flow</h4><pre>val user = flow{<br>try{<br>emit(10)<br>throw Exception(&quot;Something failed&quot;)<br>}catch(){<br>emit(-1)<br>}<br>}</pre><h4>✔ Using .catch { } outside flow</h4><pre>flow {<br>    emit(10)<br>    throw Exception(&quot;Error!&quot;)<br>}.catch { e -&gt;<br>    emit(-1)<br>}<br>.collect { println(it) }</pre><h3>📄 flowOn() (Basic understanding)</h3><p>Used to change <strong>WHERE</strong> the flow runs (thread).</p><pre>flow {<br>    emit(downloadData()) // heavy work<br>}<br>.flowOn(Dispatchers.IO)<br>.collect { println(it) }</pre><ul><li>Producer runs on IO</li><li>Collector still runs on Main</li></ul><h3>asFlow()</h3><p>Convert list to flow:</p><p>flowOf() creates a <strong>Flow from fixed/static values</strong>.</p><p>It is like saying:</p><blockquote><em>“Make a flow that emits these values </em><strong><em>as they are</em></strong><em>.”</em></blockquote><pre>val listFlow = listOf(1,2,3,4).asFlow()</pre><p><strong>Output:-</strong></p><pre>10<br>20<br>30</pre><h4>flowOf()</h4><p>Static flow:</p><pre>val f = flowOf(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;)</pre><p><strong>Output:-</strong></p><pre>A<br>B<br>C</pre><h3>⭐ Major Differences (flowOf vs asFlow)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zd1hjAM58ypXVV0eLL6uCA.png" /></figure><h3>Interview Question</h3><ol><li><strong>How is Flow different from LiveData?</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JHKnm0HnwzgXp0YWw4v4bQ.png" /></figure><p><strong>2. What is flowOn? Why is it used?</strong></p><p>flowOn() changes the <strong>thread</strong> of the <strong>producer</strong> part of flow (where values are emitted).</p><p><strong>3. How to handle exceptions in Flow?</strong></p><p>Two ways:</p><ol><li>Inside flow: try/catch</li><li>Outside: .catch {} operator</li></ol><p><strong>4. What is the difference between flow {} and flowOf()?</strong></p><ul><li>flow {} → custom flow, emit manually</li><li>flowOf() → static values, no logic</li></ul><p><strong>4. What is the benefit of Flow over callbacks?</strong></p><p>Flow gives:</p><ul><li>Cleaner asynchronous code</li><li>No callback hell</li><li>Suspension support</li><li>Built-in error handling</li></ul><h4>Happy coding !!</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f81b72c79ef9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step-by-Step Guide to Adding React Native to an Existing Android Project]]></title>
            <link>https://marvel999.medium.com/step-by-step-guide-to-adding-react-native-to-an-existing-android-project-b777cd96d07b?source=rss-7aaf76238f6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b777cd96d07b</guid>
            <category><![CDATA[reactnative-integration]]></category>
            <category><![CDATA[react-native-react-js]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[reactnative-app]]></category>
            <dc:creator><![CDATA[Manish Singh]]></dc:creator>
            <pubDate>Wed, 19 Nov 2025 14:38:07 GMT</pubDate>
            <atom:updated>2025-11-21T16:10:41.297Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>When I was working at Mrsool, we had to embed React Native into an existing Android codebase. What should have been a straightforward enhancement quickly turned into a configuration challenge — mismatched Gradle settings, dependency conflicts, and unpredictable runtime issues slowed the team down.</blockquote><blockquote>In this post, I’ll walk through a clean, reliable approach for integrating React Native as a submodule inside a native Android project. The goal is simple: help you avoid the pitfalls we faced and adopt a setup that is easy to maintain, scalable, and production-ready.</blockquote><p>Adding React Native as a submodule lets you:</p><ul><li>Reuse your existing native features and investments.</li><li>Incrementally migrate screens to React Native.</li><li>Maintain a single Android app while leveraging RN’s productivity.</li></ul><p>However, without the right setup, integration can cause build failures, unstable development workflows, and increased maintenance overhead. This guide focuses on the reliable, production-ready steps and common pitfalls.</p><p>Official Documentation <a href="https://reactnative.dev/docs/integration-with-existing-apps">LINK</a></p><p>In this blog, we’ll walk through how to integrate <strong>React Native with the new architecture (TurboModules and Fabric)</strong> into an existing Android native project.</p><p>With the shift toward React Native’s new architecture, developers can take advantage of faster startup times, improved performance, and better type safety. However, integrating TurboModules within an established Android codebase often introduces configuration challenges and build issues.</p><p>This guide is designed to provide a <strong>step-by-step approach</strong> to help you integrate React Native seamlessly, avoid common pitfalls, and ensure your project is ready to leverage the full potential of TurboModules.</p><h3>Steps to Integrate ReactNative</h3><h4>🧩 Step 1: Create a React Native Submodule</h4><p>To ensure your React Native project can be <strong>shared between Android and iOS</strong>, the best practice is to maintain it as a <strong>Git submodule</strong> inside your existing native repository.<br> This makes it easier to sync updates, manage dependencies, and keep your React Native code isolated yet version-controlled within your native project.</p><h4>🔧 1.1 Add React Native as a Submodule</h4><p>Navigate to the root of your existing <strong>Android project</strong> and run the following command:</p><pre>git submodule add https://github.com/facebook/react-native.git react-native</pre><p>This will create a new folder named react-native inside your repository that points to the React Native source.</p><p>If you already have a <strong>React Native app</strong> in another repo and want to link that instead, use your project’s Git URL instead of the Facebook one:</p><pre>git submodule add https://github.com/your-org/your-react-native-app.git react-native</pre><h3>🔄 1.2 Initialize and Update Submodules</h3><p>When cloning this repository later, don’t forget to initialize the submodule:</p><pre>git submodule init<br>git submodule update</pre><p>Or, in a single command:</p><pre>git clone --recurse-submodules &lt;your-repo-url&gt;</pre><p>This ensures that the React Native source code is pulled along with your Android project.</p><h3>⚙️ 1.3 Include the Submodule in settings.gradle</h3><p>Next, open your settings.gradle file (in your Android root project) and include the React Native submodule as part of your Gradle project:</p><pre>include(&quot;:react-native&quot;)<br>project(&quot;:react-native&quot;).projectDir = new File(rootDir, &quot;react-native/packages/react-native&quot;)</pre><p>If you are maintaining your own custom React Native package structure, adjust the path accordingly.</p><h3>⚙️ 1.4 Create your sample react-native project</h3><pre>npx react-native init MyAwesomeProject</pre><pre>// Do this to react-native module<br>npm install</pre><h3>2. Step-by-Step Guide to Integrate React Native in Your Android Native App</h3><h4>2.1. Add this to settings. gradle</h4><pre>// React Native Gradle Plugin configuration for brownfield<br>pluginManagement {<br>// In below give your react native path<br>    includeBuild(&quot;$rootDir/ReactNativeModule/node_modules/@react-native/gradle-plugin&quot;)<br>    repositories {<br>        google()<br>        mavenCentral()<br>        gradlePluginPortal()<br>    }<br>}<br><br>plugins {<br>    id(&quot;com.facebook.react.settings&quot;)<br>}<br><br><br>extensions.configure(com.facebook.react.ReactSettingsExtension) { ex -&gt;<br><br>    // Enable auto-linking from the React Native module directory<br>    ex.autolinkLibrariesFromCommand(<br>             // Give your npx path<br>            [&quot;/opt/homebrew/bin/npx&quot;, &quot;@react-native-community/cli&quot;, &quot;config&quot;],<br>            file(&quot;$rootDir/ReactNativeModule/&quot;)<br>    )<br>}</pre><h4>2.2. Add this to the project-level build. gradle</h4><pre>buildscript {<br>    repositories {<br>        google()<br>        mavenCentral()<br>    }<br>    dependencies {<br>        classpath(&quot;com.android.tools.build:gradle:7.3.1&quot;)<br>+       classpath(&quot;com.facebook.react:react-native-gradle-plugin&quot;)<br>    }<br>}</pre><h4>2.3. Add this to the app-level build.gradle</h4><pre>apply plugin: &quot;com.android.application&quot;<br>+apply plugin: &quot;com.facebook.react&quot;</pre><pre>repositories {<br>    mavenCentral()<br>}<br>dependencies {<br>    // Other dependencies here<br>+   // Note: we intentionally don&#39;t specify the version number here as RNGP will take care of it.<br>+   // If you don&#39;t use the RNGP, you&#39;ll have to specify version manually.<br>+   implementation(&quot;com.facebook.react:react-android&quot;)<br>+   implementation(&quot;com.facebook.react:hermes-android&quot;)<br>}<br>+react {<br>+   // Needed to enable Autolinking - https://github.com/react-native-community/cli/blob/master/docs/autolinking.md<br>+   autolinkLibrariesWithApp()<br>+}</pre><h4>2.3. Open your application gradle.properties files and add the following line</h4><pre>+reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64<br>+newArchEnabled=true<br>+hermesEnabled=true</pre><h4>2.4. Check if you have Internet permission on the manifest.xml</h4><pre>&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;&lt;application<br> android:name=&quot;.MainApplication&quot;&gt;<br> &lt;/application&gt;<br>&lt;/manifest&gt;</pre><h4>2.5. Create a index.js file</h4><pre>import {AppRegistry} from &#39;react-native&#39;;<br>import App from &#39;./App&#39;;<br><br>AppRegistry.registerComponent(&#39;HelloWorld&#39;, () =&gt; App);</pre><h4>2.6. Create a App.tsx file</h4><pre>import React from &#39;react&#39;;<br>import {<br>  SafeAreaView,<br>  ScrollView,<br>  StatusBar,<br>  StyleSheet,<br>  Text,<br>  useColorScheme,<br>  View,<br>} from &#39;react-native&#39;;<br><br>import {<br>  Colors,<br>  DebugInstructions,<br>  Header,<br>  ReloadInstructions,<br>} from &#39;react-native/Libraries/NewAppScreen&#39;;<br><br>function App(): React.JSX.Element {<br>  const isDarkMode = useColorScheme() === &#39;dark&#39;;<br><br>  const backgroundStyle = {<br>    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,<br>  };<br><br>  return (<br>    &lt;SafeAreaView style={backgroundStyle}&gt;<br>      &lt;StatusBar<br>        barStyle={isDarkMode ? &#39;light-content&#39; : &#39;dark-content&#39;}<br>        backgroundColor={backgroundStyle.backgroundColor}<br>      /&gt;<br>      &lt;ScrollView<br>        contentInsetAdjustmentBehavior=&quot;automatic&quot;<br>        style={backgroundStyle}&gt;<br>        &lt;Header /&gt;<br>        &lt;View<br>          style={{<br>            backgroundColor: isDarkMode<br>              ? Colors.black<br>              : Colors.white,<br>            padding: 24,<br>          }}&gt;<br>          &lt;Text style={styles.title}&gt;Step One&lt;/Text&gt;<br>          &lt;Text&gt;<br>            Edit &lt;Text style={styles.bold}&gt;App.tsx&lt;/Text&gt; to<br>            change this screen and see your edits.<br>          &lt;/Text&gt;<br>          &lt;Text style={styles.title}&gt;See your changes&lt;/Text&gt;<br>          &lt;ReloadInstructions /&gt;<br>          &lt;Text style={styles.title}&gt;Debug&lt;/Text&gt;<br>          &lt;DebugInstructions /&gt;<br>        &lt;/View&gt;<br>      &lt;/ScrollView&gt;<br>    &lt;/SafeAreaView&gt;<br>  );<br>}<br><br>const styles = StyleSheet.create({<br>  title: {<br>    fontSize: 24,<br>    fontWeight: &#39;600&#39;,<br>  },<br>  bold: {<br>    fontWeight: &#39;700&#39;,<br>  },<br>});<br><br>export default App;</pre><h3>Integrating with your Android code</h3><h4>Updating your Application class</h4><pre>package &lt;your-package-here&gt;;<br><br>import android.app.Application;<br>+import com.facebook.react.PackageList;<br>+import com.facebook.react.ReactApplication;<br>+import com.facebook.react.ReactHost;<br>+import com.facebook.react.ReactNativeHost;<br>+import com.facebook.react.ReactPackage;<br>+import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;<br>+import com.facebook.react.defaults.DefaultReactHost;<br>+import com.facebook.react.defaults.DefaultReactNativeHost;<br>+import com.facebook.soloader.SoLoader;<br>+import com.facebook.react.soloader.OpenSourceMergedSoMapping<br>+import java.util.List;<br><br>-class MainApplication extends Application {<br>+class MainApplication extends Application implements ReactApplication {<br>+ @Override<br>+ public ReactNativeHost getReactNativeHost() {<br>+   return new DefaultReactNativeHost(this) {<br>+     @Override<br>+     protected List&lt;ReactPackage&gt; getPackages() { return new PackageList(this).getPackages(); }<br>+     @Override<br>+     protected String getJSMainModuleName() { return &quot;index&quot;; }<br>+     @Override<br>+     public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; }<br>+     @Override<br>+     protected boolean isNewArchEnabled() { return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; }<br>+     @Override<br>+     protected Boolean isHermesEnabled() { return BuildConfig.IS_HERMES_ENABLED; }<br>+   };<br>+ }<br><br>+ @Override<br>+ public ReactHost getReactHost() {<br>+   return DefaultReactHost.getDefaultReactHost(getApplicationContext(), getReactNativeHost());<br>+ }<br><br>  @Override<br>  public void onCreate() {<br>    super.onCreate();<br>+   SoLoader.init(this, OpenSourceMergedSoMapping);<br>+   if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {<br>+     DefaultNewArchitectureEntryPoint.load();<br>+   }<br>  }<br>}</pre><h4>Creating a ReactActivity</h4><p>Finally, we need to create a new Activity that will extend ReactActivity and host the React Native code. This activity will be responsible for starting the React Native runtime and rendering the React component.</p><pre>// package &lt;your-package-here&gt;;<br><br>import com.facebook.react.ReactActivity;<br>import com.facebook.react.ReactActivityDelegate;<br>import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;<br>import com.facebook.react.defaults.DefaultReactActivityDelegate;<br><br>public class MyReactActivity extends ReactActivity {<br><br>    @Override<br>    protected String getMainComponentName() {<br>        return &quot;HelloWorld&quot;;<br>    }<br><br>    @Override<br>    protected ReactActivityDelegate createReactActivityDelegate() {<br>        return new DefaultReactActivityDelegate(this, getMainComponentName(), DefaultNewArchitectureEntryPoint.getFabricEnabled());<br>    }<br>}</pre><p>Whenever you create a new Activity, you need to add it to your AndroidManifest.xml file. You also need set the theme of MyReactActivity to Theme.AppCompat.Light.NoActionBar (or to any non-ActionBar theme) as otherwise your application will render an ActionBar on top of your React Native screen:</p><pre>&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;<br><br>    &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;<br><br>    &lt;application<br>      android:name=&quot;.MainApplication&quot;&gt;<br><br>+     &lt;activity<br>+       android:name=&quot;.MyReactActivity&quot;<br>+       android:label=&quot;@string/app_name&quot;<br>+       android:theme=&quot;@style/Theme.AppCompat.Light.NoActionBar&quot;&gt;<br>+     &lt;/activity&gt;<br>    &lt;/application&gt;<br>&lt;/manifest&gt;</pre><h3>Test your integration</h3><p>You have completed all the basic steps to integrate React Native with your application. Now we will start the <a href="https://metrobundler.dev/">Metro bundler</a> to build your TypeScript application code into a bundle. Metro’s HTTP server shares the bundle from localhost on your developer environment to a simulator or device. This allows for <a href="https://reactnative.dev/blog/2016/03/24/introducing-hot-reloading">hot reloading</a>.</p><p>First, you need to create a metro.config.js file in the root of your project as follows:</p><pre>const {getDefaultConfig} = require(&#39;@react-native/metro-config&#39;);<br>module.exports = getDefaultConfig(__dirname);</pre><p>You can checkout the <a href="https://github.com/react-native-community/template/blob/0.82-stable/template/metro.config.js">metro.config.js file</a> from the Community template file as a reference.</p><p>Once you have the configuration file in place, you can run the bundler. Run the following command in the root directory of your project:</p><pre>npm start</pre><h4>Creating a release build in Android Studio</h4><p>You can use Android Studio to create your release builds, too! It’s as quick as creating release builds of your previously existing native Android app.</p><p>The React Native Gradle Plugin will take care of bundling the JS code inside your APK/App Bundle.</p><p>If you’re not using Android Studio, you can create a release build with:</p><pre>cd android<br># For a Release APK<br>./gradlew :app:assembleRelease<br># For a Release AAB<br>./gradlew :app:bundleRelease</pre><p>Thank you &amp; Happy coding!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b777cd96d07b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moshi & Room KAPT -> KSP Migration.]]></title>
            <link>https://marvel999.medium.com/moshi-room-kapt-ksp-migration-76ae0be3afec?source=rss-7aaf76238f6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/76ae0be3afec</guid>
            <category><![CDATA[ksp]]></category>
            <category><![CDATA[kapt]]></category>
            <category><![CDATA[koltin]]></category>
            <category><![CDATA[migration]]></category>
            <dc:creator><![CDATA[Manish Singh]]></dc:creator>
            <pubDate>Sat, 26 Nov 2022 19:48:15 GMT</pubDate>
            <atom:updated>2022-11-26T19:48:15.422Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4KQbZoP27V7ZvuQS" /><figcaption><strong>KAPT vs KSP</strong></figcaption></figure><p>Kotlin Symbol Processing (<em>KSP</em>) is an API that you can use to develop lightweight compiler plugins. KSP provides a simplified compiler plugin API that leverages the power of Kotlin while keeping the learning curve at a minimum. Compared to kapt, annotation processors that use KSP can run up to 2 times faster.</p><h4>Why KSP?</h4><p>Compiler plugins are powerful metaprogramming tools that can greatly enhance how you write code. Compiler plugins call compilers directly as libraries to analyze and edit input programs. These plugins can also generate output for various uses. For example, they can generate boilerplate code, and they can even generate full implementations for specially-marked program elements, such as Parcelable. Plugins have a variety of other uses and can even be used to implement and fine-tune features that are not provided directly in a language.</p><p>KSP is designed to hide compiler changes, minimizing maintenance efforts for processors that use it. KSP is designed not to be tied to the JVM so that it can be adapted to other platforms more easily in the future. KSP is also designed to minimize build times. For some processors, such as <a href="https://github.com/bumptech/glide">Glide</a>, KSP reduces full compilation times by up to 25% when compared to kapt.</p><h3>Comparison to reflection</h3><p>KSP’s API looks similar to kotlin.reflect. The major difference between them is that type references in KSP need to be resolved explicitly. This is one of the reasons why the interfaces are not shared.</p><h3>Comparison to kapt</h3><p><a href="https://kotlinlang.org/docs/kapt.html">kept</a> is a remarkable solution which makes a large amount of Java annotation processors work for Kotlin programs out-of-box. The major advantages of KSP over kapt are improved build performance, not tied to JVM, a more idiomatic Kotlin API, and the ability to understand Kotlin-only symbols.</p><p>To run Java annotation processors unmodified, kapt compiles Kotlin code into Java stubs that retain information that Java annotation processors care about. To create these stubs, kapt needs to resolve all symbols in the Kotlin program. The stub generation costs roughly 1/3 of a full kotlinc analysis and the same order of kotlinc code-generation. For many annotation processors, this is much longer than the time spent in the processors themselves. For example, Glide looks at a very limited number of classes with a predefined annotation, and its code generation is fairly quick. Almost all of the build overhead resides in the stub generation phase. Switching to KSP would immediately reduce the time spent in the compiler by 25%.</p><h3>Limitations</h3><p>While KSP tries to be a simple solution for most common use cases, it has made several trade-offs compared to other plugin solutions. The following are not goals of KSP:</p><ul><li>Examining expression-level information of source code.</li><li>Modifying source code.</li><li>100% compatibility with the Java Annotation Processing API.</li></ul><p>We are also exploring several additional features. These features are currently unavailable:</p><ul><li>IDE integration: Currently IDEs know nothing about the generated code.</li></ul><h4>Finding in the complex project</h4><p><strong>KSP DATA</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*THtX7lf59YUgWia_0RWqRw.png" /><figcaption>KSP Benchmark</figcaption></figure><blockquote>* Running warm-up build #1<br>Execution time 246156 ms<br>* Running warm-up build #2<br>Execution time 75455 ms<br>* Running measured build #1<br>Execution time 71653 ms<br>* Running measured build #2<br>Execution time 72894 ms<br>* Running measured build #3<br>Execution time 72602 ms</blockquote><p><strong>KAPT DATA</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-aGMStYHoZXrDUrnYd5DQ.png" /><figcaption>KAPT Benchmark</figcaption></figure><blockquote>* Running warm-up build #1<br>Execution time 294587 ms<br>* Running warm-up build #2<br>Execution time 79696 ms<br>* Running measured build #1<br>Execution time 70531 ms<br>* Running measured build #2<br>Execution time 80581 ms<br>* Running measured build #3<br>Execution time 75901 ms</blockquote><h4>How to migrate Moshi KAPT -&gt; KSP</h4><p>The first thing is to update your Moshi and Kotlin to the latest version.</p><p>Add this dependency to your root-level Gradle file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62808a1fb2981b8030143f7e94d9ec0b/href">https://medium.com/media/62808a1fb2981b8030143f7e94d9ec0b/href</a></iframe><p>Add this plugin to your app module or where do you want to use it.</p><pre>plugins {<br>  id(&quot;com.google.devtools.ksp&quot;)<br>}</pre><p>Add change kapt to ksp</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/91ef9f84e33f95d3bc9b86fa446217a3/href">https://medium.com/media/91ef9f84e33f95d3bc9b86fa446217a3/href</a></iframe><p>🥳 Congratulation you migrated your Moshi to KSP :)</p><h4>How to migrate ROOM KAPT -&gt; KSP</h4><p>The first thing is to update your Room and Kotlin to the latest version.</p><p>Add this dependency to your root-level Gradle file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62808a1fb2981b8030143f7e94d9ec0b/href">https://medium.com/media/62808a1fb2981b8030143f7e94d9ec0b/href</a></iframe><p>Add this plugin to your app module or where do you want to use it.</p><pre>plugins {<br>  id(&quot;com.google.devtools.ksp&quot;)<br>}</pre><p>In-app level Gradle file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/915f5cf5d0ac15e522fd393d08f8a4cc/href">https://medium.com/media/915f5cf5d0ac15e522fd393d08f8a4cc/href</a></iframe><p>🥳 Congratulation you migrated your Room to KSP :)</p><h4>Thank you folks for reading till end :)</h4><blockquote>“KEEP LEARNING,<br>KEEP SHARING”</blockquote><p><em>📱HAPPY CODING ….</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76ae0be3afec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lateinit & Lazy in kotlin]]></title>
            <link>https://marvel999.medium.com/lateinit-lazy-in-kotlin-76f50f1833bc?source=rss-7aaf76238f6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/76f50f1833bc</guid>
            <category><![CDATA[delegation]]></category>
            <category><![CDATA[lazy]]></category>
            <category><![CDATA[lateinit]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Manish Singh]]></dc:creator>
            <pubDate>Sat, 24 Sep 2022 18:22:45 GMT</pubDate>
            <atom:updated>2022-09-24T18:46:34.725Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey guys, In this Tech-blog we will try to learn about Lateinit &amp; Lazy. We try to see in different scenarios what the output will be.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*_EXyLfB82G3Xdho92cPazQ.gif" /><figcaption>Lazy :)</figcaption></figure><h4>Lateinit in kotlin</h4><p>As the name said (late -&gt; later) + (init -&gt; initialization). like it is only use with var property and It can we initalize latter. Hey we declear variable with promise that we will initalize it be accessing this variable.</p><h4><strong>✅Do’s :)</strong></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/899465b22c8250254415a388f5b7dcfa/href">https://medium.com/media/899465b22c8250254415a388f5b7dcfa/href</a></iframe><p>Above code is the idea way to declear lateinit variable. Let’s decusses about some don’t condition.</p><h4>❌Dont’s</h4><p>What happen when we access initialization variable before initalzation?<br>Ans. NO :(</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/899465b22c8250254415a388f5b7dcfa/href">https://medium.com/media/899465b22c8250254415a388f5b7dcfa/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GKf_Nnw5yxkOy-RqjcJMxw.png" /></figure><p>You will get UninitializedPropertyAccessException. Almost same as nullPointerException. For checking that property is initialized or not you can check by “<strong>isInitialized”.</strong></p><h4>✅Do’s</h4><p>Can we do lateinit initialization multiple time?<br>Ans. YES :)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b1618deacf9c5962ce7af03ddfd7aaaf/href">https://medium.com/media/b1618deacf9c5962ce7af03ddfd7aaaf/href</a></iframe><h4>❌Dont’s</h4><p>Can we create lateinit of val type?<br>Ans. NO :(</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/41495cda9398ab9ed6ab6e35147e162c/href">https://medium.com/media/41495cda9398ab9ed6ab6e35147e162c/href</a></iframe><h4>❌Dont’s</h4><p>Can lateinit modefire is allowed for Primitive data type?<br>Ans. No :(</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ef7eb20c4215d768be00ea0ea2969fc/href">https://medium.com/media/9ef7eb20c4215d768be00ea0ea2969fc/href</a></iframe><h4>❌Dont’s</h4><p>Can lateinit modefire be nullable type?<br>Ans. No :(</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/51e836644539f03f3dc643cfd5e162cc/href">https://medium.com/media/51e836644539f03f3dc643cfd5e162cc/href</a></iframe><h4>Lazy in kotlin</h4><p>As the name said lazy procrastinate work, do work when it is very impotent . Just before deadline. Same lazy property do initialization of lazy variable(Object) when it access(Used) first time. For Example If one class dep. on two class then if you create object of that class normally then Creation of that class take more time as compare to lazy object creation way.</p><h4>✅Do’s :)</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/88389cf00e332e9356bedae947165a86/href">https://medium.com/media/88389cf00e332e9356bedae947165a86/href</a></iframe><h4>❌Dont’s</h4><p>Lazy property can we of var type?<br>Ans. No :(</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/88389cf00e332e9356bedae947165a86/href">https://medium.com/media/88389cf00e332e9356bedae947165a86/href</a></iframe><h4>✅ Facts</h4><blockquote>“A lateinit property can’t have a custom getter whereas a lazy property has a block that gets executed whenever the first time that property is called.”</blockquote><blockquote>“Since the lazy block returns an object which implements the Lazy interface, we can check if the variable is initialised or not in the case of the lazy property also but for that, we need to split the lazy call.”</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fd413fdc32ec4c84497e34296800d63/href">https://medium.com/media/2fd413fdc32ec4c84497e34296800d63/href</a></iframe><h4>✅Do’s :)</h4><p>Lazy Property can be of primitive date types?<br>Ans. yes :)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/578d9b025f0fcff188988547071a1f37/href">https://medium.com/media/578d9b025f0fcff188988547071a1f37/href</a></iframe><h4>✅Do’s :)</h4><p>Thready safety?<br>Ans. We can’t define the thready safety in case of lateinit property but in case of lazy, we can choose between SYNCHRONIZED, PUBLICATION and NONE.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec494e6d13785afab9fd51aa828774ac/href">https://medium.com/media/ec494e6d13785afab9fd51aa828774ac/href</a></iframe><h4>✅Do’s :)</h4><p>Lazy can be nullable?<br>Ans. Yes :)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/88389cf00e332e9356bedae947165a86/href">https://medium.com/media/88389cf00e332e9356bedae947165a86/href</a></iframe><h4>Summary</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wt9w_DK4jlcWqRf3AMkeng.png" /><figcaption>Lazy vs Lateinit</figcaption></figure><blockquote>“Keep Exploring, Keep Learing, Keep sharing”</blockquote><p>Happy Coding<br>Thank you. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76f50f1833bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to reduce GPU overdraw]]></title>
            <link>https://marvel999.medium.com/how-to-reduce-gpu-overdraw-25ce6130d8e2?source=rss-7aaf76238f6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/25ce6130d8e2</guid>
            <dc:creator><![CDATA[Manish Singh]]></dc:creator>
            <pubDate>Tue, 21 Sep 2021 22:06:36 GMT</pubDate>
            <atom:updated>2021-09-23T07:46:52.158Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys, In this article, we will try to learn about GPU overdraw. we will discuss all what, how, and solutions. So Make yourself ready to deep-dive into AndroidWorld.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cmQmlxik0ZdOmOeb4xbrvw.png" /><figcaption>Reduce GPU overdraw.</figcaption></figure><h4>Introduction</h4><p>whenever we read a new thing we have one question what is this(topic)? so let&#39;s start a discussion with <strong>what is GPU overdraw?</strong></p><p>An app may draw the same pixel more than once within a single frame, an event called <em>overdraw</em>. <strong>Overdraw is usually unnecessary</strong>, and best eliminated. It manifests itself as a performance problem by wasting GPU time to render pixels that don’t contribute to what the user sees on the screen.</p><p>The next question is how we will analyze that my android app has a GPU overdraw problem or not?</p><p><strong>How to diagnose GPU Overdraw?</strong></p><p>Steps to enable GPU Overdraw</p><ol><li>On your device, go to <strong>Settings</strong> and tap <strong>Developer Options</strong>.</li><li>Scroll down to the <strong>Hardware accelerated rendering</strong> section, and select <strong>Debug GPU Overdraw</strong>.</li><li>In the <strong>Debug GPU overdraw</strong> dialog, select <strong>Show overdraw areas</strong>.</li></ol><h4><strong>Color Code(</strong>Number of times<strong> </strong>Overdrawn)</h4><p><strong>True color:</strong> No overdraw</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*n7t8cv1BfJvwgjEt.png" /></figure><ul><li><strong>Blue:</strong> Overdrawn 1 time</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*dy5eQknsdhrD-DBf.png" /></figure><ul><li><strong>Green:</strong> Overdrawn 2 times</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*vTlx9eEm_BjeIOma.png" /></figure><ul><li><strong>Pink:</strong> Overdrawn 3 times</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/60/0*qigQ9xEHR-SVWaFX.png" /></figure><ul><li><strong>Red:</strong> Overdrawn 4 or more times</li></ul><h4>Causes of GPU Overdraw</h4><ul><li>Removing unneeded backgrounds in layouts.</li><li>Flattening the view hierarchy.</li><li>Reducing transparency.</li></ul><p>Now we find the place where our app has GPU overdraw now the problem is how to approach this problem so that we can improve GPU overdraw.</p><h4><strong>Layout inspector</strong></h4><p>This is one of the awesome tools in the android studio to visualize our layout in 3D witch helps us to find the problem why GPU overdraw is coming in this screen.</p><p>How to open layout inspector in android studio.<br>Mac and windows -&gt; Press Shift twice<br>Then type “Layout inspector” inside the search field</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VVTxf2Rm-7l9qEr_jhaCTA.png" /><figcaption>Layout inspector</figcaption></figure><p>Click on the 3D View button of the screen by clicking on the marked place of the above image and you can adjust the 3D View by just using the seekbar marked in the above image.</p><p>Now analyze is there any problem listed in “Causes of GPU Overdraw” If yes then congratulations 🎉 you find the problem by which GPU overdraw is occurring in your app.</p><h4>Solution For GPU Overdraw Problem</h4><ol><li><strong>Removing unneeded backgrounds in layouts.</strong></li></ol><p>By default, a layout does not have a background, which means it does not render anything directly by itself. When layouts do have backgrounds, however, they may contribute to overdraw.</p><p>Removing unnecessary backgrounds is a quick way of improving rendering performance. An unnecessary background may never be visible because it’s completely covered by everything else the app is drawing on top of that view. For example, the system may entirely cover up a parent’s background when it draws child views on top of it.</p><p>To find out why you’re overdrawing, walk through the hierarchy in the <a href="https://developer.android.com/studio/debug/layout-inspector">Layout Inspector</a> tool. As you do so, look out for any backgrounds you can eliminate because they are not visible to the user. Cases where many containers share a common background color offer another opportunity to eliminate unneeded backgrounds: You can set the window background to the main background color of your app, and leave all of the containers</p><p><strong>2. Flattening the view hierarchy.</strong></p><p>Modern layouts make it easy to stack and layer views to produce beautiful design. However, doing so can degrade performance by resulting in overdraw, especially in scenarios where each stacked view object is opaque, requiring the drawing of both seen and unseen pixels to the screen.</p><p>If you encounter this sort of issue, you may be able to improve performance by optimizing your view hierarchy to reduce the number of overlapping UI objects. For more information about how to accomplish this, see <a href="https://developer.android.com/topic/performance/optimizing-view-hierarchies">Optimize view hierarchies</a>.</p><p><strong>3. Reducing transparency.</strong></p><p>Rendering of transparent pixels on screen, known as alpha rendering, is a key contributor to overdraw. Unlike standard overdraw, in which the system completely hides existing drawn pixels by drawing opaque pixels on top of them, transparent objects require existing pixels to be drawn first, so that the right blending equation can occur. Visual effects like transparent animations, fade-outs, and drop shadows all involve some sort of transparency, and can therefore contribute significantly to overdraw. You can improve overdraw in these situations by reducing the number of transparent objects you render. For example, you can get gray text by drawing black text in a <a href="https://developer.android.com/reference/android/widget/TextView">TextView</a> with a translucent alpha value set on it. But you can get the same effect with far better performance by simply drawing the text in gray.</p><h4>Reduce GPU overdraw example app</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e4fa5d65f7b2ea38da45a407ebc1e62d/href">https://medium.com/media/e4fa5d65f7b2ea38da45a407ebc1e62d/href</a></iframe><p><strong>GPU Overdraw of above code</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*AMK2eMHXxVeHhfJdfgNGCg.jpeg" /></figure><p><strong>Enhance code</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/007e03dd82c034e11dd73f01e31133eb/href">https://medium.com/media/007e03dd82c034e11dd73f01e31133eb/href</a></iframe><p>Reduce GPU Overdraw</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*ZCUfOaq2alBWDA5dAJT3tQ.jpeg" /></figure><h4><strong>Enhance your knowledge</strong></h4><ol><li>Android official articles: <a href="https://developer.android.com/topic/performance/rendering/overdraw">https://developer.android.com/topic/performance/rendering/overdraw</a></li><li>Medium blog:- <a href="https://medium.com/android-news/reduce-overdraw-from-your-android-application-6cf15f4aa85f">https://medium.com/android-news/reduce-overdraw-from-your-android-application-6cf15f4aa85f</a></li><li>Deep discussion on GPU overdraw: <a href="https://google-developer-training.github.io/android-developer-advanced-course-practicals/unit-2-make-your-apps-fast-and-small/lesson-4-performance/4-1b-p-debug-gpu-overdraw-and-layout-inspector/4-1b-p-debug-gpu-overdraw-and-layout-inspector.html">https://google-developer-training.github.io/android-developer-advanced-course-practicals/unit-2-make-your-apps-fast-and-small/lesson-4-performance/4-1b-p-debug-gpu-overdraw-and-layout-inspector/4-1b-p-debug-gpu-overdraw-and-layout-inspector.html</a></li></ol><p>Connect with me on LinkedIn and Instagram<br><a href="https://www.linkedin.com/in/manish-singh-150368168/">https://www.linkedin.com/in/manish-singh-150368168/</a><br><a href="https://www.instagram.com/wrapx_android_web/?r=nametag">https://www.instagram.com/wrapx_android_web/?r=nametag</a></p><p>Thank you<br>Happy coding!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25ce6130d8e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Create ArcProgressBar In Android(Kotlin)]]></title>
            <link>https://marvel999.medium.com/how-to-create-arcprogressbar-in-android-kotlin-ce4eb09d0d93?source=rss-7aaf76238f6d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce4eb09d0d93</guid>
            <category><![CDATA[android-libraries]]></category>
            <category><![CDATA[android-customview]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[arc-progress-bar]]></category>
            <dc:creator><![CDATA[Manish Singh]]></dc:creator>
            <pubDate>Mon, 14 Jun 2021 06:54:19 GMT</pubDate>
            <atom:updated>2021-06-14T06:54:19.840Z</atom:updated>
            <content:encoded><![CDATA[<p>In this Tech-Article, We will Implement ArcProgressBar In Android(Kotlin). There is Two Way to Implement ArcProgressBar In Android.</p><ol><li>By creating a custom view.</li><li>By using android library.</li></ol><p>In This Article, We will use the easiest way to Implement ArcProgressbar. We will use <a href="https://github.com/Marvel999/Arc-Progressbar-lib">ArcProgressbar_lib</a> Library For Implement ArcProgressbar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*wCgxz6i03UKk4XHJAfPC2w.png" /><figcaption>Created By Github:-Marvel999</figcaption></figure><h4>Add repo. In Project build. Gradle File</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c97b7f9a40a8c8559d64e91dc451ab3d/href">https://medium.com/media/c97b7f9a40a8c8559d64e91dc451ab3d/href</a></iframe><h4>Add repo. In Module build. Gradle File</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cab04661ab8e7a563d1b3fa017026226/href">https://medium.com/media/cab04661ab8e7a563d1b3fa017026226/href</a></iframe><h4>Add This code In Activity XML File</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed39ae62f73d93e54c05c24db12da603/href">https://medium.com/media/ed39ae62f73d93e54c05c24db12da603/href</a></iframe><p>Use an app: before adding a tag. Use command ctrl+click on any app: tag to know more about the tag and its documentation(comment) provided by the library creator.</p><h4>Change Progress of Progressbar during run time using Kotlin</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cff83b232ab0c922d693469dafc5457c/href">https://medium.com/media/cff83b232ab0c922d693469dafc5457c/href</a></iframe><p>The name is explaining It’s work like</p><ol><li>setColor -&gt; It set Background color of progressbar.</li><li>setProgressThikness -&gt; To Change thikness of Progressbar.</li><li>setProgressBackgroundColor -&gt; To change color of arc before Progress.</li><li>setProgressColor -&gt; To Change color for indicating Progress.</li><li>setProgress -&gt; To Set Progress At runtime(Without Animation).</li><li>setProgressWithAnimation -&gt; This will change progress from the initial position to final position with smooth animation.</li></ol><p>I hope this is helpful for you.</p><p>Thank you</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce4eb09d0d93" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>