<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Muhammad Danish on Medium]]></title>
        <description><![CDATA[Stories by Muhammad Danish on Medium]]></description>
        <link>https://medium.com/@daanidev?source=rss-e7af87805014------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*kUqOrl9Mn1rCtE_lzwnapg.jpeg</url>
            <title>Stories by Muhammad Danish on Medium</title>
            <link>https://medium.com/@daanidev?source=rss-e7af87805014------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 02:39:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@daanidev/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[Creating Kotlin Multi-platform App Using Fleet by Jet brain’s]]></title>
            <link>https://daanidev.medium.com/creating-kotlin-multi-platform-app-using-fleet-by-jet-brains-9a4064d2c598?source=rss-e7af87805014------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a4064d2c598</guid>
            <category><![CDATA[kotlin-multiplatform]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[jetbrains]]></category>
            <category><![CDATA[jetpack-compose-tutorial]]></category>
            <dc:creator><![CDATA[Muhammad Danish]]></dc:creator>
            <pubDate>Mon, 27 Nov 2023 14:43:31 GMT</pubDate>
            <atom:updated>2023-11-27T14:43:31.458Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Dev’s, in this article i am going to walk through you Fleet by jet brain’s, so its bascially IDE by jet brain’s to develop KMP app’s so you don’t need to develop KMP apps using android studio so lets get started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KSjM-xt9cAevhpA0L1EDOg.png" /><figcaption><a href="https://blog.jetbrains.com/kotlin/2023/11/kotlin-multiplatform-tooling-in-fleet/">https://blog.jetbrains.com/kotlin/2023/11/kotlin-multiplatform-tooling-in-fleet/</a></figcaption></figure><p>1st visit: <a href="https://www.jetbrains.com/help/kotlin-multiplatform-dev/fleet.html#get-started-with-fleet">https://www.jetbrains.com/help/kotlin-multiplatform-dev/fleet.html#get-started-with-fleet</a> and download the required tools.</p><p>After that visit: <a href="https://kmp.jetbrains.com/">https://kmp.jetbrains.com/</a> to create your desired KMP project. So it will download the project for you.</p><p>Now open your project in the Fleet and navigate to the composeApp and inside the composeApp directory navigate to the commonMain then kotlin directory and copy the below code,</p><p>After that Copy Login Screen code from here:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3296198e95d092bb2ad4392d0d98ed3f/href">https://medium.com/media/3296198e95d092bb2ad4392d0d98ed3f/href</a></iframe><p>Now run the app by changing to each app like goto androidMain, iosMain and desktopMain then change the function name here to LoginScreen.</p><p>Finally the app output is here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P03suM3nBUYfUeVIjDon3g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a4064d2c598" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating ExoPlayer in Jetpack Compose Android]]></title>
            <link>https://daanidev.medium.com/integrating-exoplayer-in-jetpack-compose-android-8c75d4d7ea3d?source=rss-e7af87805014------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c75d4d7ea3d</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[exoplayer]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Muhammad Danish]]></dc:creator>
            <pubDate>Sat, 23 Apr 2022 16:46:08 GMT</pubDate>
            <atom:updated>2022-04-23T16:46:08.385Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BcAuoNhFoXGHeXBsYYyBRA.png" /><figcaption><a href="https://9to5google.com/2021/07/28/jetpack-compose-1-0-android-ui-kotlin/">https://9to5google.com/2021/07/28/jetpack-compose-1-0-android-ui-kotlin/</a></figcaption></figure><p>Hi Android Devs in this article i am going to show you how you can integrate latest exoplayer library in your jetpack compose android app. My code does not contains any deprecated code in integration of exoplayer.</p><p>First declare exoplayer library in your gradle file:</p><pre>implementation &quot;com.google.android.exoplayer:exoplayer:2.17.1&quot;</pre><p><strong>Note:</strong> only use latest library of exoplayer else you will face errors in your code.</p><p>Now add Internet permission in your android manifest file:</p><pre>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;</pre><p>If you face below exception:</p><p>com.google.android.exoplayer2.upstream.HttpDataSource$CleartextNotPermittedException</p><p>then add line in your application tag in manifest file.</p><pre>android:usesCleartextTraffic=&quot;true&quot;</pre><p>Now go to your activity and write below code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e0f904d3acd6000630a2b84d28f2079/href">https://medium.com/media/0e0f904d3acd6000630a2b84d28f2079/href</a></iframe><p>Now call uiContainer() from setContent{} inside onCreate method of your activity.</p><p>Output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vXOffrD3HKwx_RHderDiCg.png" /></figure><p>Check this repository for full code:</p><p><a href="https://github.com/DaaniDev/jetpack_compose_animations">GitHub - DaaniDev/jetpack_compose_animations</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c75d4d7ea3d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swipe to delete in Jetpack Compose Lazy Column Android]]></title>
            <link>https://daanidev.medium.com/swipe-to-delete-in-jetpack-compose-android-ca935a209c61?source=rss-e7af87805014------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca935a209c61</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[jetpack]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Muhammad Danish]]></dc:creator>
            <pubDate>Sun, 09 Jan 2022 10:57:01 GMT</pubDate>
            <atom:updated>2022-01-09T11:09:27.767Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eEvF-1Ov91ZcMudIxJYIlw.png" /><figcaption><a href="https://android-developers.googleblog.com/2020/08/announcing-jetpack-compose-alpha.html">https://android-developers.googleblog.com/2020/08/announcing-jetpack-compose-alpha.html</a></figcaption></figure><p>Hi devs in this article i am going to show you how you can achieve swipe to delete functionality in lazycolumn/ lazyrow (aka Recyclerview) in jetpack compose. In case of recyclerview with xml we need to define customer listener to listen swipe on an item but in case of jetpack compose we don’t need to define custom listener. In jetpack compose we have built in functionality to listen swipes <strong>SwipeToDismiss() </strong>inside our lazycolumn or lazyrow. You can more read about it here:</p><p><a href="https://developer.android.com/training/wearables/components/swipe-to-dismiss">https://developer.android.com/training/wearables/components/swipe-to-dismiss</a></p><p>Remember one thing always use items() instead of itemsIndexed() inside lazycolumn/lazyrow to populate content of list when you are working with SwipeToDismiss. I faced unexpected error when i tried to implement SwipeToDismiss with itemsIndexed() inside my lazycolumn then on swipetodelete its deleting all items instead of just deleting single item.</p><p>Incase of working with items() you can face below exception which i faced:</p><p><strong>java.lang.IllegalArgumentException: Key 0 was already used. If you are using LazyColumn/Row please make sure you provide a unique key for each item.</strong></p><p>So working with items() inside lazycolum/lazyrow make sure you are generating unique key for every item which you are going to add in the lazycolumn/lazyrow.</p><p>In my example i am not fetching the list from server nor i am using static list, i am adding items in list at runtime so to avoid above exception i have delcared global variable to generate id of every item and created a data class for my item which is below:</p><pre>data class NotesItem(var id:Int, var title:String)</pre><p>Now how to add divider in lazycolumn/lazyrow? For this you need to define Divider() inside your lazycolumn/lazyrow</p><pre><em>Divider</em>(Modifier.<em>fillMaxWidth</em>(), Color.DarkGray)</pre><p>Now SwipeToDismiss takes few parameters which are as:</p><p><strong>state:</strong> to define current state of dismiss<br><strong>modifier:</strong> to define height/width/padding etc<br><strong>directions:</strong> it takes set of directions which we want to implement<br>1- DismissDirection.EndToStart<br>2- DismissDirection.StartToEnd<br><strong>background:</strong> you need to define here color and icon of your swiping item<br><strong>dismissThresholds:</strong> its handle on how much fractional swipe you want to change your swiping item color and item only dismiss when it current swipe matches this threshold.<br><strong>dismissContent:</strong> it is responsible to show your content on screen.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e436f7f5ae805c0b0dfc315da3f7a59d/href">https://medium.com/media/e436f7f5ae805c0b0dfc315da3f7a59d/href</a></iframe><p>Result will be:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*cb0PgSg_kaxF-zDZ-2TcVg.png" /></figure><p>Checkout this repository for the source code, if you like it then give it a star:</p><p><a href="https://github.com/DaaniDev/jetpack_compose_animations">GitHub - DaaniDev/jetpack_compose_animations</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca935a209c61" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Webview in Jetpack Compose Android]]></title>
            <link>https://medium.com/geekculture/webview-in-jetpack-compose-android-4ac0ca70fb4d?source=rss-e7af87805014------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ac0ca70fb4d</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Muhammad Danish]]></dc:creator>
            <pubDate>Thu, 06 Jan 2022 18:04:17 GMT</pubDate>
            <atom:updated>2022-01-07T07:31:01.742Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eEvF-1Ov91ZcMudIxJYIlw.png" /><figcaption><a href="https://android-developers.googleblog.com/2020/08/announcing-jetpack-compose-alpha.html">https://android-developers.googleblog.com/2020/08/announcing-jetpack-compose-alpha.html</a></figcaption></figure><p>In this article i am going to show you how you can create webview in your android app if you are working with jetpack compose and how you can send intent to external browsers to load web url. Incase of xml we need to define webview tag inside our layout then we need to use that inside our activity/fragment. But as we know in jetpack compose you dont need to define the xml file.</p><p>In jetpack compose there is no function/class to create webview because webview is part of android view itself. To create webview inside fragment or activity you need to define the webview like below code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ef48eaf06b31a46080b6bca3797b1a5/href">https://medium.com/media/8ef48eaf06b31a46080b6bca3797b1a5/href</a></iframe><p>Thats it below is output of the above function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ksWChgsn1NM05OYieupBew.png" /></figure><p>Now how can we send web url to other apps to load it? For this we need to send an intent to tell other browsers to load our web url.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d55266db2fdc975f432643bba306b41e/href">https://medium.com/media/d55266db2fdc975f432643bba306b41e/href</a></iframe><p>Output of the above code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KMsWMXwDiDWKQiEosnrxpA.png" /></figure><p><a href="https://github.com/DaaniDev/jetpack_compose_animations">GitHub - DaaniDev/jetpack_compose_animations</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ac0ca70fb4d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/webview-in-jetpack-compose-android-4ac0ca70fb4d">Webview in Jetpack Compose Android</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bottom Navigation in Jetpack Compose Android]]></title>
            <link>https://medium.com/geekculture/bottom-navigation-in-jetpack-compose-android-9cd232a8b16?source=rss-e7af87805014------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cd232a8b16</guid>
            <category><![CDATA[jetpack-navigation]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Muhammad Danish]]></dc:creator>
            <pubDate>Sun, 21 Nov 2021 13:09:53 GMT</pubDate>
            <atom:updated>2021-11-22T07:23:08.892Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HROxO8CCRWk-wOqKvPcDrQ.png" /><figcaption>src: <a href="https://learn.vonage.com/blog/2021/06/15/a-better-way-of-creating-android-views-with-jetpackcompose/">https://learn.vonage.com/blog/2021/06/15/a-better-way-of-creating-android-views-with-jetpackcompose/</a></figcaption></figure><p>Hi Devs, in this article i am going to show you how you can design bottom navigation bar in jetpack compose using navigation component(nav controller and nav host).</p><p>For this article I have designed bottom navigation bar just like LinkedIn. In jetpack compose you don’t need to define your navigation under navigation directory and create its navigation graph. Navigation in jetpack compose is different from xml navigation where we need to define the fragments and graph. Add below dependency in your app level gradle file and rebuild your app.</p><pre>implementation &quot;androidx.navigation:navigation-compose:2.4.0-beta02&quot;</pre><p>After rebuilding your app create a separate directory for bottom navigation related files. Now create sealed class with name BottomNavItem with bottom navigation item title, item icon and item route which we will use later for navigation between screens just like below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7ae2b07fb6186217c8f8f7200997a30/href">https://medium.com/media/c7ae2b07fb6186217c8f8f7200997a30/href</a></iframe><p>In jetpack compose navigation we are not using fragments so you need to define the screen content, so create a new file with name BottomNavContentScreens.kt and add the below code in it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bbc16b676877259d8df8f782ae2057f0/href">https://medium.com/media/bbc16b676877259d8df8f782ae2057f0/href</a></iframe><p>I have added only single text with route name so that you can see the navigation in action.</p><p>Now we need to create BottomNavActivity and copy below composable function for handling navigation graph:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4112606b778b52d6198e281c1cf36248/href">https://medium.com/media/4112606b778b52d6198e281c1cf36248/href</a></iframe><p>Now you need to create new function to define bottom navigation, its item, handling bottom navigation backstack and defining start destination.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4540c8d09a308c6a5576ef88095f3e13/href">https://medium.com/media/4540c8d09a308c6a5576ef88095f3e13/href</a></iframe><p>Now you need to create new composable function with Scaffold() so that you can define bottom navigation bar location, see blow:</p><pre>@Composable<br>fun MainScreenView(){<br>    val navController = <em>rememberNavController</em>()<br>    <em>Scaffold</em>(<br>        bottomBar = <strong>{ </strong><em>BottomNavigation</em>(navController = navController) <strong>}<br>    </strong>) <strong>{<br><br>        </strong><em>NavigationGraph</em>(navController = navController)<br>    <strong>}<br></strong>}</pre><p>Thats it now at last just call the MainScreenView() function from oncreate method of your activity:</p><pre>override fun onCreate(savedInstanceState: Bundle?) {<br>    super.onCreate(savedInstanceState)<br>    <em>setContent </em><strong>{<br>        </strong><em>MainScreenView</em>()<br>    <strong>}<br></strong>}</pre><p>Finally the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jgbD5XAqMLDWQneR3FsMhQ.png" /></figure><p>You can check this repository for bottom navigation source code:</p><p><a href="https://github.com/DaaniDev/jetpack_compose_animations">GitHub - DaaniDev/jetpack_compose_animations</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cd232a8b16" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/bottom-navigation-in-jetpack-compose-android-9cd232a8b16">Bottom Navigation in Jetpack Compose Android</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Add/Remove in LazyColumn List (aka Recyclerview) Jetpack Compose]]></title>
            <link>https://medium.com/geekculture/add-remove-in-lazycolumn-list-aka-recyclerview-jetpack-compose-7c4a2464fc9f?source=rss-e7af87805014------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c4a2464fc9f</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[jetpack]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <dc:creator><![CDATA[Muhammad Danish]]></dc:creator>
            <pubDate>Sun, 07 Nov 2021 16:29:19 GMT</pubDate>
            <atom:updated>2021-11-10T07:57:34.469Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HROxO8CCRWk-wOqKvPcDrQ.png" /><figcaption><a href="https://learn.vonage.com/blog/2021/06/15/a-better-way-of-creating-android-views-with-jetpackcompose/">https://learn.vonage.com/blog/2021/06/15/a-better-way-of-creating-android-views-with-jetpackcompose/</a></figcaption></figure><p>Hey Android Devs, as you know jetpack compose is rapidly growing and companies are adapting this to design their android apps. Creating list is very important topic of jetpack compose because in every app we need to create list whether vertical or horizontal. As we know before jetpack compose we need to use recyclerview widget to create list, in recyclerview we need to setup its item xml, layout manager, adapter to show the content in the list, but in jetpack compose we don’t need to create item xml, layout manager and its separate adapter.</p><p>There are two types of built-in functions for creating list in jetpack compose</p><p>1- <strong>LazyColumn </strong>this will create vertical list</p><p>2- <strong>LazyRow </strong>this will create horizontal list</p><ul><li>Wait a minute if we don’t need to create adapter then how can we notify our list about data insertion or deletion or updation?</li></ul><p>Don’t worry instead of creating simple mutable list you need to create <em>mutableStateListOf</em>&lt;”DataType”&gt;()</p><p>Now below is the code for the simple insertion and deletion from lazycolumn.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b83260e9416ebdc31fd16d8e54432865/href">https://medium.com/media/b83260e9416ebdc31fd16d8e54432865/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zfq4el92tmZExJJflA-XpQ.png" /><figcaption>output of the above program lazyColumn</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c4a2464fc9f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/add-remove-in-lazycolumn-list-aka-recyclerview-jetpack-compose-7c4a2464fc9f">Add/Remove in LazyColumn List (aka Recyclerview) Jetpack Compose</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taking Screenshot in Android Programmatically]]></title>
            <link>https://medium.com/geekculture/taking-screenshot-in-android-programmatically-29686973f842?source=rss-e7af87805014------2</link>
            <guid isPermaLink="false">https://medium.com/p/29686973f842</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Muhammad Danish]]></dc:creator>
            <pubDate>Fri, 23 Jul 2021 09:13:28 GMT</pubDate>
            <atom:updated>2021-07-28T08:14:11.023Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*43hwiZ9cXwGWZorD6WDalQ.jpeg" /><figcaption><a href="https://www.pexels.com/search/image/">https://www.pexels.com/search/image/</a></figcaption></figure><p>Hi android developer in this article I am going to show you how you can take screenshot of your app layout programmatically using Googles new library function. We need screenshot of our layout to perform specific operation like if you want to pass that image to Machine Learning model then you need to change image dimension because Machine Learning model takes image in specific dimension on which they are trained.</p><p>Previously to capture screenshot of layout we need to write couple of lines of code but now we need to write only three lines of code.</p><p>1st you need to create bitmap of your layout then you need to copy its pixels, see below code for better understanding.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8a5b1ec019d2891782ccef338e0d086b/href">https://medium.com/media/8a5b1ec019d2891782ccef338e0d086b/href</a></iframe><p>If you face any issue then please comment on it so that I can help you with that issue.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29686973f842" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/taking-screenshot-in-android-programmatically-29686973f842">Taking Screenshot in Android Programmatically</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Storing Json Response in Room Database Android]]></title>
            <link>https://medium.com/geekculture/storing-json-response-in-room-database-android-be9550728b54?source=rss-e7af87805014------2</link>
            <guid isPermaLink="false">https://medium.com/p/be9550728b54</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[room]]></category>
            <category><![CDATA[kotlin-coroutines]]></category>
            <dc:creator><![CDATA[Muhammad Danish]]></dc:creator>
            <pubDate>Sat, 17 Jul 2021 10:06:05 GMT</pubDate>
            <atom:updated>2021-07-28T08:14:09.020Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*ZO35I_lOVEnqJ-6bMO6w3Q.png" /></figure><p>Room database is preferred by developers now a days due to its speedy response, it does not take much space as compare to realm and kotlin coroutines supports room database. I have seen many developers who are stuck on storing whole json object in room database android using kotlin.</p><p>Its quite simple to store whole json whether its in object format or in array format. You just need to setup the database by creating Database handler, Database Dao and Database tables.</p><p>Now let suppose you want to store user information when they login in to your app to maintain user session.</p><p>Add below Gson dependency in your gradle file:</p><pre>implementation &#39;com.google.code.gson:gson:2.8.6&#39;</pre><p><strong>Step 1: </strong><br>You need to create data class of login response.</p><p><strong>Step 2:</strong><br>You need to create Type converter class of login response which is look like below code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b2dad543cb99fc3bab2c442f477af828/href">https://medium.com/media/b2dad543cb99fc3bab2c442f477af828/href</a></iframe><p><strong>Step 3: </strong><br>You need to tell your database handler class about this type converter so room can be able to store whole json object.</p><pre>@TypeConverters(LoginConverter::class)</pre><p>You need to add this annotation above your database handler class name. Now your app is able to store the json response in room database.</p><p>If you face any issue then leave comment i will answer your query.<br>Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be9550728b54" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/storing-json-response-in-room-database-android-be9550728b54">Storing Json Response in Room Database Android</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrate Google Maps in Jetpack Compose List]]></title>
            <link>https://medium.com/geekculture/integrate-google-maps-in-jetpack-compose-list-681c97ec788f?source=rss-e7af87805014------2</link>
            <guid isPermaLink="false">https://medium.com/p/681c97ec788f</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[google-maps]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Muhammad Danish]]></dc:creator>
            <pubDate>Sun, 11 Jul 2021 14:04:44 GMT</pubDate>
            <atom:updated>2021-07-14T14:21:25.901Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BpjHHwArjwrlDFiq_i0HzA.jpeg" /></figure><p>In this article I am going to show you how you can add google maps inside jetpack compose list. I recommend you to read my previous article on integration of google maps in jetpack compose android.</p><p><a href="https://daanidev.medium.com/google-maps-in-jetpack-compose-android-ae7b1ad84e9">https://daanidev.medium.com/google-maps-in-jetpack-compose-android-ae7b1ad84e9</a></p><p>So, now you just need to create a project with jetpack compose empty activity and add these libraries for google maps</p><pre>implementation(&quot;com.google.android.libraries.maps:maps:3.1.0-beta&quot;)<br>implementation(&quot;com.google.maps.android:maps-v3-ktx:2.2.0&quot;)<br>implementation(&quot;androidx.fragment:fragment:1.3.2&quot;)</pre><p>Now you need to create layout package inside res package and create new resource file in it with following code</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;androidx.constraintlayout.widget.ConstraintLayout<br>    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:layout_height=&quot;match_parent&quot;&gt;<br><br>    &lt;androidx.fragment.app.FragmentContainerView<br>        xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>        android:id=&quot;@+id/map&quot;<br>        android:name=&quot;com.google.android.gms.maps.SupportMapFragment&quot;<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_height=&quot;match_parent&quot;/&gt;<br><br>&lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;</pre><p>Now Create MapUtils file and add below code in that file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/69c683f3c39710aff0a8d3032313d057/href">https://medium.com/media/69c683f3c39710aff0a8d3032313d057/href</a></iframe><p>After that create data class which will be responsible to add dynamic data in your list</p><pre>data class MapModel (val pickUp:LatLng,val destination:LatLng,val date:String,val time:String<br>,val pickUpTitle:String,val destinationTitle:String)</pre><p>After creating the data class create your repository class and add the following function in it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/740dd0462c641621f4b8d6f24c9a50a3/href">https://medium.com/media/740dd0462c641621f4b8d6f24c9a50a3/href</a></iframe><p>Now add below code in your theme block inside oncreate method of your mainactivity.kt</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6bb3a136af66ee29bbd24e1e66d9e7db/href">https://medium.com/media/6bb3a136af66ee29bbd24e1e66d9e7db/href</a></iframe><p>Now finally add below composable function in your mainactivity.kt</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bccfde828e4fec7de5cf2ee14c7c3d1b/href">https://medium.com/media/bccfde828e4fec7de5cf2ee14c7c3d1b/href</a></iframe><p>Don’t forgot to add below tags in your manifest file.</p><pre>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;</pre><pre>&lt;meta-data android:name=&quot;com.google.android.geo.API_KEY&quot;<br>    android:value=&quot;api_key&quot;/&gt;</pre><figure><img alt="Finally the output will be like this" src="https://cdn-images-1.medium.com/max/765/1*Gor34oWXYZI1dq2_1SwEuQ.jpeg" /><figcaption>Output Result</figcaption></figure><p>If you face any issue then check out Google Maps in JetPack Compose List</p><p><a href="https://github.com/DaaniDev/googlemapinsidelist_jetpackcompose.git">https://github.com/DaaniDev/googlemapinsidelist_jetpackcompose.git</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=681c97ec788f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/integrate-google-maps-in-jetpack-compose-list-681c97ec788f">Integrate Google Maps in Jetpack Compose List</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lottie Animations in Jetpack Compose Android]]></title>
            <link>https://daanidev.medium.com/lottie-animations-in-jetpack-compose-android-c471c234288e?source=rss-e7af87805014------2</link>
            <guid isPermaLink="false">https://medium.com/p/c471c234288e</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[lottie]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <dc:creator><![CDATA[Muhammad Danish]]></dc:creator>
            <pubDate>Sat, 29 May 2021 18:16:08 GMT</pubDate>
            <atom:updated>2021-07-14T03:08:31.445Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*1nqw5nBX6EWfWrDANvC3Ng.png" /><figcaption>Image copied from <a href="https://airbnb.design/lottie/">https://airbnb.design/lottie/</a></figcaption></figure><p>In todays article I am going to show you how you can use Lottie animations in android jetpack compose without using any layout xml tag. To use Lottie animation in android we have to declare it in xml tag. But in jetpack compose we do not create xml tags, we declare animation in @Composable function.</p><p>1st you have to add Lottie library in app level gradle file</p><pre><em>implementation </em>(&quot;com.airbnb.android:lottie-compose:1.0.0-beta07-1&quot;)</pre><p>After that you need to add below line in project level gradle file</p><pre>maven <strong>{<br>    </strong><em>url</em>=uri(&quot;https://oss.sonatype.org/content/repositories/snapshots/&quot;) <strong>}</strong></pre><p>i am assuming you will enable .kts while creating your project else you will face error in declaring above lines in gradle files.</p><p>After this you need to add below line in settings.gradle file else you will face compile time error</p><pre>maven <strong>{<br>    </strong><em>url</em>=uri(&quot;https://oss.sonatype.org/content/repositories/snapshots/&quot;) <strong>}</strong></pre><p>Modified settings.gradle.kts file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/07a1a413ec217e1024e409bd4f4025ce/href">https://medium.com/media/07a1a413ec217e1024e409bd4f4025ce/href</a></iframe><p>Now you have successfully integrated Lottie library now you need to create new directory under res and named it as raw and add Lottie animation file in this directory you can download Lottie animations from here : <a href="https://lottiefiles.com/">https://lottiefiles.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*2DXnFqFmh3VOyCPterYjCA.png" /></figure><p>Now you need to declare below code in @Composable function of your activity.</p><p>I have created a variable animationSpecs which will responsible for creating the animation on screen</p><p>To make it repeat and autoplay i created a new variable called animationState and pass these two variables to LottieAnimation() function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f9afb0545a554b3c8b9f30d4a43e8663/href">https://medium.com/media/f9afb0545a554b3c8b9f30d4a43e8663/href</a></iframe><p>Finally the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*sj2XrYi8VfI2zgmbt9_tuQ.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c471c234288e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>