Android-er
1,639 FOLLOWERS
Android-er is all about android programming development tutorial examples.
Android-er
2y ago
Snackbars provide lightweight feedback about an operation. They show a brief message at the bottom of the screen on mobile and lower left on larger devices. Snackbars appear above all other elements on screen and only one can be displayed at a time.
They automatically disappear after a timeout or after user interaction elsewhere on the screen, particularly after interactions that summon a new surface or activity. Snackbars can be swiped off screen.
It's a simplest example to show Snackbar using Kotlin. The layout xml is same as last post "Simple example of Button and Toast".
MainActiv ..read more
Android-er
2y ago
activity_main.xml
<?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"><LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" app:layout_constraintBottom_toBottomOf="parent ..read more
Android-er
3y ago
Just update Android Studio 4.2.1, but fail to run with error of:
Missing essential plugin:
org.jetbrains.android
Please reinstall Android Studio from scratch.
Here how I fix it in my case, Android Studio 4.2.1 on Windows 10:
Search and delete "C:\Users\user\AppData\Roaming\Google\AndroidStudio4.X\disabled_plugins.txt"
There are two in my setup:
"C:\Users\user\AppData\Roaming\Google\AndroidStudio4.1\disabled_plugins.txt"
"C:\Users\user\AppData\Roaming\Google\AndroidStudio4.2\disabled_plugins.txt"
I delete both disabled_plugins.txt and re-start Android Stud ..read more
Android-er
4y ago
Android Java example to read text file, with request permission at runtime.
To read file in Android, if your app is installed on device that runs Android 6.0 (API level 23) or higher, you must request the dangerous permissions at runtime. (ref: Android Developer : Request app permissions)
layout xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" a ..read more
Android-er
4y ago
When you create a Android Virtual Device, you have to select a system image from a list of available images. Some marked Google Play, and some marked Google APIs, so what's the difference?
A system image labeled with Google APIs includes access to Google Play services. A system image labeled with the Google Play logo in the Play Store column includes the Google Play Store app and access to Google Play services.
reference: https://developer.android.com/studio/run/managing-avds#system-image
Including a Google Play tab in the Extended controls dialog that provides a convenient but ..read more
Android-er
4y ago
Kotlin Multiplatform Mobile is a solution to write once for Android and iOS apps, using Kotlin.
Kotlin Multiplatform Mobile is an SDK that allows developers to use the same business logic code in both iOS and Android applications. KMM now goes Alpha, and you can start sharing business logic in your mobile apps with it right away. It includes the new KMM Plugin for Android Studio, which allows you to write, run, test, and debug shared code in the same IDE.
details: Kotlin Blog - Kotlin Multiplatform Mobile Goes Alpha
The new Kotlin Multiplatform Mobile developer portal is up, have all ..read more
Android-er
4y ago
Android example of using Chronometer (count-up and count-down) widget, with Kotlin
Layout with Chronometer
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity" android:layout_margin="10dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textS ..read more
Android-er
4y ago
TextClock can display the current date and/or time as a formatted string. It's a simple example of using TextClock with Kotlin.
layout XML with TextClock
<?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <TextClock android:id="@+id/mytextclock" android:layout_width="wrap_content" a ..read more
Android-er
4y ago
Exercise to get Android device info and compile SDK version using Kotlin.
Run on Android Emulator of Android 10
Run on Redmi 5 Plus (Android 8.1.0)
MainActivity.kt
package com.blogspot.android_er.androidinfoimport android.os.Buildimport androidx.appcompat.app.AppCompatActivityimport android.os.Bundleimport android.widget.TextViewimport androidx.annotation.RequiresApiclass MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val manufacturer = Build.MANUFACTUR ..read more
Android-er
4y ago
The Android developer codelab, Getting Started with CameraX, guide you how to create a camera app that uses CameraX to show a viewfinder, take photos, and analyze an image stream from the camera.
Introduce the concept of use cases in CameraX, which you can use for a variety of camera operations, from displaying a viewfinder to analyzing frames in real time.
Android developer codelab, Getting Started with CameraX ..read more