<?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 Azizbek Rasulmetov on Medium]]></title>
        <description><![CDATA[Stories by Azizbek Rasulmetov on Medium]]></description>
        <link>https://medium.com/@azizbek.rasulmetov2000?source=rss-9dc8986f360d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9VSjU4q1iBOC2xzktUQ2nA.jpeg</url>
            <title>Stories by Azizbek Rasulmetov on Medium</title>
            <link>https://medium.com/@azizbek.rasulmetov2000?source=rss-9dc8986f360d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:41:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@azizbek.rasulmetov2000/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Android interview questions about Activity component]]></title>
            <link>https://medium.com/@azizbek.rasulmetov2000/android-interview-questions-about-activity-component-68a7f4ffdb5b?source=rss-9dc8986f360d------2</link>
            <guid isPermaLink="false">https://medium.com/p/68a7f4ffdb5b</guid>
            <category><![CDATA[activity]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android-interviews]]></category>
            <dc:creator><![CDATA[Azizbek Rasulmetov]]></dc:creator>
            <pubDate>Thu, 24 Oct 2024 06:18:16 GMT</pubDate>
            <atom:updated>2024-11-04T12:07:24.303Z</atom:updated>
            <content:encoded><![CDATA[<h3>Question 1</h3><p>Is it possible to determine from activity whether app went to background via home button click?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/0*A4wIcpOnGZXBn6gw.png" /></figure><p><strong>Short answer:</strong> Yes, it is possible</p><p><strong>Explanation:</strong></p><p>To determine whether the user pressed the <strong>Home button</strong> to leave your activity in Android, you need to override activity’s <strong>onUserLeaveHint</strong> method</p><blockquote>onUserLeaveHint() is a callback that is invoked just before an activity is put into the background, but it’s not triggered when navigating to another activity within the same app. It is triggered when the user presses the Home button or performs an action that sends the app to the background (e.g., switching to another app).</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*5tqfFrcPjlLToUHVpwZhEA.png" /></figure><h3>Question 2</h3><p>Is there any activity lifecycle methods called when dialog appears on top of activity?</p><p><strong>Answer:</strong> <br>No, when a dialog appears on top of an activity, the activity remains in the resumed state.</p><h3>Question 3</h3><p>Is there any activity lifecycle methods called when android system kills our application process?</p><p><strong>Answer: <br></strong>No callback methods are guaranteed to be called when android kills the activity or process</p><h3>Question 4</h3><p>How to close multiple activities in the same task?</p><p><strong>Answer:<br></strong>One of the ways is to use finishAffinity metho<strong>d</strong></p><blockquote>finishAffinity() was introduced in Android 4.1 (API Level 16) and finishes the current activity and all other activities in the current task that are in the same affinity.</blockquote><h3>Question 5</h3><p>What activity callback methods are called when configuration changes?</p><p><strong>Answer:<br></strong>When configuration change happens, the system destroys and recreates the activity by default. This triggers the activity lifecycle callbacks associated with the destruction and recreation of the activity.</p><ol><li>onPause()</li><li>onStop()</li><li>onDestroy()</li><li>onCreate(Bundle savedInstanceState)</li><li>onStart()</li><li>onRestoreInstanceState()</li><li>onResume()</li></ol><h3>Question 6</h3><p>Is it possible to not recreate activity after configuration change?</p><p><strong>Short answer: </strong>Yes, it is possible!</p><p><strong>Explanation:</strong></p><p>To prevent the activity from being recreated, we can override onConfigurationChanged() and specify which configurations your activity can handle manually. This is done by adding the android:configChanges attribute in the AndroidManifest.xml file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aeLYdUGgEMYbIBOHXSgggQ.png" /></figure><h3>Question 7</h3><p>Which activity callback methods called when we call finish() in onCreate() lifecycle method?</p><p><strong>Answer:<br></strong>If we call finish() inside onCreate() method, then onDestroy() will be called immediately skipping other lifecycle methods such as onPause(), on</p><h3>Question 8</h3><p>When to use AppCompatActivity and ComponentActivity?</p><p><strong>Answer:<br></strong>ComponentActivity: Recommended for Jetpack Compose-only activities because it provides lifecycle management without additional UI overhead.</p><p>AppCompatActivity: Use this if you need to mix Jetpack Compose with traditional views, fragments, or AppCompat-specific features like the action bar.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68a7f4ffdb5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips and tricks to be an effective android developer — part 2 of 3]]></title>
            <link>https://medium.com/@azizbek.rasulmetov2000/tips-and-tricks-to-be-an-effective-android-developer-part-2-of-3-ddbd9b407372?source=rss-9dc8986f360d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddbd9b407372</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android-tips-and-tricks]]></category>
            <category><![CDATA[android-studio]]></category>
            <category><![CDATA[android-development-tools]]></category>
            <dc:creator><![CDATA[Azizbek Rasulmetov]]></dc:creator>
            <pubDate>Thu, 28 Dec 2023 10:44:24 GMT</pubDate>
            <atom:updated>2023-12-28T10:49:06.649Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tips and tricks to be an effective android developer — part 2 of 3</h3><p>This is the second series of the article, in the first article I shared some tips with Android Studio configuration settings that can boost your performance, if you haven’t read the first part, I recommend you to give it a read.</p><p><a href="https://medium.com/@azizbek.rasulmetov2000/tips-and-tricks-to-be-an-effective-android-developer-part-1-4da9fd1f0f34">Tips and tricks to be an effective android developer — part 1 of 3</a></p><p>In the second part of the article, I will be sharing with you some useful android studio plugins that are handy and will boost your development by saving your time and typing :-).</p><p>Let’s go!!!</p><p><strong>1.Android Drawable Preview</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/309/1*CbF3wCRXCXQfs2tQrfzlmQ.png" /><figcaption>Android Drawable Preview</figcaption></figure><p>Render drawable instead of default icon. Supports binary and vector images</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/201/1*3ka2MDLQ-h_NhaUf5O3bYw.png" /></figure><p><strong>2. JSON to Kotlin Class</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*df-W9eqo5wgxSXL8YiUotA.png" /><figcaption>JSON to Kotlin Class</figcaption></figure><p>This plugin saves your hands from typing boilerplate code. Plugin for Kotlin to convert Json String into Kotlin data class code quickly. Can be easily customized to suit your need. Really handy plugin!!!</p><p><strong>3. ADB Idea</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*J5E6b_59I8nxxPBiKE_6_g.png" /><figcaption>ADB Idea</figcaption></figure><p>Adds about 10+ ADB commands to Android Studio and Intellij. I mostly use the following commands</p><ul><li>ADB Uninstall App</li><li>ADB Kill App</li><li>ADB Start App</li><li>ADB Restart App</li><li>ADB Clear App Data</li></ul><p><strong>4. Gradle Killer</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*WTtvGanttKYqqf7B4H4VCw.png" /><figcaption>Gradle Killer</figcaption></figure><p>This plugin can close the Gradle process instantaneously with one click (CTRL + ALT +K), avoiding the tedious operation of closing process through the task manager</p><p><strong>5. Lorem Ipsum Generator</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/252/1*axQrwsQ7XCP08f4rsJEWmA.png" /><figcaption>Lorem Ipsum Generator</figcaption></figure><p>Very simple plugin to generate Lorem Ipsum placeholder text.</p><p><strong>6. Code Glance Pro</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/309/1*G601gSph8Cmd76uQ9ca8WQ.png" /><figcaption>Code Glance Pro</figcaption></figure><p>When working on a large codebase with 1000+ stroke codes in a single file, this is really all you need. The minimap allows for quick scrolling and preview the code, letting you jump straight to sections of code. Sadly, it does not have a marking feature like in XCode, at least I could not find it.</p><p><strong>7. String Manipulation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*3yNQwp6KyNBD2fCzB-PM_g.png" /><figcaption>String Manipulation</figcaption></figure><p>This plugins helps with case switching, sorting, filtering, incrementing, aligning to columns, grepping, escaping, encoding…</p><p>That’s it for the 2nd part of the article series.</p><p>If you like my article, please don’t forget to click 👏👏👏 &amp; to share it with others.</p><p>Also, to be notified about my next articles and stories, follow me on <a href="https://medium.com/@azizbek.rasulmetov2000">Medium.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddbd9b407372" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips and tricks to be an effective android developer — part 1 of 3]]></title>
            <link>https://medium.com/@azizbek.rasulmetov2000/tips-and-tricks-to-be-an-effective-android-developer-part-1-4da9fd1f0f34?source=rss-9dc8986f360d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4da9fd1f0f34</guid>
            <category><![CDATA[android-settings]]></category>
            <category><![CDATA[android-studio]]></category>
            <category><![CDATA[best-android-tips]]></category>
            <category><![CDATA[android-tips-and-tricks]]></category>
            <category><![CDATA[android-studio-setup]]></category>
            <dc:creator><![CDATA[Azizbek Rasulmetov]]></dc:creator>
            <pubDate>Wed, 27 Dec 2023 11:37:22 GMT</pubDate>
            <atom:updated>2024-01-04T10:04:17.644Z</atom:updated>
            <content:encoded><![CDATA[<p>The tips and tricks that I will share with you today may help you to be an effective developer. Being an effective developer means that doing something fast and in an easier way, saving your time from boilerplate stuff by using tools and shortcuts.</p><p><strong>This includes following tips and tricks:</strong></p><ul><li>android studio configuration &amp; tips</li><li>useful plugins</li><li>handful shortcuts</li></ul><p>This article is split into three parts. The first part covers setting up Android Studio, the second part is all about handy plugins, and the last part dives into some super-useful shortcuts.</p><h3>Configure Android Studio</h3><p><strong>Configure heap size to increase the performance based on your computer’s RAM 💻</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*5K0VcEnR_AyM0q7DIDmfsg.png" /></figure><p><strong>Enable 2 useful features of the AS</strong></p><blockquote>Add umambiguous imports on the fly ✈️</blockquote><blockquote>While editing the code, automatically add imports when there is only one importable declaration with matching name</blockquote><blockquote>Optimize imports on the fly ✈️</blockquote><blockquote>Remove unused imports automatically and reorder imports according to the code style in the settings</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*Vf6rlX2lu5sL82bpR3IHTw.png" /></figure><p><strong>Exclude Android and Android SDK folders from Antivirus scan</strong></p><p>To minimize the impact of the antivirus software on the build speed, exclude android related folders from auto scanning</p><p>Some antivirus software can interfere with the Android Studio build process, causing builds to run dramatically slower. When you run a build in Android Studio, Gradle compiles your app’s resources and source code and then packages the compiled resources together in an APK or AAB. During this process, many files are created on your computer. If your antivirus software has real-time scanning enabled, the antivirus software can force the build process to halt each time a file is created while it scans that file.</p><p>To avoid this issue, you can exclude certain directories from real-time scanning in your antivirus software.</p><p>💡 <strong>Caution:</strong> To ensure that your computer is safe from malicious software, don’t completely disable real-time scanning or your antivirus software.</p><p>The following list shows the default location of each Android Studio directory that you can exclude from real-time scanning:</p><ol><li>Gradle cache %USERPROFILE%\\.gradle</li><li>Android Studio projects %USERPROFILE%\\AndroidStudioProjects</li><li>Android SDK %USERPROFILE%\\AppData\\Local\\Android\\SDK</li></ol><p><strong>Android Studio system files</strong></p><p>Syntax: %LOCALAPPDATA%\\Google\\**&lt;product&gt;&lt;version&gt;**</p><p>Example: C:\\Users\\YourUserName\\AppData\\Local\\Google\\AndroidStudio4</p><p>(<a href="https://developer.android.com/studio/intro/studio-config?utm_source=android-studio#antivirus-impact">official documentation</a>)</p><p><strong>Use Live Templates</strong></p><p>This feature of the AS is my time-saver. Live Templates in Android Studio are predefined code snippets or patterns that you can insert into your code by typing a shortcut and then pressing Tab. These templates are designed to increase coding speed and reduce the likelihood of making syntax errors. Android Studio comes with a set of default live templates, and you can also create your own custom templates.</p><p>Go to Settings (CTRL + ALT + S) -&gt; Editor -&gt; Live Templates</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*8CPPvJxHFJqtRE7jpBfY3Q.png" /></figure><p>I added common code patterns of recycler view adapter, Hilt ViewModel and other jetpack compose related code patterns in my live templates.</p><p>Here is the example of the HiltViewModel code pattern</p><pre>@dagger.hilt.android.lifecycle.HiltViewModel<br><br>class $NAME$ @javax.inject.Inject constructor(<br><br>$PARAM$<br><br>) : androidx.lifecycle.ViewModel() {<br><br>$END$<br><br>}</pre><p>Everything between $…$ is a replaceable part of the code.</p><p><strong>Scratch files</strong></p><p><a href="https://www.jetbrains.com/help/idea/scratches.html">Scratch files</a> are a thing in IntelliJ products. These are throwaway files where you can quickly sketch out ideas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*pXJOGK7G6HxVDOOv_Pv-WA.png" /><figcaption>Scratch Window</figcaption></figure><p>The cool thing about these is they evaluate expressions in real-time on the right-hand side of the editor (similar to a Swift playground), so if you are unsure about how a specific function behaves and want to test it quickly without writing a unit test, you can.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YN8rcI33eD8EvagO.png" /></figure><p>I use these a lot for JSON viewing (no need to use json formatter websites)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*nvrPKzIkzI1XmxpofUByEA.png" /><figcaption>Scratch file</figcaption></figure><p>and for sanity-checking when I’m second guessing an interaction, and they’re also great for quickly demoing an idea to someone in a pairing session.</p><p>Create a new one with CMD + ALT+ Shift + Insert (Windows)</p><p><strong>Code auto-formatting</strong></p><p>You can turn on auto code formatting that will reformat your code according to the code style in the settings and optimize imports via actions on save in the settings.</p><p>You can choose whether to format the changed lines or changed whole file from the drop-down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*1WhitjClClKkvZmKEl85hg.png" /></figure><p>That’s it for the 1st part of the article series.</p><p>If you like my article, please don’t forget to click 👏👏👏 &amp; to share it with others.</p><p>Also, to be notified about my next articles and stories, follow me on <a href="https://medium.com/@azizbek.rasulmetov2000">Medium.</a></p><p>In the next post we’ll explore IDE plugins! Give it a read:</p><p><a href="https://medium.com/@azizbek.rasulmetov2000/tips-and-tricks-to-be-an-effective-android-developer-part-2-of-3-ddbd9b407372">Tips and tricks to be an effective android developer — part 2 of 3</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4da9fd1f0f34" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>