How to improve speed of Android Studio on a legacy computer

Android Studio is one of the best IDEs for Android apps development, but with legacy computers, it is very slow. To run it on a Dell Vostro 3546, here's what I had to do. Upgrade hardware Minimum RAM required is 8 gb. The laptop came with 4 gb DDR3 1600 Mhz RAM which was slow, … Continue reading How to improve speed of Android Studio on a legacy computer

How to install Linux Mint 20.3 on Crucial MX500 SATA SSD drive on Dell Vostro 3546 laptop

The humble Dell Vostro 3546 is an old laptop from 2014, which came with an Intel 4th Generation 4210U processor, 1 TB SATA 5400 rpm hard disk and 4 GB DDR3 (low voltage) 1.35V RAM. It worked fine till now even when it ran Linux Mint 20.3 with Blender 3D. However, everytime an Android app … Continue reading How to install Linux Mint 20.3 on Crucial MX500 SATA SSD drive on Dell Vostro 3546 laptop

How to use addTextChangedListener to change values of other TextViews

At times, the value of one TextView is to be replicated into others as a user types the text. Below illustrates how that can be done. In class MainActivity, variable has been declared for the class as below: TextInputEditText[] array_yourinterest_rate = new TextInputEditText[12]; Within the onCreate method of MainActivity, addTextChangedListener was added to change the … Continue reading How to use addTextChangedListener to change values of other TextViews

How to include other layout xml files in a layout file in Android

Sometimes some layout files can contain too many views making it difficult to manage the layout file later. To overcome this, Android has an <include> tag that allows the inclusion of other layout files into the main layout file (in below illustration, the activity_main.xml file). <include android:id="@+id/b_layout" layout="@layout/activity_main_part_b" /> The above include statement will add … Continue reading How to include other layout xml files in a layout file in Android

How to resolve Dependency ‘androidx.appcompat:appcompat:1.4.1’ requires ‘compileSdkVersion’ to be set to 31 or higher.Compilation target for module ‘:app’ is ‘android-30’

I had the below problem when building code for an older version of Android on Android Studio. Dependency 'androidx.appcompat:appcompat:1.4.1' requires 'compileSdkVersion' to be set to 31 or higher.Compilation target for module ':app' is 'android-30' I was able to solve it by changing the version of appcompat in the dependencies What I had: implementation 'androidx.appcompat:appcompat:1.4.0' I … Continue reading How to resolve Dependency ‘androidx.appcompat:appcompat:1.4.1’ requires ‘compileSdkVersion’ to be set to 31 or higher.Compilation target for module ‘:app’ is ‘android-30’

Replace FindViewByID with ViewBinding in Java on Android

In the gradle.build file for the module, add following code and Sync: buildFeatures { viewBinding true } Above automatically generates binding objects for every layout when the plugin is synced. For activity_main.xml, it will generate ActivityMainBinding class. In MainActivity.java, use inflate method on ActivityMainBinding in onCreate method as shown below: ActivityMainBinding bindMain; bindMain = ActivityMainBinding.inflate(getLayoutInflater()); … Continue reading Replace FindViewByID with ViewBinding in Java on Android

How to fix message in Android Studio 4.2 to remove jcenter() and migrate to mavenCentral()

Android Studio 4.2 displays below message.Please remove usages of jcenter() Maven repository from your build scripts and migrate your build to other Maven repositories. This repository is deprecated and it will be shut down in the future. To fix it, open the gradle file at the project level, search and and replace jcenter() with mavenCentral(). … Continue reading How to fix message in Android Studio 4.2 to remove jcenter() and migrate to mavenCentral()

How to assign value to text view directly in Android Kotlin

In Android Studio, when referencing layout (GUI) elements, the normal flow is to use code as below: var tv = findViewById(R.id.tv_name) tv = myString But, in Kotlin, Prior Android version 10, it was easy to assign values to layout elements without using find_view_by_id by simply using: tv_name.text = myString However, this has stopped working and … Continue reading How to assign value to text view directly in Android Kotlin