<?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 Khadijahameed on Medium]]></title>
        <description><![CDATA[Stories by Khadijahameed on Medium]]></description>
        <link>https://medium.com/@khadijahameed415?source=rss-47637a32681f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zAfwO3m1nGPoiKtQhmhCDQ.png</url>
            <title>Stories by Khadijahameed on Medium</title>
            <link>https://medium.com/@khadijahameed415?source=rss-47637a32681f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 01:36:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@khadijahameed415/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 Coroutines — Part2]]></title>
            <link>https://medium.com/@khadijahameed415/kotlin-coroutines-part2-5e79fe42edf3?source=rss-47637a32681f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e79fe42edf3</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[coroutinescope]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[coroutine]]></category>
            <dc:creator><![CDATA[Khadijahameed]]></dc:creator>
            <pubDate>Fri, 03 Mar 2023 11:19:36 GMT</pubDate>
            <atom:updated>2023-03-03T11:34:49.507Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kotlin Coroutines — Part2</h3><p>Every coroutine has a<strong> <em>scope </em></strong><em>(</em>which defines boundary) and <strong><em>context</em> </strong>(which defines the behavior).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*80Hmxg43ui21ri1EcgjgdA.png" /></figure><blockquote>➊ <strong>Coroutines scope (Lifetime)</strong></blockquote><blockquote>⫸ it defines boundary, a way to keep track of all coroutines that run in it.<br>⫸ cancel or wait all coroutines.<br>⫸ the coroutines in that scope in one go before completion.</blockquote><p><em>Some coroutine scope are as follow:<br>Globalscope, viewModelscope, lifecyclescope.</em></p><p>1.1 <strong>Global scope:</strong><br> ‣ lifecycle of this scope is tied to the lifecycle of the whole application.<br> ‣ even when the application stops, some active coroutines will still be running.</p><p>1.2 <strong>viewModelScope:</strong><br> ‣ coroutine scope that’s attached with your ViewModel.<br> ‣ we don’t need to manually cancel it. whenever viewmodel is cleared, coroutines will be cancelled automatically .</p><p>1.3<strong> lifecycleScope:</strong><br> ‣ It’s attached with specific lifecycle like (activity’s lifecycle / fragment’s lifecycle).<br> ‣ whenever that <strong>lifecycle’s object is destroyed</strong>, it will be cancelled automatically.</p><blockquote>➋ <strong>Coroutines context (Threads)</strong></blockquote><blockquote>⫸ defines the behavior of a coroutine using these set of elements.<br>⫸ It includes a coroutine dispatcher that defines what thread/s the corresponding coroutine uses for it’s execution.</blockquote><p><strong>2.1</strong><em> </em><strong>Dispatchers :</strong><br>‣ It defines on which threads the coroutine will use for its execution. There are 4 types of dispatchers. Main, IO, Default, Unconfined.</p><p><strong><em>Main</em><br> </strong>When we need to perform UI related events. As UI can only change from main thread.<br> EX: Calling suspend functions, Call UI functions, Update Live Data<strong><br><em> IO</em><br> </strong>When we want to perform all the data related operations like networking, Read/Write from files, Fetching and posting data to the database.<br> EX: Database, Filo IO, Networking<strong><br><em> Default</em><br> </strong>we use Default, when sorting large list or complex long running calculations to do which can block / freeze the main thread. <br> EX: Sorting a list/ other algorithm, Parsing JSON, DiffUtils<br><strong><em>Unconfined</em><br> </strong>Unconfined coroutine dispatcher starts a coroutine in the caller thread, but only until the first suspension point. After suspension it resumes the coroutine in the thread that is fully determined by the suspending function that was invoked.<br> for more clarification,<br> It executes coroutine immediately on the current thread and later resumes it in whatever thread called resume. It is usually a good fit for things like intercepting regular non-suspending API or invoking coroutine-related code from blocking world callbacks.</p><p><strong>2.2</strong><em> </em><strong>Job :<br></strong>‣ A <em>Job</em> of a coroutine controls the lifecycle of coroutine.</p><p><strong><em>2.3 </em>Coroutine Exception <em>Handler:<br> </em></strong>‣ Coroutine Exception Handler handles only uncaught exceptions. Exceptions that were not handled in any other way.<br> It should be used in the root coroutine to handle all the child coroutine uncaught exceptions.</p><p><strong><em>2.4 Name:<br> </em></strong>‣ The name of the coroutine is use for debugging.</p><p><a href="https://medium.com/@khadijahameed415/kotlin-coroutines-part-1-6ad0ee20084e"><em>when &amp;why we use coroutines in Part I</em></a><em> </em><a href="https://medium.com/@khadijahameed415/kotlin-coroutines-part-1-6ad0ee20084e"><em>click here</em></a><em> :)</em></p><p>Tap the 👏 button if you found this article useful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e79fe42edf3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kotlin Coroutines — Part 1]]></title>
            <link>https://medium.com/@khadijahameed415/kotlin-coroutines-part-1-6ad0ee20084e?source=rss-47637a32681f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ad0ee20084e</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[threads]]></category>
            <category><![CDATA[coroutine]]></category>
            <category><![CDATA[app-development]]></category>
            <dc:creator><![CDATA[Khadijahameed]]></dc:creator>
            <pubDate>Fri, 03 Mar 2023 07:28:42 GMT</pubDate>
            <atom:updated>2023-03-03T11:36:15.461Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Kotlin Coroutines — Part 1</strong></h4><blockquote><strong>Introduction :</strong></blockquote><p>When &amp;why we use coroutines:</p><blockquote>Let’s start with <em>Threads</em> what actually thread is,</blockquote><p>‘<strong>In which context</strong>’ the sequence of instruction should be executed is thread. If we don’t use threading all instructions executed in single thread which is <strong>Main Thread.</strong></p><p>So, it is our responsibility to make sure that we are not blocking the main thread. we shouldn’t hold the main thread until long running tasks are completed. Because it freezes the app &amp; making it unresponsive.</p><p>In some cases, we use <strong>multi-thread </strong>approach. Like spell check works while typing in MS-word &amp; in android, network operations, heavy logical operations etc. Multi-threading in android is a challenge because switching threads and resuming tasks is not so easy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*YAY_IXh-0TpRf-tGXj6ZNg.jpeg" /></figure><p>Working on multiple tasks at the same time in easier way is<br>Kotlin Co routines.</p><p><strong>Now we learn step by step :</strong></p><p>⚀ what is coroutines?<br>⚁ why should it be preferred over threads?<br>⚂ How do we start/launch coroutines?<br>⚃ Coroutine Scope &amp; Context <strong><em>(In PART 2)</em></strong></p><blockquote><strong>Kotlin Coroutines :</strong></blockquote><p>⎆ Coroutines helps to implement functionality that can be <strong>suspended</strong> &amp; later <strong>resumed at specific point</strong> without blocking the thread.<br>⎆ Coroutines are not threads. It behaves like thread that’s why called ‘lightweight thread’.<br>⎆ Coroutines works on top of thread.</p><blockquote><strong>Why should it be preferred over threads?</strong></blockquote><p>Coroutines are a great solution to <strong>Long running tasks</strong> &amp; <strong>Main-safety:</strong></p><p><em>⎊</em> <strong><em>Long running tasks</em></strong> that take too long to block the main thread.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IMt_7_dJqcZdn8VDAXAiKA.jpeg" /></figure><p>As per above image, Whole process works on main thread. <br>First it runs Instruction 1 and if instruction 2 takes too much time for execution instruction 3 and 4… will be halt 🛑.<br> So, we should execute long running tasks in a separate thread &amp; for this we use coroutines.</p><p><strong><em>⎊</em></strong> <strong><em>Main-safety </em></strong>allows you to ensure that any <em>suspend function </em>(like network operation / disk operation) can be called from the main thread.<br> “<em>suspend function suspended at some point and later it resumed”</em></p><blockquote><strong>How do we start/launch coroutines?</strong></blockquote><p>These are functions in kotlin to start or launch the coroutines.</p><p>launch{ }, async{ }, runBlocking{ }</p><p>: ̗̀➛ <strong>launch</strong><br>🌠launch is use to start the coroutines.<br>🌠 launch is fire &amp; forget, It’s non blocking.<br>🌠 launch works sequentially.<br>🌠 launch will not block the thread and it’s not suspend function therefore it doesn’t wait for the result of launch and execute the other code.<br>🌠 launch return a job object.<br>🌠 To check launch’s completion. Assign that coroutine as a job and make it join() as job.join() to check when it’s complete.</p><p>: ̗̀➛ <strong>async</strong><br>💫 async is also used to start the coroutines.<br>💫 async is performing a task &amp; return a result via await() function.<br>💫 async function works parallel.<br>💫 async will not block the main thread but it wait for the result of async to run the other code.<br>💫 async returning result as Deferred &lt;T&gt; object of generic type.<br>💫 To check async’s completion/result . Assign that coroutine as a job and make it await as job.await().</p><h4>WHEN TO USE WHAT:</h4><p>“Use launch” when you don’t care the result.<br> “Use async” when you expect data in result from your coroutine.</p><p>: ̗̀➛ <strong>run Blocking</strong><br>⏳ It creates a scope and runs a coroutine in a blocking way. Means it blocks the current thread until all children’s coroutines complete their executions.<br> ⏳ Not recommend to use.<br> ⏳ The most suitable place for using <em>runBlocking</em> is the very top level of the application (in <em>main</em> function). Using it in <em>main</em> will ensure that the app will wait until all child jobs complete inside <em>runBlocking</em> complete.</p><p><a href="https://medium.com/@khadijahameed415/kotlin-coroutines-part2-5e79fe42edf3"><em>coroutine Scope &amp; coroutine context in Part II click here</em></a><em> :)</em></p><p>Tap the 👏 button if you found this article useful!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ad0ee20084e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Equality operator == and === in Kotlin]]></title>
            <link>https://medium.com/@khadijahameed415/equality-operator-and-in-kotlin-e13e2499eb7f?source=rss-47637a32681f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e13e2499eb7f</guid>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[equality-operators]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Khadijahameed]]></dc:creator>
            <pubDate>Fri, 17 Feb 2023 07:37:28 GMT</pubDate>
            <atom:updated>2023-02-17T07:37:28.619Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nxnGqAZvDbMY9MUrCSV0CA.png" /></figure><p>Kotlin has two equality operators:</p><p>== and ===, Most of the time we compare the data of variables or objects. for this we use equal operator.</p><p>Structural Equality ==</p><p>It checks for equals (values) which compare the data of two variables. “.equals()” and “==” are same in kotlin.</p><p>Referential equality ===</p><p>It checks whether the two references point to the same object. Now we also have a way to test if two objects are the same instance.</p><p>Below 1 and 2 images compare the variables data, so for comparing the variable data we should use == and whenever you want to compare the object references use ===</p><blockquote><strong><em>How these == and === works on integer variable :</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*5c5UxpvSZJeo5fPcbd23mQ.png" /><figcaption>All returns true because all compare the data.</figcaption></figure><blockquote><strong><em>How these == and === works on String variable :</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*XgNKMw2uKsqGkWxWeEQrQQ.png" /><figcaption>All returns true because all compare the data.</figcaption></figure><blockquote><strong><em>How these == and === works on Object:</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rfXnyqkdIBQUvaNB5i5foA.png" /><figcaption>for comparing the object references use === .</figcaption></figure><pre>p1===p2 returns false //Because OBJECT reference are different and === checks the same object)<br>p1.name===p2.name returns true //Because it compare the param&#39;s values </pre><p>Also, if you compare the Integer variable as an object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ToGDL7rQgDxIXSTCkQr51Q.png" /><figcaption>it clearly means === works in this case too</figcaption></figure><p><strong><em>Hope it’s helpful. </em></strong>✌<strong><em><br>If it is, applaud and share with your fellows </em></strong>ヅ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e13e2499eb7f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Protect your API keys from Reverse Engineering in Android]]></title>
            <link>https://medium.com/@khadijahameed415/protect-your-api-keys-in-android-134947280546?source=rss-47637a32681f------2</link>
            <guid isPermaLink="false">https://medium.com/p/134947280546</guid>
            <category><![CDATA[andriod-app-development]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Khadijahameed]]></dc:creator>
            <pubDate>Tue, 31 Jan 2023 11:57:19 GMT</pubDate>
            <atom:updated>2023-02-02T04:43:29.030Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*8BDa0qCTah34X8gp0_YAHg.jpeg" /><figcaption>Secure API Keys</figcaption></figure><p>As you protect your home keys to prevent theft, same as you should protect your API keys &amp; not leave them out in open.</p><p><strong><em>Benefits of Secure API Keys:</em></strong></p><blockquote>You need to keep your API keys private and secure for multiple reasons. If a hacker gains access to your API key, they could:</blockquote><blockquote>* Make API calls and which could increase your billing costs tremendously.</blockquote><blockquote>* Use it to disrupt your users’ data.</blockquote><blockquote>* Make sure that your android app is safe that you can release.</blockquote><blockquote>API key could quite easily be retrieved via reverse engineering.</blockquote><blockquote>For example: someone(a potential attacker) takes your APK file that you uploaded to google play (there are ways to download that) &amp; tries to extract the source code out of this APK file to find potential api keys in that to Maybe change some of your code or make the app. OR</blockquote><blockquote>If you have a public github repository that anybody could see that api key in your repository so you</blockquote><blockquote>Usually don’t want to out your api keys in your repository. <br>so, it ⬇️ secure API keys from reverse engineering.</blockquote><p>In this article, you will learn how to Secure API keys.<br>first read Keys from an ontrack file and expose those Keys as variables in your <strong>Build config. </strong>Following these steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S9v_RO9uNUWhHHiW3tGt2A.png" /></figure><blockquote><strong><em>Step → 1 :</em></strong></blockquote><p>open local.properties (project root directory). Add new key-value entry for your API key in it.</p><pre><br>USER_LOGIN = /login</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*MSWxXtaabNu4A835buoxiQ.png" /></figure><blockquote><strong><em>Step → 2</em></strong></blockquote><p>local.properties file is excluded file<em>“something you don’t want to share” </em>from version control by default<em> </em>.</p><p>To verify, check .gitignore file. (if it isn’t there, make sure to add it.)</p><pre><br>local.properties</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NYGYQihXXvDbLyx8NEXPtA.png" /></figure><blockquote><strong><em>Step → 3</em></strong></blockquote><p>Now, make this key available to use it as variable.</p><p>Open build.gradle(app)</p><pre>Properties properties = new Properties()<br>properties.load(project.rootProject.file(&#39;local.properties&#39;).newDataInputStream())<br><br>buildConfigField &quot;String&quot;, &quot;USER_LOGIN&quot;, &quot;\&quot;${properties.getProperty(&#39;USER_LOGIN&#39;)}\&quot;&quot;</pre><p>Then, Sync.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zugzSKHQeYCveOTexFMTTw.png" /></figure><blockquote><strong><em>Step → 4</em></strong></blockquote><p>Build &gt; Make Project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*XyqvmIqoC_tBRQdKEEEQbw.png" /></figure><blockquote><strong><em>Step → 5</em></strong></blockquote><p>After build completion, API key will be accessible as a build config variable:</p><p>“BuildConfig. USER_LOGIN” in any class.</p><pre>  val apiKey = BuildConfig.USER_LOGIN</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*CZIaTjGZ58b75OWa83V0Hw.png" /></figure><p><strong><em>Hope it’s helpful. </em></strong>✌<strong><em><br>If it is, applaud and share with your fellows </em></strong>ヅ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=134947280546" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kotlin Scope Functions:]]></title>
            <link>https://medium.com/@khadijahameed415/kotlin-scope-functions-b84e37644d32?source=rss-47637a32681f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b84e37644d32</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[kotlin-scope-functions]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Khadijahameed]]></dc:creator>
            <pubDate>Wed, 25 Jan 2023 07:32:02 GMT</pubDate>
            <atom:updated>2023-01-25T08:00:42.036Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Let, Run, Also, Apply, With</strong></p><p><a href="https://www.linkedin.com/in/khadija-hameed-%C2%A0%F0%9F%87%B5%F0%9F%87%B0-234821150/">#scopeFunctions</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k_qGvH8veQKJO68qdT2QoA.png" /></figure><p><strong>Advantages of using scope functions:</strong></p><p>⇝ Reduced boilerplate code<br>⇝ More concise and precise code<br>⇝ Reduced code repetition<br>⇝ Enhanced code readability</p><blockquote>Let</blockquote><p>⁀➷ ⿻ Let function used to prevent a NullPointerException.<br>⁀➷ ⿻ Return type is the <strong>last</strong> expression we returned.<br>⁀➷ ⿻ Let uses the context as “it” or we can use a named parameter.<br>⁀➷ ⿻ If Let returns null, use elvis operator ?: for default value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*p0E9-AjPfTeUuAJnMDLMvw.png" /><figcaption>#Let</figcaption></figure><p>” let Elvis run” <br> a?.let{} ?: run{}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*76W6WZcYqJbhCwE8053Rjg.png" /><figcaption>#LetElvisRun</figcaption></figure><blockquote><strong>Nesting let : </strong>🖇</blockquote><p>➮ We can set a let expression inside another let expression as shown below.</p><p>For nested let, we can’t use it keyword. We need to assign explicit names “named parameter” to it in both the let functions. Only the outermost let returns the value as shown in Example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DuXP56OT1fu1_AELqKYk3w.png" /><figcaption>#NestingLet</figcaption></figure><blockquote><strong>Run :</strong></blockquote><p>⁀➷ ⿻ You want to operate on a nullable object. Run can change the outer property.<br>⁀➷ ⿻ It is similar to the Let function returns the last statement.<br>⁀➷ ⿻ run doesn’t support “it” keyword.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*ZEXwTYfaKk_hbVMBE83_2w.png" /><figcaption>#run</figcaption></figure><blockquote><strong>also:</strong></blockquote><p>⁀➷ ⿻ also expression does ‘some additional processing on the object’ and configurations.<br>⁀➷ ⿻ It runs on the object reference returns the object reference.<br>⁀➷ ⿻ the context as “it” is allowed.<br>⁀➷ ⿻ When you see also in the code, you can read it as &quot;<em>and also do the following with the object.</em>&quot;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*Vq8wGNfH89zbCV1EC0VtHQ.png" /><figcaption>#also</figcaption></figure><blockquote><strong>apply:</strong></blockquote><p>⁀➷ ⿻ You want to configure or initialize an object<br>⁀➷ ⿻ It runs on the object reference returns the object reference<br>⁀➷ ⿻ In apply, “it” isn’t allowed.</p><pre>data class User(var firstName: String, var lastName : String)</pre><pre>In apply &quot;it&quot; isn&#39;t allowed access parameters like anyone of these method:<br><br>~use parameter name like :<br><br>user.apply{<br> firstname = &quot;kh&quot;<br>}<br><br>~or you can omit this:<br><br>user.apply{<br> this.firstname = &quot;kh&quot;<br>}<br><br>~or property name of the data class:<br><br>user.apply{ <br>user.firstname = &quot;kh&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*rolNI1v3WlCenI0Q9oxdGQ.png" /><figcaption>#apply</figcaption></figure><blockquote><strong>with:</strong></blockquote><p>⁀➷ ⿻ It is convenient when you have to call multiple different methods on the same object. Instead of repeating the variable containing this object on each line, you can use <strong>with.<br></strong>⁀➷ ⿻ <strong>with </strong>is used to change instance properties without the need to call <strong>dot .</strong> operator over the reference every time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*Vl4X6Q7rKQfYwPZnNnBArw.png" /><figcaption>#with</figcaption></figure><p>Return and context of all scope function in one reference image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-eAI63KArZxKnAoyrdRc7g.png" /><figcaption>All scope functions</figcaption></figure><p><strong><em>Hope it’s helpful. </em></strong>✌<strong><em><br>If it is, applaud and share with your fellows </em></strong>ヅ</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b84e37644d32" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extension function in kotlin]]></title>
            <link>https://medium.com/@khadijahameed415/extension-function-in-kotlin-e3a3ed5920c4?source=rss-47637a32681f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3a3ed5920c4</guid>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Khadijahameed]]></dc:creator>
            <pubDate>Tue, 03 Jan 2023 03:47:57 GMT</pubDate>
            <atom:updated>2023-01-03T03:47:57.747Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://youtu.be/0Tj96xdEeTY">#ExtensionFunctions</a></p><p>* To add custom additional functionality in your existing code.<br>* It provides ability to extend functionality of existing class without inheriting them.</p><p>- — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -<br>The main d/f of any function define in a class &amp; extension function is:<br>💁<br>It’s declared with a prefix receiver type with method name<br>fun &lt;class_name&gt;.&lt;method_name&gt;()</p><p><a href="https://www.linkedin.com/feed/hashtag/?keywords=android&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6976540037706362880">#android</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=kotlin&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6976540037706362880">#kotlin</a><br>view image for clarification 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bK1We9fXiXZ2ZHyiyZF18g.png" /><figcaption>Android’s extension function</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kRsCaA1tVDeKL8P6UTtRFA.png" /><figcaption>custom Extension Function</figcaption></figure><p>for clarification watch this :</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0Tj96xdEeTY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0Tj96xdEeTY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0Tj96xdEeTY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/43365e5221d44d868b1ff3267530582e/href">https://medium.com/media/43365e5221d44d868b1ff3267530582e/href</a></iframe><p><strong><em>Hope it’s helpful. </em></strong>✌<strong><em><br>If you like this article, do give it a thumbs up, comment on it and share with with your friends. :)</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3a3ed5920c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SharedViewModel in Kotlin]]></title>
            <link>https://medium.com/@khadijahameed415/sharedviewmodel-in-kotlin-ec9b09b41a78?source=rss-47637a32681f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec9b09b41a78</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <dc:creator><![CDATA[Khadijahameed]]></dc:creator>
            <pubDate>Wed, 28 Dec 2022 04:01:59 GMT</pubDate>
            <atom:updated>2022-12-28T04:01:59.828Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.linkedin.com/posts/khadija-hameed-%C2%A0%F0%9F%87%B5%F0%9F%87%B0-234821150_sharedviewmodel-interface-androiddevelopment-activity-7001917130338152448-x3e5/?utm_source=share&amp;utm_medium=member_desktop">SHARED VIEW MODEL:</a></p><p>》》 To share data between the fragments of the same activity.<br>》》 It’s normal view model only BUT<br>the data holding behavior and lifecycle of view model help us to make it shared view model.</p><p>Before <a href="https://www.linkedin.com/feed/hashtag/?keywords=sharedviewmodel&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7001917130338152448">#SharedViewModel</a> the best way was to communicate or pass data between fragments and activity<br>use <a href="https://www.linkedin.com/feed/hashtag/?keywords=interface&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7001917130338152448">#interface</a> . But, now we can use ViewModel and it will be very easy.</p><p>We just need to create the ViewModel in activity scope and thats it. 🙉🌟</p><blockquote>STEP 1: <em>Make viewmodel class and members to share the data</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*O51ai4GPrqpsJz-rU5n4qQ.png" /><figcaption>we can be named as any but for learning purpose i named it as SharedViewModel</figcaption></figure><blockquote>STEP 2: <em>Here I mentioned all the fragments through which we want to pass the data to the viewmodel.<br> so, the way of defining sharedviewmodel in fragment is:</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zfSKQzf9ThmZmxn3O7BeEA.png" /><figcaption>Flavor Fragment</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZqT_3w38Il21KIcB3eb-Gg.png" /><figcaption>Pound Fragment</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cbHcyFgLd578km25meuETQ.png" /><figcaption>Location Fragment</figcaption></figure><blockquote>STEP 3: <em>This is the fragment where we get all the data from the same sharedviewmodel which shows the data.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P6VZI8_E5pdnRb5fqMMViA.png" /></figure><p>In application it works like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EeWhGAmfT6GCgjtlbnCzvg.jpeg" /></figure><p>here’s the video for better understanding:</p><p><a href="https://youtube.com/shorts/wW9QUq9fTss">SharedViewModel</a></p><p><strong><em>Hope it’s helpful. </em></strong>✌<strong><em><br>If you like this article, do give it a thumbs up, comment on it and share with with your friends. :)</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec9b09b41a78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Default argument/parameter (s) in functions : Kotlin]]></title>
            <link>https://medium.com/@khadijahameed415/default-argument-parameter-s-in-functions-kotlin-210e2bf036e0?source=rss-47637a32681f------2</link>
            <guid isPermaLink="false">https://medium.com/p/210e2bf036e0</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Khadijahameed]]></dc:creator>
            <pubDate>Fri, 23 Dec 2022 12:25:47 GMT</pubDate>
            <atom:updated>2022-12-23T12:25:47.688Z</atom:updated>
            <content:encoded><![CDATA[<h3>Default argument/parameter (s) in functions : Kotlin</h3><p><em>If we assign a default value to the function’s parameter/s:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8eh280GKRu8xoLDC2R17qA.png" /></figure><p><em>if we call function and pass values via parameter’s name, so we don’t need to pass values in order wise (we can pass randomly). as below ↓↓</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xB2IkjEaMQiN06RAZT1nag.png" /></figure><p><em>If we call function and not pass any value or forget to pass any value so it works according to default values as below ↓↓</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NZht8hJpZKp_EODpcPX9CQ.png" /></figure><blockquote><strong>We can do the same in kotlin’s “data classes” to avoid nullability.</strong></blockquote><p>for clarification watch it:</p><p><a href="https://www.youtube.com/shorts/83et1MgVi_o">Kotlin &quot;Default argument/parameter (s) function. #android #kotlin #kotlintutorial</a></p><p><a href="https://www.linkedin.com/feed/hashtag/?keywords=androiddevelopment&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6973662539884756992">#androiddevelopment</a></p><p><strong><em>Hope it’s helpful. </em></strong>✌<strong><em><br>If you like this article, do give it a thumbs up, comment on it and share with with your friends. :)</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=210e2bf036e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Logcat in Dolphin Version]]></title>
            <link>https://medium.com/@khadijahameed415/logcat-in-dolphin-version-1ae7f5f687f4?source=rss-47637a32681f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ae7f5f687f4</guid>
            <category><![CDATA[dolphins]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[logcat]]></category>
            <dc:creator><![CDATA[Khadijahameed]]></dc:creator>
            <pubDate>Tue, 20 Dec 2022 04:37:56 GMT</pubDate>
            <atom:updated>2022-12-20T04:37:56.339Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><a href="https://youtu.be/-yQ8pThPuPg">Android Studio’s latest version’s LOGCAT in Dolphin</a> 🐬🦈</blockquote><p>Logs to make it more easier to scan useful information, Like as tags and messages. We’ve seen that gray colors which shows everywhere within the IDE.</p><p>📍Queries of Logcat: 🤔<br>We have multiple queries for using this logcat. how to use the new query system. <a href="https://www.linkedin.com/feed/hashtag/?keywords=image1&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6991082112263053312">#image1</a><br>1)➵package<br>You can see the any package’s logs which you want to see,<br>Default query that you will notice after you open up the Logcat is package: mine<br>2)➵ tag<br>We can use a forward slash before the tag word, if we want to exclude a certain tag from our log:<br>-tag: test<br>3)➵level<br>level:[VERBOSE | INFO | ASSERT | DEBUG | WARN | ERROR]</p><p>✔ BUT you can also simply start typing in the query field to see suggestions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8-d4AHFnL002TkTzJJlw3A.jpeg" /><figcaption><a href="https://www.linkedin.com/feed/hashtag/?keywords=image2&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6991082112263053312">#image</a>1</figcaption></figure><p>📍Horizontal Scroll <a href="https://www.linkedin.com/feed/hashtag/?keywords=image2&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6991082112263053312">#image2</a><br>If you don’t want to scroll horizontally to see the end of a log message, then you should enable the “Soft Wrap” option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*xu0uYhztx2VDi1DriEWpaQ.jpeg" /><figcaption><a href="https://www.linkedin.com/feed/hashtag/?keywords=image2&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6991082112263053312">#image</a>2</figcaption></figure><p>📍 Query History <a href="https://www.linkedin.com/feed/hashtag/?keywords=image3&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6991082112263053312">#image3</a><br>There’s a query history, which we can use to check and see all the previous queries that we have used so far. Also, you can even mark a query as a favorite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OJJzMUa3mPan9KhMARLiyA.jpeg" /><figcaption><a href="https://www.linkedin.com/feed/hashtag/?keywords=image2&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6991082112263053312">#image</a>3</figcaption></figure><p>📍Logcat Formatting <a href="https://www.linkedin.com/feed/hashtag/?keywords=image4&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6991082112263053312">#image4</a><br>There are two Logcat formatting.<br>Standard which offers information comprehensively, while the Compact one does not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*EBzINF5kibdlyQEYYow4lw.jpeg" /><figcaption><a href="https://www.linkedin.com/feed/hashtag/?keywords=image2&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6991082112263053312">#image</a>4</figcaption></figure><p>📍 Modify Views <a href="https://www.linkedin.com/feed/hashtag/?keywords=image5&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6991082112263053312">#image5</a><br>Modify Views permit you to customize the exact information which you want to see in your Logcat.<br>As soon as you press that button, a new window will appear, allowing you to check which information you want to see for a Standard or a Compact view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YY9ydLuS9G0Y5BLiAjjjeQ.jpeg" /><figcaption>#image5</figcaption></figure><p>📍 Multiple Logcat Windows 🙇🏼‍♂️ <a href="https://www.linkedin.com/feed/hashtag/?keywords=image6&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6991082112263053312">#image6</a><br>You can also create multiple tabs within Logcat, so that you can easily switch between different devices or queries. Right click on your Logcat and you’ll see an option “Split Right/Down”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lSda8GP7-OrejKEnnQS8YQ.jpeg" /><figcaption>#image6</figcaption></figure><p><strong><em>Hope it’s helpful. </em></strong>✌<strong><em><br>If you like this article, do give it a thumbs up, comment on it and share with with your friends. :)</em></strong></p><p><a href="https://www.linkedin.com/feed/hashtag/?keywords=android&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6991082112263053312">#android</a> <a href="https://www.linkedin.com/feed/hashtag/?keywords=dolphin&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6991082112263053312">#dolphin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ae7f5f687f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[onBackpressed() deprecated in targetsdkversion 33]]></title>
            <link>https://medium.com/@khadijahameed415/onbackpressed-deprecated-in-targetsdkversion-33-b4c27096bafe?source=rss-47637a32681f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4c27096bafe</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[andriod-app-development]]></category>
            <dc:creator><![CDATA[Khadijahameed]]></dc:creator>
            <pubDate>Fri, 16 Dec 2022 04:44:00 GMT</pubDate>
            <atom:updated>2022-12-16T04:44:00.765Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jA9tjN53a81UIsdJQdNu9w.jpeg" /></figure><pre>/** onBackPressed Deprecated in Api level 33*/<br>override fun onBackPressed() {<br>    super.onBackPressed()<br><br>}</pre><pre>&quot;for targetsdkversion 33&quot;, Here&#39;s the solution: ↓↓↓ <br><br><br>/**<br>isTaskRoot -&gt; &quot;Check the Activity&#39;s Stack, Whether it&#39;s last on the stack OR <br>              it comes from Notification&quot; <br><br>if it&#39;s last we can finish the activity OR if it&#39;s not, <br>so we do things a\c to condition)<br>*/<br><br><br><br>override fun onBackPressed() {<br>    if(isTaskRoot){<br>        finish()<br>    }else{<br>        /** Do Your Work Here */<br>    }<br>}</pre><p><a href="https://www.linkedin.com/feed/hashtag/?keywords=androiddevelopment&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A6973662539884756992">#androiddevelopment</a></p><p><strong><em>Hope it’s helpful. </em></strong>✌<strong><em><br>If you like this article, do give it a thumbs up, comment on it and share with with your friends. :)</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4c27096bafe" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>