Android – how to obtain resource from Android’s internal resources
Here is the picture which describes how to do it:
Here is the picture which describes how to do it:
I'm not exactly sure when I discovered it, but I have come across an incredibly valuable diagram of Java's collections, in my humble opinion. It has proven to be an…
"Kotlin is compatible with Java and can be used to create applications for the Android platform.""Kotlin is safer and more flexible than Java, thanks to additional data types (e.g. nullable…
Here is a small snippet to use if you want to force screen to be displayed in landscape mode. Place it before onCreate call. .line 9 const/4 v0, 0x0 invoke-virtual…
Sample 1: How to properly make junit tests for that so you will make sure that ValidateStatus.Invalid will be called if EditText child text is empty? class ViewGroupKeyValidator(private val sequence:…
Validating the password: private fun validatePassword(password: String, passwordConfirmation: String): Boolean { val specialCharPattern = Pattern.compile("[^a-z0-9]", Pattern.CASE_INSENSITIVE) val upperCasePatten = Pattern.compile("[A-Z]") val lowerCasePatten = Pattern.compile("[a-z]") val digitCasePatten = Pattern.compile("[0-9]") if (TextUtils.isEmpty(password)…
Here is simple snippet for making imitation of underline for textview. To use it - just set it as a textview's background. <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:background="#EDF5F5"> <item…
Here is the snippet for sending intent to open deeplink: adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d '{your_protocol}://{your_path_pattern}' Sample: adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d…
Get device's dimension: adb shell wm size > Physical size: 2880x1600 Get device's density: adb shell wm density > Physical density: 320 Hide status bar and navigation bar: adb shell…
Recently I had to compare two versions of the app. I had Huawei and Samsung devices. Instead do it manually I made some research and I created script for that:…