<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-89878749563391212</id><updated>2026-04-12T23:55:19.918-07:00</updated><category term="Books for Android development"/><category term="Android Studio.how to"/><category term="how to"/><category term="Android Developer&#39;s news"/><category term="Android code sample: bitmap and image"/><category term="Windows 10.how to"/><category term="Android code sample: Google Maps Android API v2"/><category term="Android Studio"/><category term="misc"/><category term="Android Network Programming"/><category term="Custom View"/><category term="Android code sample: ui"/><category term="Android Developer Tools"/><category term="Android Developer Tips"/><category term="Android code sample: detect touch"/><category term="animation"/><category term="news"/><category term="Android Apps"/><category term="Android code sample: thread"/><category term="step-by-step series"/><category term="Google Maps Android API v2"/><category term="Ubuntu"/><category term="VirtualBox"/><category term="Google&#39;s news"/><category term="USB Host Mode"/><category term="Android code sample: Networking"/><category term="Android code sample: WebView"/><category term="Android code sample: usb"/><category term="Eclipse"/><category term="Path"/><category term="RecyclerView"/><category term="Android code sample: ListView"/><category term="Google Play Services"/><category term="ACTION_OPEN_DOCUMENT"/><category term="Canvas"/><category term="Android Emulator"/><category term="Android code sample: BlueTooth"/><category term="Android code sample: ImageView"/><category term="Google"/><category term="Google I/O"/><category term="video tutorial"/><category term="Android code sample: AsyncTask"/><category term="Animated GIF"/><category term="Books for Game development"/><category term="Microsoft"/><category term="Support Library"/><category term="Xamarin"/><category term="Android Debug Bridge (adb)"/><category term="Android code sample: Detecting Gestures"/><category term="books for Java"/><category term="Android 5.0"/><category term="Android Design Support Library"/><category term="Android code sample: PopupWindow"/><category term="Android code sample: ViewPager"/><category term="Books for mobile app development"/><category term="Material Design"/><category term="Microsoft&#39;s news"/><category term="Pokémon"/><category term="development"/><category term="Android code sample: BlueTooth Low Energy"/><category term="Android code sample: MediaPlayer"/><category term="Android code sample: SQLite database"/><category term="Android code sample: general info"/><category term="Android code sample: storage"/><category term="Books (others)"/><category term="CardView"/><category term="Development Tools"/><category term="Face Detection"/><category term="HC-05/HC-06 Bluetooth Module"/><category term="Java Concurrent"/><category term="KitKat"/><category term="Visual Studio 2015"/><category term="android.support.v7.widget.Toolbar"/><category term="ex.Android.Kotlin"/><category term="ActionBarCompat"/><category term="Android code sample: String"/><category term="Android code sample: YouTube Android Player API"/><category term="Arduino"/><category term="Bluetooth Low Energy"/><category term="Chrome App"/><category term="Dynamic View"/><category term="EditText"/><category term="Java 8"/><category term="JavaScript"/><category term="Linux"/><category term="Network Programming"/><category term="Android 6"/><category term="Android NDK"/><category term="Android Things"/><category term="Android Wearables"/><category term="Android code sample: ProgressBar"/><category term="Books for Android users"/><category term="Books for Windows development"/><category term="Button"/><category term="Here API example"/><category term="JDK"/><category term="Java"/><category term="Java/JavaFX"/><category term="Kotlin Language"/><category term="Marshmallow"/><category term="Qt"/><category term="Snackbar"/><category term="System info"/><category term="VideoView"/><category term="Visual Studio"/><category term="Windows 10"/><category term="graphics"/><category term="info"/><category term="learn Kotlin"/><category term="ACTION_GET_CONTENT"/><category term="Android 4.4"/><category term="Android code sample: NFC"/><category term="Android code sample: SwipeRefreshLayout"/><category term="Books for FREE"/><category term="Books for web development"/><category term="Cardboard"/><category term="ExifInterface"/><category term="FloatingActionButton"/><category term="GridView"/><category term="IoT"/><category term="Linux Mint"/><category term="Raspberry Pi"/><category term="TextView"/><category term="UI and design"/><category term="YouTube Android Player API"/><category term="cross-platform development"/><category term="synchronized"/><category term="Android Wear"/><category term="Android code sample: ActionBarCompat"/><category term="Android code sample: Animation"/><category term="Android code sample: AnimationDrawable"/><category term="Android code sample: Layout"/><category term="Android code sample: ListFragment"/><category term="Android code sample: Spinner"/><category term="Android code sample: SurfaceView"/><category term="Android code sample: ViewFlipper"/><category term="Android code sample: WiFi"/><category term="Bluetooth LE Gatt Example"/><category term="BroadcastReceiver"/><category term="Chrome Remote Desktop"/><category term="ColorMatrix"/><category term="Drag and Drop"/><category term="Google Charts"/><category term="Google Play services SDK"/><category term="Intel"/><category term="Intent.ACTION_PICK"/><category term="MP3 Player"/><category term="MediaMetadataRetriever"/><category term="MultiWindowMode"/><category term="OpenCV"/><category term="Permission"/><category term="Unity"/><category term="Wallpaper"/><category term="Web Server"/><category term="Xiaomi"/><category term="elevation"/><category term="emulator"/><category term="3D Hologram Video Projector"/><category term="Android N"/><category term="Android O"/><category term="Android code sample: CountDownTimer"/><category term="Android code sample: DrawerLayout"/><category term="Android code sample: ExpandableListView"/><category term="Android code sample: Fragment"/><category term="Android code sample: Locale"/><category term="Android code sample: MapFragment"/><category term="Android code sample: Timer and TimerTask"/><category term="Android code sample: ToneGenerator"/><category term="Android code sample: battery"/><category term="Android/Java programming basic"/><category term="App Inventor"/><category term="BottomSheet"/><category term="ColorFilter"/><category term="DialogFragment"/><category term="HM-10 BLE Module"/><category term="HTC"/><category term="Huawei"/><category term="ImageDecoder"/><category term="Java example"/><category term="JavaFX for Android"/><category term="LocationServices"/><category term="MK 809III"/><category term="MediaController"/><category term="Memory"/><category term="NFC"/><category term="Networking"/><category term="ObjectAnimator"/><category term="PDF"/><category term="PdfRenderer"/><category term="PhoneGap"/><category term="RFID"/><category term="RFID Tag"/><category term="RingtoneManager"/><category term="RippleDrawable"/><category term="Ubuntu Desktop"/><category term="YouTube API"/><category term="androidify"/><category term="books for Kotlin"/><category term="dev Microsoft"/><category term="introduction"/><category term="setup"/><category term="AVD (Android Virtual Device)"/><category term="AlarmManager"/><category term="AlertDialog.Builder"/><category term="Android 5.1 Lollipop"/><category term="Android ADK"/><category term="Android Code sample: Toast"/><category term="Android Jetpack"/><category term="Android Wear SDK"/><category term="Android code sample: Date Time"/><category term="Android code sample: LocationSource and LocationListener"/><category term="Android code sample: Menu"/><category term="Android code sample: PackageManager"/><category term="Android code sample: PagerAdapter"/><category term="Android code sample: PopupMenu"/><category term="Android code sample: ProcessBuilder"/><category term="Android code sample: Service and IntentService"/><category term="Android code sample: SupportMapFragment"/><category term="Android code sample: VelocityTracker"/><category term="Android code sample: ViewAnimator"/><category term="Bitmap"/><category term="Bluestacks"/><category term="Books for C/Cpp development"/><category term="Books for Cross-platform"/><category term="Books for Glass development"/><category term="Books for Linux"/><category term="Chromebook"/><category term="Cloud"/><category term="ConstraintLayout"/><category term="DIY"/><category term="Dart"/><category term="Easter Egg"/><category term="Emoji"/><category term="Game development"/><category term="GeoNames"/><category term="Git"/><category term="Google Cast SDK"/><category term="Google Maps JavaScript API v3"/><category term="GridLayout"/><category term="HTML5"/><category term="HttpService"/><category term="IP address"/><category term="Intel x86 Emulator Accelerator (HAXM)"/><category term="JSON"/><category term="JobScheduler"/><category term="JobService"/><category term="Lubuntu"/><category term="MSDN"/><category term="Mobile Ads SDK"/><category term="Mobile Vision API"/><category term="Nokia"/><category term="OpenWeatherMap"/><category term="Options Menu"/><category term="Parse JSON"/><category term="Processing Language"/><category term="Project Brillo"/><category term="Remix OS"/><category term="RxJava"/><category term="Samsung"/><category term="ScriptIntrinsicConvolve3x3"/><category term="Spinner"/><category term="Standalone ESP8266"/><category term="Stream Video"/><category term="TextWatcher"/><category term="Ubuntu Make"/><category term="VectorDrawable"/><category term="Virtual Reality"/><category term="Visualizer"/><category term="Weave"/><category term="Web Tools"/><category term="XML"/><category term="books"/><category term="books for Google"/><category term="books for Microsoft Windows 10"/><category term="books for Python"/><category term="color"/><category term="currency"/><category term="drawable"/><category term="ex.android.widget"/><category term="multi-device"/><category term="org.apache.http"/><category term="products"/><category term="reCAPTCHA Android API"/><category term="style"/><category term="testing"/><category term="tutorial"/><category term="user location"/><category term="x86"/><category term="3D smartphone"/><category term="ACTION_OPEN_DOCUMENT_TREE"/><category term="AMD"/><category term="ARM"/><category term="ART"/><category term="AT-09 BLE Module"/><category term="ActionBar"/><category term="AdMob SDK"/><category term="AlertDialog"/><category term="Alphabet"/><category term="Android (Go Edition)"/><category term="Android 5.1.1"/><category term="Android Device Manager"/><category term="Android M"/><category term="Android One"/><category term="Android Open Accessory"/><category term="Android Q"/><category term="Android code sample: Activity"/><category term="Android code sample: AudioRecord"/><category term="Android code sample: AudioTrack"/><category term="Android code sample: Currency"/><category term="Android code sample: Date Binding"/><category term="Android code sample: DownloadManager"/><category term="Android code sample: ImageSwitcher"/><category term="Android code sample: PreferenceFragment"/><category term="Android code sample: ProgressDialog"/><category term="Android code sample: Runnable"/><category term="Android code sample: Socket"/><category term="Android code sample: SoundPool"/><category term="Android code sample: TextSwitcher"/><category term="Android code sample: ViewSwitcher"/><category term="Android mini PC"/><category term="AndroidX"/><category term="AnimatedVectorDrawable"/><category term="Animator"/><category term="Apache Cordova"/><category term="App Inventor 2"/><category term="Arduino/Genuino 101"/><category term="Ark Compiler"/><category term="AutoCompleteTextView"/><category term="Azure"/><category term="BeagleBone Black"/><category term="Books for Embedded"/><category term="CalendarView"/><category term="CalledFromWrongThreadException"/><category term="Chrome Apps development"/><category term="Chrome Dev Editor"/><category term="Chrome DevTools"/><category term="Cinnamon"/><category term="ContentLoadingProgressBar"/><category term="CoordinatorLayout"/><category term="East"/><category term="ExoPlayer"/><category term="Firefox OS"/><category term="Flutter"/><category term="Fly Nixie"/><category term="FragmentActivity"/><category term="GIMP"/><category term="Geocoder"/><category term="Glass"/><category term="Google Cast SDK for Android"/><category term="Google Chromecast"/><category term="Google Developers"/><category term="Google Earth Pro"/><category term="Google Maps Mobile APIs"/><category term="Google Maps Places API"/><category term="Google Mobile Ads SDK for Android"/><category term="Google Search"/><category term="HTTP/2"/><category term="HandlerThread"/><category term="Hardware Acceleration"/><category term="HarmonyOS"/><category term="Hyperlapse"/><category term="IOIO"/><category term="IPV6"/><category term="IllegalArgumentException"/><category term="IntelliJ IDEA"/><category term="Intent"/><category term="International Space Station (ISS)"/><category term="Internet"/><category term="JAVA_HOME"/><category term="Kivy"/><category term="L Developer Preview"/><category term="LatLng"/><category term="Lifecycle"/><category term="Lint Error Checking"/><category term="Location"/><category term="Lock"/><category term="MP4"/><category term="MPAndroidChart"/><category term="Machine Learning"/><category term="Material Theme"/><category term="Matrix"/><category term="Maven"/><category term="Media Effects API"/><category term="MediaCodecList"/><category term="MediaStore"/><category term="Microsoft Hyperlapse"/><category term="Mobile Web App"/><category term="Motorola"/><category term="Navigation Component"/><category term="Navigation Drawer"/><category term="NoClassDefFoundError"/><category term="Node.js"/><category term="Nokia X software platform"/><category term="Nvidia"/><category term="Online document"/><category term="OpenGL ES"/><category term="OutOfMemoryError"/><category term="Palette"/><category term="Panoramio"/><category term="Parrot"/><category term="PdfDocument"/><category term="Percent Support Library"/><category term="Polymer"/><category term="Project SkyBridge"/><category term="Qt Mobile"/><category term="RandomStringUtils"/><category term="RenderScript"/><category term="SE for Android"/><category term="SVG"/><category term="Samsung Developers"/><category term="ScriptIntrinsicBlur"/><category term="Sky"/><category term="SoftKeyboard"/><category term="Systrace"/><category term="Takee"/><category term="UDOO"/><category term="Unreal"/><category term="VMware"/><category term="Version Control"/><category term="Visual C++"/><category term="Visual Studio 2013"/><category term="Visual Studio Emulator for Android"/><category term="Voice Changer"/><category term="Voice Search"/><category term="WebView"/><category term="WinRT"/><category term="Windows Bridge for Android"/><category term="accessory"/><category term="andproud"/><category term="android code sample: memory"/><category term="android-gif-encoder"/><category term="android.os.StatFs"/><category term="appcompat_v7"/><category term="books for Chrome Apps"/><category term="books for Network Programming"/><category term="books for Networking"/><category term="books for Qt"/><category term="browser"/><category term="divider"/><category term="drone"/><category term="ex.Android.Java"/><category term="ex.android.layout"/><category term="filesystem"/><category term="font"/><category term="gphone"/><category term="javafxports"/><category term="lubuntu-desktop"/><category term="maker"/><category term="random number"/><category term="space"/><title type='text'>Android-er</title><subtitle type='html'>&lt;i&gt;Please visit my new address:&lt;/i&gt; &lt;b&gt;&lt;a href=&quot;https://coxxect.blogspot.com/&quot;&gt;https://coxxect.blogspot.com/&lt;/a&gt;&lt;/b&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2364</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-8405168701699534962</id><published>2022-05-22T13:51:00.002-07:00</published><updated>2022-05-22T13:51:30.716-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ex.Android.Kotlin"/><title type='text'>Simplest Snackbar </title><content type='html'>&lt;p&gt;
  &lt;i&gt;&lt;b&gt;&lt;a href=&quot;https://developer.android.com/reference/com/google/android/material/snackbar/Snackbar&quot; target=&quot;_blank&quot;&gt;Snackbars&lt;/a&gt;&lt;/b&gt;
    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.&lt;br /&gt;&lt;br /&gt;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.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;It&#39;s a simplest example to show&amp;nbsp;Snackbar using Kotlin. The
  layout xml is same as last post &quot;&lt;a href=&quot;https://android-er.blogspot.com/2022/05/simple-example-of-button-and-toast.html&quot;&gt;Simple example of Button and Toast&lt;/a&gt;&quot;.
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
  &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL9MqdGow7TKQeJAda2AlO5eyRFQOCceIoy_-CQ57xo5pfk8it1AevTTVPQDWcMdp_Z7KfBFPUm1Y-C06301lnYUb5WdNe8_yI-ZqU_8BjGFgSeb3zq_vrx4LTmTAXd_MJwe8Iis1f5pFCz19LxU0QWXW-0IPP5tKTF34AWsQzXa9yxrYcKCKTTmtR/s1366/Snackbar.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1366&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL9MqdGow7TKQeJAda2AlO5eyRFQOCceIoy_-CQ57xo5pfk8it1AevTTVPQDWcMdp_Z7KfBFPUm1Y-C06301lnYUb5WdNe8_yI-ZqU_8BjGFgSeb3zq_vrx4LTmTAXd_MJwe8Iis1f5pFCz19LxU0QWXW-0IPP5tKTF34AWsQzXa9yxrYcKCKTTmtR/s320/Snackbar.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
MainActivity.kt
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;package android_er.blogspot.com.myapp01

import android.os.Bundle
import android.view.View
import android.widget.Button
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.snackbar.Snackbar

private lateinit var btnA: Button
private lateinit var btnB: Button

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        btnA = findViewById(R.id.btn_A)
        btnB = findViewById(R.id.btn_B)

        btnA.setOnClickListener(
            { view: View -&amp;gt;
                Toast.makeText(
                    this,
                    &quot;Button A pressed&quot;,
                    Toast.LENGTH_LONG,
                ).show()
            },
        )

        btnB.setOnClickListener(
            { view: View -&amp;gt;
                &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;val snackbar = Snackbar
                    .make(btnB,
                        &quot;android-er.blogspot.com&quot;,
                        Snackbar.LENGTH_LONG)
                snackbar.show()&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;
            },
        )
    }
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/8405168701699534962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/8405168701699534962' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/8405168701699534962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/8405168701699534962'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2022/05/simplest-snackbar.html' title='Simplest Snackbar '/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL9MqdGow7TKQeJAda2AlO5eyRFQOCceIoy_-CQ57xo5pfk8it1AevTTVPQDWcMdp_Z7KfBFPUm1Y-C06301lnYUb5WdNe8_yI-ZqU_8BjGFgSeb3zq_vrx4LTmTAXd_MJwe8Iis1f5pFCz19LxU0QWXW-0IPP5tKTF34AWsQzXa9yxrYcKCKTTmtR/s72-c/Snackbar.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-957613782748245987</id><published>2022-05-22T12:37:00.003-07:00</published><updated>2022-05-22T12:37:51.627-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ex.Android.Kotlin"/><title type='text'>Simple example of Button and Toast (Android Kotlin)</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBxTDoPPVEuaSulh4P99fe-axnuVpCSjbyTZGAIlQ6EhR8zxNHFXC05wZoX_zqEVTuyxUJXnXwdFNwhOojRmUGwO7AEaDOQIq3SwHi-fsd6Lx5M5xw8kooPaFtSd1StNNxS_J9rT6PujTu4OCnVM5vYr48q6yNL-pqWgKOE4ecyAEncYkTIhuYBALM/s1366/button%20and%20Toast.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1366&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBxTDoPPVEuaSulh4P99fe-axnuVpCSjbyTZGAIlQ6EhR8zxNHFXC05wZoX_zqEVTuyxUJXnXwdFNwhOojRmUGwO7AEaDOQIq3SwHi-fsd6Lx5M5xw8kooPaFtSd1StNNxS_J9rT6PujTu4OCnVM5vYr48q6yNL-pqWgKOE4ecyAEncYkTIhuYBALM/s320/button%20and%20Toast.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
activity_main.xml
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;androidx.constraintlayout.widget.ConstraintLayout 
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    tools:context=&quot;.MainActivity&quot;&amp;gt;

    &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&amp;lt;LinearLayout
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:orientation=&quot;horizontal&quot;
        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
        app:layout_constraintEnd_toEndOf=&quot;parent&quot;
        app:layout_constraintStart_toStartOf=&quot;parent&quot;
        app:layout_constraintTop_toTopOf=&quot;parent&quot;
        android:layout_margin=&quot;10dp&quot;&amp;gt;

        &amp;lt;Button
            android:id=&quot;@+id/btn_A&quot;
            android:layout_width=&quot;wrap_content&quot;
            android:layout_weight=&quot;1&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:text=&quot;Button A&quot;
            android:layout_margin=&quot;5dp&quot;/&amp;gt;
        &amp;lt;Button
            android:id=&quot;@+id/btn_B&quot;
            android:layout_width=&quot;wrap_content&quot;
            android:layout_weight=&quot;1&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:text=&quot;Button B&quot;
            android:layout_margin=&quot;5dp&quot;/&amp;gt;
    &amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;

&amp;lt;/androidx.constraintlayout.widget.ConstraintLayout&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
MainActivity.kt
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;package android_er.blogspot.com.myapp01

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Button
import android.widget.Toast

&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;private lateinit var btnA: Button
private lateinit var btnB: Button&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;btnA = findViewById(R.id.btn_A)
        btnB = findViewById(R.id.btn_B)

        btnA.setOnClickListener(
            { view: View -&amp;gt;
                Toast.makeText(
                    this,
                    &quot;Button A pressed&quot;,
                    Toast.LENGTH_LONG,
                ).show()
            },
        )

        btnB.setOnClickListener(
            { view: View -&amp;gt;
                Toast.makeText(
                    this,
                    &quot;Button B pressed&quot;,
                    Toast.LENGTH_LONG,
                ).show()
            },
        )&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;
    }
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/957613782748245987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/957613782748245987' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/957613782748245987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/957613782748245987'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2022/05/simple-example-of-button-and-toast.html' title='Simple example of Button and Toast (Android Kotlin)'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBxTDoPPVEuaSulh4P99fe-axnuVpCSjbyTZGAIlQ6EhR8zxNHFXC05wZoX_zqEVTuyxUJXnXwdFNwhOojRmUGwO7AEaDOQIq3SwHi-fsd6Lx5M5xw8kooPaFtSd1StNNxS_J9rT6PujTu4OCnVM5vYr48q6yNL-pqWgKOE4ecyAEncYkTIhuYBALM/s72-c/button%20and%20Toast.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-1163052888697299773</id><published>2021-06-14T08:56:00.006-07:00</published><updated>2021-06-14T09:05:05.102-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ex.android.layout"/><title type='text'>TextInputLayout + TextInputEditText</title><content type='html'>&lt;p&gt;
  Simple example to
  use&amp;nbsp;com.google.android.material.textfield.TextInputLayout
  and&amp;nbsp;com.google.android.material.textfield.TextInputEditText in layout xml
  to make edit text better.
&lt;/p&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYGjpJ5ogCr2TxmULi271qbwdna6xlbgaUHDAE1R4GyA6jftKBtTaOMwDtK0EWbS6crSkJxjqedHCqyhow5zIjdswn_t8MXhWr-FtScPZug_xzkjI0idQZ5NuqM0R4nOsbf1Pq2jBF1_Q/s1300/ExEditText.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1300&quot; data-original-width=&quot;750&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYGjpJ5ogCr2TxmULi271qbwdna6xlbgaUHDAE1R4GyA6jftKBtTaOMwDtK0EWbS6crSkJxjqedHCqyhow5zIjdswn_t8MXhWr-FtScPZug_xzkjI0idQZ5NuqM0R4nOsbf1Pq2jBF1_Q/w231-h400/ExEditText.png&quot; width=&quot;231&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;LinearLayout
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    android:orientation=&quot;vertical&quot;
    tools:context=&quot;.MainActivity&quot;&amp;gt;

    &amp;lt;TextView
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;android-er.blogspot.com&quot;
        android:gravity=&quot;center&quot;/&amp;gt;
    &amp;lt;TextView
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Normal TextView&quot;/&amp;gt;
    &amp;lt;EditText
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:hint=&quot;hint&quot;/&amp;gt;
    &amp;lt;TextView
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;TextInputLayout + TextInputEditText&quot;/&amp;gt;
    &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;&amp;lt;com.google.android.material.textfield.TextInputLayout
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:hint=&quot;Hint&quot;&amp;gt;
        &amp;lt;com.google.android.material.textfield.TextInputEditText
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:textStyle=&quot;bold&quot;/&amp;gt;
    &amp;lt;/com.google.android.material.textfield.TextInputLayout&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;
&amp;lt;/LinearLayout&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/1163052888697299773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/1163052888697299773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/1163052888697299773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/1163052888697299773'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2021/06/textinputlayout-textinputedittext.html' title='TextInputLayout + TextInputEditText'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYGjpJ5ogCr2TxmULi271qbwdna6xlbgaUHDAE1R4GyA6jftKBtTaOMwDtK0EWbS6crSkJxjqedHCqyhow5zIjdswn_t8MXhWr-FtScPZug_xzkjI0idQZ5NuqM0R4nOsbf1Pq2jBF1_Q/s72-w231-h400-c/ExEditText.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-4360444408150093171</id><published>2021-05-20T11:06:00.004-07:00</published><updated>2021-05-20T11:15:13.535-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio.how to"/><title type='text'>Fix Android Studio error: Missing essential plugin: org.jetbrains.android</title><content type='html'>Just update Android Studio 4.2.1, but fail to run with error of:&amp;nbsp;
&lt;div&gt;
  &lt;br /&gt;
  &lt;div&gt;
    &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Missing essential plugin:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;org.jetbrains.android&amp;nbsp;&lt;/span&gt;&lt;/b&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Please reinstall Android Studio from scratch.&lt;/b&gt;&amp;nbsp;&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
    &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguMYyZLHt6t0h-k_LdE74js7LK1lBho657cO7yG1fVZDW6P2VUVWD5wNu2BdMst8e2r9xrtuy8uZHezDY6a0K-IIAXc0gX0BdhiGNFKKmaBhS2G_flI7ChTGWfYm_bejnO37-0qHoiq28/s653/Missing+essential+plugin.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;411&quot; data-original-width=&quot;653&quot; height=&quot;403&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguMYyZLHt6t0h-k_LdE74js7LK1lBho657cO7yG1fVZDW6P2VUVWD5wNu2BdMst8e2r9xrtuy8uZHezDY6a0K-IIAXc0gX0BdhiGNFKKmaBhS2G_flI7ChTGWfYm_bejnO37-0qHoiq28/w640-h403/Missing+essential+plugin.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;
  &lt;/div&gt;
  &lt;br /&gt;
  &lt;div&gt;Here how I fix it in my case, Android Studio 4.2.1 on Windows 10:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/bJ8OXyoAUJA&quot; title=&quot;YouTube video player&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;/center&gt;
&lt;div&gt;
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
    Search and delete
    &quot;C:\Users\user\AppData\Roaming\Google\AndroidStudio4.X\disabled_plugins.txt&quot;
  &lt;/div&gt;
  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;
  &lt;div&gt;There are two in my setup:&lt;/div&gt;
  &lt;div&gt;
    &quot;C:\Users\user\AppData\Roaming\Google\AndroidStudio4.1\disabled_plugins.txt&quot;
  &lt;/div&gt;
  &lt;div&gt;
    &quot;C:\Users\user\AppData\Roaming\Google\AndroidStudio4.2\disabled_plugins.txt&quot;
  &lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;I delete both&amp;nbsp;disabled_plugins.txt and re-start Android Studio.&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/4360444408150093171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/4360444408150093171' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/4360444408150093171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/4360444408150093171'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2021/05/fix-android-studio-error-missing.html' title='Fix Android Studio error: Missing essential plugin: org.jetbrains.android'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguMYyZLHt6t0h-k_LdE74js7LK1lBho657cO7yG1fVZDW6P2VUVWD5wNu2BdMst8e2r9xrtuy8uZHezDY6a0K-IIAXc0gX0BdhiGNFKKmaBhS2G_flI7ChTGWfYm_bejnO37-0qHoiq28/s72-w640-h403-c/Missing+essential+plugin.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-7590027444572217533</id><published>2021-01-04T12:09:00.003-08:00</published><updated>2021-01-04T14:01:40.160-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ex.Android.Java"/><category scheme="http://www.blogger.com/atom/ns#" term="ex.Android.Kotlin"/><title type='text'>Android read text file with request permission at runtime</title><content type='html'>&lt;p&gt;Android example to read text file, with request permission at runtime.&lt;/p&gt;
&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/DRsnrKtUuQc&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;/center&gt;
&lt;p&gt;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: &lt;a href=&quot;https://developer.android.com/training/permissions/requesting&quot; target=&quot;_blank&quot;&gt;Android Developers :&amp;nbsp;Request app permissions&lt;/a&gt;)&lt;/p&gt;&lt;p&gt;Also shown in the video, access to /proc/net filesystem is&amp;nbsp;restricted on Android 10+&lt;/p&gt;&lt;p&gt;On devices that run Android 10 or higher, apps cannot access /proc/net, which includes information about a device&#39;s network state. Apps that need access to this information, such as VPNs, should use the NetworkStatsManager or ConnectivityManager class. (ref: &lt;a href=&quot;https://developer.android.com/about/versions/10/privacy/changes#proc-net-filesystem&quot; target=&quot;_blank&quot;&gt;Android Developers: Privacy changes in Android 10 &amp;gt; Restriction on access to /proc/net filesystem&lt;/a&gt;)&lt;/p&gt;
layout xml
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;LinearLayout
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    android:orientation=&quot;horizontal&quot;
    tools:context=&quot;.MainActivity&quot;&amp;gt;

    &amp;lt;LinearLayout
        android:id=&quot;@+id/leftpanel&quot;
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;match_parent&quot;
        android:orientation=&quot;vertical&quot;
        android:background=&quot;@color/black&quot;
        android:layout_margin=&quot;5dp&quot;
        android:padding=&quot;5dp&quot;&amp;gt;
        &amp;lt;TextView
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:textSize=&quot;20dp&quot;
            android:textStyle=&quot;bold&quot;
            android:textColor=&quot;@color/white&quot;
            android:text=&quot;android-er.blogspot.com&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/exercise&quot;
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:textSize=&quot;20dp&quot;
            android:textColor=&quot;@color/white&quot;
            android:text=&quot;Exercise: Read Text File&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/sysinfo&quot;
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:textSize=&quot;20dp&quot;
            android:textStyle=&quot;bold&quot;
            android:textColor=&quot;@color/white&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/sdkinfo&quot;
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:textSize=&quot;20dp&quot;
            android:textStyle=&quot;bold&quot;
            android:textColor=&quot;@color/white&quot;/&amp;gt;

    &amp;lt;/LinearLayout&amp;gt;

    &amp;lt;RelativeLayout
        android:id=&quot;@+id/rightpanel&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;match_parent&quot;
        android:orientation=&quot;vertical&quot;
        android:background=&quot;#C0C0C0&quot;
        android:layout_margin=&quot;5dp&quot;
        android:padding=&quot;5dp&quot;&amp;gt;
        &amp;lt;Button
            android:id=&quot;@+id/read&quot;
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:layout_margin=&quot;2dp&quot;
            android:text=&quot;Read&quot;
            android:layout_alignParentTop=&quot;true&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/filecontent&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;match_parent&quot;
            android:layout_margin=&quot;2dp&quot;
            android:background=&quot;#808080&quot;
            android:fontFamily=&quot;monospace&quot;
            android:layout_below=&quot;@id/read&quot;
            android:layout_above=&quot;@id/msg&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/msg&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:layout_margin=&quot;2dp&quot;
            android:background=&quot;#404040&quot;
            android:layout_gravity=&quot;bottom&quot;
            android:layout_alignParentBottom=&quot;true&quot;/&amp;gt;
    &amp;lt;/RelativeLayout&amp;gt;
&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
Java code:
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;package android_er.blogspot.com.jexreadtextfile;

import android.Manifest;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class MainActivity extends AppCompatActivity {

    //Try different files
    //String targetFile = &quot;/sdcard/Download/Test.txt&quot;;
    //String targetFile = &quot;/proc/cpuinfo&quot;;
    //String targetFile = &quot;/proc/meminfo&quot;;
    String targetFile = &quot;/proc/net/arp&quot;;  //Restricted since Android 10

    Button btnRead;
    TextView tvFileContent;
    TextView tvMsg;

    final int PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        dispExInfo();

        btnRead = findViewById(R.id.read);
        btnRead.setText(targetFile);
        tvFileContent = findViewById(R.id.filecontent);
        //make this TextView scrollable
        tvFileContent.setMovementMethod(new ScrollingMovementMethod());
        tvMsg = findViewById(R.id.msg);
        tvMsg.setText(&quot;Click on READ button&quot;);

        btnRead.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                tvMsg.setText(&quot;READ button clicked&quot;);
                toReadFile();
            }
        });
    }


    /*
    Request Permission at Runtime, before read file.
     */
    void toReadFile(){
        if (ContextCompat.checkSelfPermission(this,
                    Manifest.permission.READ_EXTERNAL_STORAGE)
                    != PackageManager.PERMISSION_GRANTED) {
                // Permission is not granted
                // Should we show an explanation?
                if (ActivityCompat.shouldShowRequestPermissionRationale(
                        this,
                        Manifest.permission.READ_EXTERNAL_STORAGE)) {
                    // Show an explanation to the user *asynchronously* -- don&#39;t block
                    // this thread waiting for the user&#39;s response! After the user
                    // sees the explanation, try again to request the permission.

                    //to simplify, call requestPermissions again
                    Toast.makeText(getApplicationContext(),
                            &quot;shouldShowRequestPermissionRationale&quot;,
                            Toast.LENGTH_LONG).show();
                    ActivityCompat.requestPermissions(this,
                            new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
                            PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
                } else {
                    // No explanation needed; request the permission
                    ActivityCompat.requestPermissions(this,
                            new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
                            PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
    }
            }else{
                // permission granted
                readFile(targetFile);
            }
    }

    @Override
    public void onRequestPermissionsResult(
            int requestCode,
            @NonNull String[] permissions,
            @NonNull int[] grantResults) {
        if(requestCode == PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE){
            if (grantResults.length &amp;gt; 0
                    &amp;amp;&amp;amp; grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                // permission was granted.
                Toast.makeText(getApplicationContext(),
                        &quot;permission was granted, thx:)&quot;,
                        Toast.LENGTH_LONG).show();

                readFile(targetFile);
            } else {
                // permission denied.
                Toast.makeText(getApplicationContext(),
                        &quot;permission denied! Oh:(&quot;,
                        Toast.LENGTH_LONG).show();
            }
            return;

        }else{
            super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        }
    }

    void readFile(String f){
        File file = new File(f);
        StringBuilder stringBuilder = new StringBuilder();

        try {
            BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
            String line;
            while ((line = bufferedReader.readLine()) != null) {
                stringBuilder.append(line);
                stringBuilder.append(&#39;\n&#39;);
            }
            bufferedReader.close();

            tvFileContent.setText(stringBuilder);
            tvMsg.setText(&quot;Done&quot;);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            tvMsg.setText(e.getMessage());
        } catch (IOException e) {
            e.printStackTrace();
            tvMsg.setText(e.getMessage());
        }
    }

    /* ==========================================
    display Exercise info
     */

    void dispExInfo(){
        TextView tvExercise = findViewById(R.id.exercise);
        TextView tvSysInfo = findViewById(R.id.sysinfo);
        TextView tvSdkInfo = findViewById(R.id.sdkinfo);

        tvExercise.append(&quot; (Java)&quot;);

        String manufacturer = Build.MANUFACTURER;
        String model = Build.MODEL;
        String release = Build.VERSION.RELEASE;

        tvSysInfo.setText(
                manufacturer + &quot;\n&quot;
                        + model + &quot;\n&quot;
                        + &quot;Android: &quot; + release + &quot;\n&quot;);

        PackageManager packageManager = getPackageManager();
        String packageName = getPackageName();
        int targetSdkVersion, minSdkVersion;
        int versionCode;
        String versionName;

        try {
            PackageInfo packageInfo =
                    packageManager.getPackageInfo(packageName, 0);

            ApplicationInfo applicationInfo = packageInfo.applicationInfo;
            targetSdkVersion = applicationInfo.targetSdkVersion;
            minSdkVersion = applicationInfo.minSdkVersion;

            tvSdkInfo.setText(&quot;targetSdkVersion = &quot; + targetSdkVersion + &quot;\n&quot;
                    + &quot;minSdkVersion = &quot; + minSdkVersion);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            Toast.makeText(getApplicationContext(),
                    &quot;NameNotFoundException: &quot; + e.getMessage(),
                    Toast.LENGTH_LONG).show();
        }
    }
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
uses-permission of &quot;android.permission.READ_EXTERNAL_STORAGE&quot; is needed in AndroidManifest.xml
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    package=&quot;android_er.blogspot.com.jexreadtextfile&quot;&amp;gt;
    &amp;lt;application
        android:allowBackup=&quot;true&quot;
        android:icon=&quot;@mipmap/ic_launcher&quot;
        android:label=&quot;@string/app_name&quot;
        android:roundIcon=&quot;@mipmap/ic_launcher_round&quot;
        android:supportsRtl=&quot;true&quot;
        android:theme=&quot;@style/Theme.JExReadTextFile&quot;&amp;gt;
        &amp;lt;activity android:name=&quot;.MainActivity&quot;&amp;gt;
            &amp;lt;intent-filter&amp;gt;
                &amp;lt;action android:name=&quot;android.intent.action.MAIN&quot; /&amp;gt;

                &amp;lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&amp;gt;
            &amp;lt;/intent-filter&amp;gt;
        &amp;lt;/activity&amp;gt;
    &amp;lt;/application&amp;gt;
    &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&amp;lt;uses-permission android:name=&quot;android.permission.READ_EXTERNAL_STORAGE&quot;/&amp;gt;&lt;/span&gt;&lt;/b&gt;
&amp;lt;/manifest&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;hr /&gt;
Kotlin version, basically auto-converted by Android Studio.
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;package android_er.blogspot.com.kexreadtextfile

import android.Manifest
import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.text.method.ScrollingMovementMethod
import android.view.View
import android.widget.Button
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import java.io.*


class MainActivity : AppCompatActivity() {
    //Try different files
    //var targetFile = &quot;/sdcard/Download/Test.txt&quot;;
    var targetFile = &quot;/proc/cpuinfo&quot;;
    //var targetFile = &quot;/proc/meminfo&quot;;
    //var targetFile = &quot;/proc/net/arp&quot; //Restricted since Android 10
    var btnRead: Button? = null
    var tvFileContent: TextView? = null
    var tvMsg: TextView? = null
    val PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 1
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        dispExInfo()
        btnRead = findViewById(R.id.read)
        btnRead!!.setText(targetFile)
        tvFileContent = findViewById(R.id.filecontent)
        //make this TextView scrollable
        tvFileContent!!.setMovementMethod(ScrollingMovementMethod())
        tvMsg = findViewById(R.id.msg)
        tvMsg!!.setText(&quot;Click on READ button&quot;)
        btnRead!!.setOnClickListener(View.OnClickListener {
            tvMsg!!.setText(&quot;READ button clicked&quot;)
            toReadFile()
        })
    }

    /*
    Request Permission at Runtime, before read file.
     */
    fun toReadFile() {
        if (ContextCompat.checkSelfPermission(this,
                        Manifest.permission.READ_EXTERNAL_STORAGE)
                != PackageManager.PERMISSION_GRANTED) {
            // Permission is not granted
            // Should we show an explanation?
            if (ActivityCompat.shouldShowRequestPermissionRationale(
                            this,
                            Manifest.permission.READ_EXTERNAL_STORAGE)) {
                // Show an explanation to the user *asynchronously* -- don&#39;t block
                // this thread waiting for the user&#39;s response! After the user
                // sees the explanation, try again to request the permission.

                //to simplify, call requestPermissions again
                Toast.makeText(applicationContext,
                        &quot;shouldShowRequestPermissionRationale&quot;,
                        Toast.LENGTH_LONG).show()
                ActivityCompat.requestPermissions(this,
                        arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE),
                        PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE)
            } else {
                // No explanation needed; request the permission
                ActivityCompat.requestPermissions(this,
                        arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE),
                        PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE)
            }
        } else {
            // permission granted
            readFile(targetFile)
        }
    }

    override fun onRequestPermissionsResult(
            requestCode: Int,
            permissions: Array&amp;lt;String&amp;gt;,
            grantResults: IntArray) {
        if (requestCode == PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE) {
            if (grantResults.size &amp;gt; 0
                    &amp;amp;&amp;amp; grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                // permission was granted.
                Toast.makeText(applicationContext,
                        &quot;permission was granted, thx:)&quot;,
                        Toast.LENGTH_LONG).show()
                readFile(targetFile)
            } else {
                // permission denied.
                Toast.makeText(applicationContext,
                        &quot;permission denied! Oh:(&quot;,
                        Toast.LENGTH_LONG).show()
            }
            return
        } else {
            super.onRequestPermissionsResult(requestCode, permissions, grantResults)
        }
    }

    fun readFile(f: String?) {
        val file = File(f)
        val stringBuilder = StringBuilder()
        try {
            val bufferedReader = BufferedReader(FileReader(file))
            var line: String?
            while (bufferedReader.readLine().also { line = it } != null) {
                stringBuilder.append(line)
                stringBuilder.append(&#39;\n&#39;)
            }
            bufferedReader.close()
            tvFileContent!!.text = stringBuilder
            tvMsg!!.text = &quot;Done&quot;
        } catch (e: FileNotFoundException) {
            e.printStackTrace()
            tvMsg!!.text = e.message
        } catch (e: IOException) {
            e.printStackTrace()
            tvMsg!!.text = e.message
        }
    }

    /* ==========================================
    display Exercise info
     */
    fun dispExInfo() {
        val tvExercise = findViewById&amp;lt;TextView&amp;gt;(R.id.exercise)
        val tvSysInfo = findViewById&amp;lt;TextView&amp;gt;(R.id.sysinfo)
        val tvSdkInfo = findViewById&amp;lt;TextView&amp;gt;(R.id.sdkinfo)
        tvExercise.append(&quot; (Kotlin)&quot;)
        val manufacturer = Build.MANUFACTURER
        val model = Build.MODEL
        val release = Build.VERSION.RELEASE
        tvSysInfo.text = &quot;&quot;&quot;
             $manufacturer
             $model
             Android: $release
             
             &quot;&quot;&quot;.trimIndent()
        val packageManager = packageManager
        val packageName = packageName
        val targetSdkVersion: Int
        val minSdkVersion: Int
        var versionCode: Int
        var versionName: String
        try {
            val packageInfo = packageManager.getPackageInfo(packageName, 0)
            val applicationInfo = packageInfo.applicationInfo
            targetSdkVersion = applicationInfo.targetSdkVersion
            minSdkVersion = applicationInfo.minSdkVersion
            tvSdkInfo.text = &quot;&quot;&quot;
                targetSdkVersion = $targetSdkVersion
                minSdkVersion = $minSdkVersion
                &quot;&quot;&quot;.trimIndent()
        } catch (e: PackageManager.NameNotFoundException) {
            e.printStackTrace()
            Toast.makeText(applicationContext,
                    &quot;NameNotFoundException: &quot; + e.message,
                    Toast.LENGTH_LONG).show()
        }
    }
}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcxmXhOrryeEBkL_S42fo3fvMCkMBFj5i0JTOM_56joZzm1ZCjXYE5kk0kG82_bM9uWpLKSv0BBBk_0LHyeMkRiP-IIRjWKOjrrSHENy7R_BTsG1ZKzKpvLZGuRXMepA6KzW2HqRs2F74/s2000/kExReadTextFile.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1200&quot; data-original-width=&quot;2000&quot; height=&quot;384&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcxmXhOrryeEBkL_S42fo3fvMCkMBFj5i0JTOM_56joZzm1ZCjXYE5kk0kG82_bM9uWpLKSv0BBBk_0LHyeMkRiP-IIRjWKOjrrSHENy7R_BTsG1ZKzKpvLZGuRXMepA6KzW2HqRs2F74/w640-h384/kExReadTextFile.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/7590027444572217533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/7590027444572217533' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/7590027444572217533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/7590027444572217533'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2021/01/read-text-file-with-request-permission.html' title='Android read text file with request permission at runtime'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/DRsnrKtUuQc/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-2942708035513832959</id><published>2020-12-17T10:55:00.002-08:00</published><updated>2020-12-17T10:58:36.645-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ex.Android.Kotlin"/><title type='text'>Android Kotlin exercise: detect touch on individual view</title><content type='html'>&lt;p&gt;&amp;nbsp;This example show how to detect touch on individual view.&lt;/p&gt;
&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/tZB2iKwL2NI&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;/center&gt;
&lt;br /&gt;
Example code
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;
package com.blogspot.android_er.exmyview

import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.MotionEvent
import android.widget.ImageView
import android.widget.TextView

/*
ref: 
https://developer.android.com/training/gestures/detector#capture-touch-events-for-a-single-view
Android Developers Guides &amp;gt; Detect common gestures &amp;gt; Capture touch events for a single view
 */

class MainActivity : AppCompatActivity() {
    private lateinit var ivIcon: ImageView
    private lateinit var tvSysInfo: TextView
    private lateinit var tvSdkInfo: TextView
    private lateinit var tvConsole: TextView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        ivIcon = findViewById(R.id.icon)
        tvSysInfo = findViewById(R.id.sysinfo)
        tvSdkInfo = findViewById(R.id.sdkinfo)
        tvConsole = findViewById(R.id.console)

        val manufacturer = Build.MANUFACTURER
        val model = Build.MODEL
        val release = Build.VERSION.RELEASE

        val pkgInfo = packageManager.getPackageInfo(packageName, 0)
        val appInfo = pkgInfo.applicationInfo
        val targetSdkVersion = appInfo.targetSdkVersion
        val minSdkVersion = appInfo.minSdkVersion

        tvSysInfo.text = manufacturer + &quot;\n&quot; +
                model + &quot;\n&quot; + &quot;Android: &quot; + release
        tvSdkInfo.text = &quot;targetSdkVersion: &quot; + targetSdkVersion + &quot;\n&quot; +
                &quot;minSdkVersion: &quot; + minSdkVersion

        tvConsole.text = &quot;Android Example:&quot; +
                &quot;\nCapture touch events for a single view&quot;

        ivIcon.setOnTouchListener { v, event -&amp;gt; // ... Respond to touch events
            /*
            return true if the listener has consumed the event, false otherwise.
             */
            val action = event.action
            when (action) {
                MotionEvent.ACTION_DOWN -&amp;gt; {
                    /*
                    Beware of creating a listener that returns false
                    for the ACTION_DOWN event.
                    If you do this, the listener will not be called
                    for the subsequent ACTION_MOVE and ACTION_UP string of events.
                    This is because ACTION_DOWN is the starting point for all touch events.
                     */

                    tvConsole.text = &quot;ACTION_DOWN@ivIcon&quot;

                    true}
                MotionEvent.ACTION_MOVE -&amp;gt; {
                    tvConsole.append(&quot;\nACTION_MOVE@ivIcon&quot;)
                    true}
                MotionEvent.ACTION_UP -&amp;gt; {
                    tvConsole.text = &quot;ACTION_UP@ivIcon&quot;
                    true}
                MotionEvent.ACTION_CANCEL -&amp;gt; {
                    tvConsole.text = &quot;ACTION_CANCEL@ivIcon&quot;
                    true}
                MotionEvent.ACTION_OUTSIDE -&amp;gt; {
                    tvConsole.text = &quot;ACTION_OUTSIDE@ivIcon&quot;
                    true}
                else -&amp;gt; super.onTouchEvent(event)
            }

        }

        tvSysInfo.setOnTouchListener { v, event -&amp;gt; // ... Respond to touch events

            when (event.action) {
                MotionEvent.ACTION_DOWN -&amp;gt; {
                    tvConsole.text = &quot;ACTION_DOWN@tvSysInfo&quot;
                    true}
                MotionEvent.ACTION_MOVE -&amp;gt; {
                    tvConsole.append(&quot;\nACTION_MOVE@tvSysInfo&quot;)
                    true}
                MotionEvent.ACTION_UP -&amp;gt; {
                    tvConsole.text = &quot;ACTION_UP@tvSysInfo&quot;
                    true}
                MotionEvent.ACTION_CANCEL -&amp;gt; {
                    tvConsole.text = &quot;ACTION_CANCEL@tvSysInfo&quot;
                    true}
                MotionEvent.ACTION_OUTSIDE -&amp;gt; {
                    tvConsole.text = &quot;ACTION_OUTSIDE@tvSysInfo&quot;
                    true}
                else -&amp;gt; super.onTouchEvent(event)
            }
        }

        tvSdkInfo.setOnTouchListener { v, event -&amp;gt; // ... Respond to touch events

            when (event.action) {
                MotionEvent.ACTION_DOWN -&amp;gt; {
                    tvConsole.text = &quot;ACTION_DOWN@tvSdkInfo&quot;
                    true}
                MotionEvent.ACTION_MOVE -&amp;gt; {
                    tvConsole.append(&quot;\nACTION_MOVE@tvSdkInfo&quot;)
                    true}
                MotionEvent.ACTION_UP -&amp;gt; {
                    tvConsole.text = &quot;ACTION_UP@tvSdkInfo&quot;
                    true}
                MotionEvent.ACTION_CANCEL -&amp;gt; {
                    tvConsole.text = &quot;ACTION_CANCEL@tvSdkInfo&quot;
                    true}
                MotionEvent.ACTION_OUTSIDE -&amp;gt; {
                    tvConsole.text = &quot;ACTION_OUTSIDE@tvSdkInfo&quot;
                    true}
                else -&amp;gt; super.onTouchEvent(event)
            }
        }
    }
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
layout
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;LinearLayout
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    android:orientation=&quot;horizontal&quot;
    tools:context=&quot;.MainActivity&quot;&amp;gt;

    &amp;lt;LinearLayout
        android:id=&quot;@+id/leftpanel&quot;
        android:layout_width=&quot;0dp&quot;
        android:layout_height=&quot;match_parent&quot;
        android:layout_weight=&quot;1&quot;
        android:orientation=&quot;vertical&quot;
        android:background=&quot;#E0E0E0&quot;
        android:layout_margin=&quot;5dp&quot;&amp;gt;

        &amp;lt;ImageView
            android:id=&quot;@+id/icon&quot;
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:layout_margin=&quot;5dp&quot;
            android:padding=&quot;5dp&quot;
            android:background=&quot;#0000F0&quot;
            android:src=&quot;@mipmap/ic_launcher_round&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/sysinfo&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:layout_margin=&quot;5dp&quot;
            android:padding=&quot;5dp&quot;
            android:background=&quot;#0000D0&quot;
            android:textSize=&quot;20dp&quot;
            android:textStyle=&quot;bold&quot;
            android:textColor=&quot;@color/white&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/sdkinfo&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:layout_margin=&quot;5dp&quot;
            android:padding=&quot;5dp&quot;
            android:background=&quot;#0000B0&quot;
            android:textSize=&quot;20dp&quot;
            android:textStyle=&quot;bold&quot;
            android:textColor=&quot;@color/white&quot;/&amp;gt;

    &amp;lt;/LinearLayout&amp;gt;

    &amp;lt;LinearLayout
        android:id=&quot;@+id/rightpanel&quot;
        android:layout_width=&quot;0dp&quot;
        android:layout_height=&quot;match_parent&quot;
        android:layout_weight=&quot;1&quot;
        android:orientation=&quot;vertical&quot;
        android:background=&quot;#C0C0C0&quot;&amp;gt;
        &amp;lt;TextView
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:layout_margin=&quot;5dp&quot;
            android:padding=&quot;5dp&quot;
            android:textSize=&quot;20dp&quot;
            android:textStyle=&quot;bold&quot;
            android:textColor=&quot;@color/white&quot;
            android:text=&quot;android-er.blogspot.com&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/console&quot;
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:layout_margin=&quot;5dp&quot;
            android:padding=&quot;5dp&quot;
            android:textSize=&quot;30dp&quot;
            android:textStyle=&quot;bold&quot;
            android:gravity=&quot;bottom&quot;/&amp;gt;
    &amp;lt;/LinearLayout&amp;gt;
&amp;lt;/LinearLayout&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/2942708035513832959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/2942708035513832959' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/2942708035513832959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/2942708035513832959'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/12/android-kotlin-exercise-detect-touch-on.html' title='Android Kotlin exercise: detect touch on individual view'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/tZB2iKwL2NI/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-8692621850953308891</id><published>2020-12-11T11:27:00.004-08:00</published><updated>2020-12-11T11:27:33.517-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux Mint"/><title type='text'>Linux Mint: Add Program Launcher to Menu</title><content type='html'>&lt;p&gt;As a example, this video show how to Add Program Launcher to Menu on Linux Mint 20, to run idea.sh in /opt/idea-IC-203.5981.155/bin folder.&lt;/p&gt;
&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/0CFNCkMKp44&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;center&gt;&lt;/center&gt;&lt;/center&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/8692621850953308891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/8692621850953308891' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/8692621850953308891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/8692621850953308891'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/12/linux-mint-add-program-launcher-to-menu.html' title='Linux Mint: Add Program Launcher to Menu'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/0CFNCkMKp44/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-3854946957385426368</id><published>2020-12-10T15:06:00.005-08:00</published><updated>2020-12-11T11:29:16.450-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Development Tools"/><category scheme="http://www.blogger.com/atom/ns#" term="IntelliJ IDEA"/><category scheme="http://www.blogger.com/atom/ns#" term="learn Kotlin"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux Mint"/><title type='text'>Install IntelliJ IDEA on Linux Mint 20</title><content type='html'>Steps to install Jetbrains IntelliJ IDEA&amp;nbsp;Community Edition 2020.3 on Linux Mint 20, tested on VirtualBox.&lt;div&gt;&amp;nbsp; 
&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/0e1SVL7j0_8&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;&lt;/center&gt;

&lt;p&gt;IntelliJ IDEA is a cross-platform IDE on the Windows, macOS, and Linux operating systems. It is available in the following editions:&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Community Edition is free and open-source, licensed under Apache 2.0. It provides all the basic features for JVM and Android development.&lt;/li&gt;&lt;li&gt;IntelliJ IDEA Ultimate is commercial, distributed with a 30-day trial period. It provides additional tools and features for web and enterprise development.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;To install&amp;nbsp;IntelliJ IDEA Community Edition on Linux Mint:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Visit: &lt;a href=&quot;https://www.jetbrains.com/idea/download/&quot; target=&quot;_blank&quot;&gt;https://www.jetbrains.com/idea/download/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Download .tar.gz of Community Edition.&lt;/p&gt;&lt;p&gt;Extract the tarball to a directory that supports file execution.&lt;br /&gt;For example, to extract it to the recommended /opt directory, run the following command:&lt;/p&gt;&lt;p&gt;$ sudo tar -xzf &amp;lt;downloaded file&amp;gt; -C /opt&lt;/p&gt;&lt;p&gt;Execute the idea.sh script from the extracted directory to run IntelliJ IDEA. or &lt;a href=&quot;https://android-er.blogspot.com/2020/12/linux-mint-add-program-launcher-to-menu.html&quot;&gt;&lt;b&gt;add a program launcher to Linux Mint Menu to run idea.sh&lt;/b&gt;&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;ref:&amp;nbsp;&lt;a href=&quot;https://www.jetbrains.com/help/idea/installation-guide.html&quot; target=&quot;_blank&quot;&gt;https://www.jetbrains.com/help/idea/installation-guide.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/3854946957385426368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/3854946957385426368' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/3854946957385426368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/3854946957385426368'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/12/install-intellij-idea-on-linux-mint-20.html' title='Install IntelliJ IDEA on Linux Mint 20'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/0e1SVL7j0_8/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-7815224635978205422</id><published>2020-11-14T06:59:00.002-08:00</published><updated>2020-11-14T06:59:58.742-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="how to"/><title type='text'>How to power-on without using POWER button, Xiaomi/Redmi Phone</title><content type='html'>It is a common case that the POWER button of your phone is broken, such that you cannot power it on in power-off mode. This video show how to power up&amp;nbsp;Xiaomi phone in Recovery Mode, then switch to normal mode, without POWER button.&lt;div&gt;&amp;nbsp;
&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/gfX93p7_jFg&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;&lt;/center&gt;
&lt;br /&gt;
&lt;p&gt;&lt;b&gt;How to power-on without using POWER button, Xiaomi/Redmi Phone&lt;/b&gt;&lt;/p&gt;&lt;p&gt;When phone is Power OFF:&lt;br /&gt;Press and Hold VOL-UP button, Insert USB Power cable, to enter Recovery Mode.&lt;/p&gt;&lt;p&gt;With Reboot option selected, just WAIT, the phone will reboot in around 4 minutes.&lt;/p&gt;&lt;p&gt;Tested on Xiaomi Mi 10 Lite 5G, also Redmi 5 Plus/Note 4X.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/7815224635978205422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/7815224635978205422' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/7815224635978205422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/7815224635978205422'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/11/how-to-power-on-without-using-power.html' title='How to power-on without using POWER button, Xiaomi/Redmi Phone'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/gfX93p7_jFg/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-8052536679207881350</id><published>2020-11-02T13:02:00.004-08:00</published><updated>2020-11-03T12:25:15.321-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ex.Android.Kotlin"/><title type='text'>Android exercise: ImageFilterView (Kotlin)</title><content type='html'>&lt;p&gt;&lt;b&gt;&lt;a href=&quot;https://developer.android.com/reference/androidx/constraintlayout/utils/widget/ImageFilterView&quot; target=&quot;_blank&quot;&gt;ImageFilterView&lt;/a&gt;&lt;/b&gt; is a An ImageView that can display, combine and filter images, to handle various common filtering operations. You can set&amp;nbsp;saturation, contrast, warmth and some othters (refer to the document) in layout XML, or change it at run-time.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/HQIOdMTPuOY&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;  
&lt;/center&gt;
&lt;p&gt;&lt;/p&gt;&lt;p&gt;ImageFilterView was added in ConstraintLayout 2.0, so make sure&amp;nbsp;dependencies of&amp;nbsp;implementation &#39;androidx.constraintlayout:constraintlayout:2.0.0&#39; or higher is include in your build.grade(Module:) file.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4vJ2-dRhbvq1Nyf1iEPHTpHi8RIGhqpEa4Bp3sSDqvzTlB2LaJcNHO9dsIzf9SWWCbxRKPINnc-Ugo9wgra5jBnQV00GT-EEu95dBEVwSKKiU7t-NLUn4Ne_GFJcetP6Ekxtvdxh_pnk/s1366/ConstraintLayout+dependencies.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1366&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4vJ2-dRhbvq1Nyf1iEPHTpHi8RIGhqpEa4Bp3sSDqvzTlB2LaJcNHO9dsIzf9SWWCbxRKPINnc-Ugo9wgra5jBnQV00GT-EEu95dBEVwSKKiU7t-NLUn4Ne_GFJcetP6Ekxtvdxh_pnk/w640-h360/ConstraintLayout+dependencies.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;build.grade(Module:)&lt;br /&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;dependencies {
    implementation &#39;androidx.constraintlayout:constraintlayout:2.0.4&#39;
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;  
Layout XML:
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    android:layout_margin=&quot;20dp&quot;
    tools:context=&quot;.MainActivity&quot;&amp;gt;

    &amp;lt;LinearLayout
        android:id=&quot;@+id/header&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:orientation=&quot;vertical&quot;
        app:layout_constraintBottom_toTopOf=&quot;@id/imagefilterview&quot;
        app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
        app:layout_constraintRight_toRightOf=&quot;parent&quot;
        app:layout_constraintTop_toTopOf=&quot;parent&quot;&amp;gt;

        &amp;lt;TextView
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:layout_gravity=&quot;center&quot;
            android:text=&quot;ImageFilterView Example (Kotlin)&quot;
            android:textStyle=&quot;bold&quot; /&amp;gt;

        &amp;lt;TextView
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:layout_gravity=&quot;center&quot;
            android:text=&quot;Android-er.blogspot.com&quot; /&amp;gt;
        &amp;lt;ImageView
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:src=&quot;@android:mipmap/sym_def_app_icon&quot;/&amp;gt;

    &amp;lt;/LinearLayout&amp;gt;

    &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&amp;lt;androidx.constraintlayout.utils.widget.ImageFilterView
        android:id=&quot;@+id/imagefilterview&quot;
        android:src=&quot;@android:mipmap/sym_def_app_icon&quot;
        android:layout_width=&quot;0dp&quot;
        android:layout_height=&quot;0dp&quot;
        app:layout_constraintBottom_toTopOf=&quot;@id/panel&quot;
        app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
        app:layout_constraintRight_toRightOf=&quot;parent&quot;
        app:layout_constraintTop_toBottomOf=&quot;@id/header&quot;
        app:saturation=&quot;1.0&quot;
        app:contrast=&quot;1.0&quot;
        app:brightness=&quot;1.0&quot;/&amp;gt;&lt;/span&gt;&lt;/b&gt;

    &amp;lt;LinearLayout
        android:id=&quot;@+id/panel&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:orientation=&quot;vertical&quot;
        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
        app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
        app:layout_constraintRight_toRightOf=&quot;parent&quot;
        app:layout_constraintTop_toBottomOf=&quot;@id/imagefilterview&quot;&amp;gt;

        &amp;lt;TextView
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:text=&quot;Saturation&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/sat&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;/&amp;gt;
        &amp;lt;SeekBar
            android:id=&quot;@+id/seekBarSat&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:max=&quot;100&quot;
            android:progress=&quot;50&quot;/&amp;gt;

        &amp;lt;TextView
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:text=&quot;Contrast&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/cont&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;/&amp;gt;
        &amp;lt;SeekBar
            android:id=&quot;@+id/seekBarCont&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:max=&quot;100&quot;
            android:progress=&quot;50&quot;/&amp;gt;

        &amp;lt;TextView
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:text=&quot;Warmth&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/warm&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;/&amp;gt;
        &amp;lt;SeekBar
            android:id=&quot;@+id/seekBarWarm&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:max=&quot;100&quot;
            android:progress=&quot;50&quot;/&amp;gt;
    &amp;lt;/LinearLayout&amp;gt;

&amp;lt;/androidx.constraintlayout.widget.ConstraintLayout&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;Kotlin code:
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;package com.blogspot.android_er.eximgfilterview2

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.SeekBar
import android.widget.TextView
import androidx.constraintlayout.utils.widget.ImageFilterView

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val MyImageFilterView =
                findViewById&amp;lt;ImageFilterView&amp;gt;(R.id.imagefilterview)

        val MySeekBarSat = findViewById&amp;lt;SeekBar&amp;gt;(R.id.seekBarSat)
        val MyTextViewSat = findViewById&amp;lt;TextView&amp;gt;(R.id.sat)
        val MySeekBarCont = findViewById&amp;lt;SeekBar&amp;gt;(R.id.seekBarCont)
        val MyTextViewCont = findViewById&amp;lt;TextView&amp;gt;(R.id.cont)
        val MySeekBarWarm = findViewById&amp;lt;SeekBar&amp;gt;(R.id.seekBarWarm)
        val MyTextViewWarm = findViewById&amp;lt;TextView&amp;gt;(R.id.warm)

        //Get the first-run setting of saturation, contrast and warmth
        MyTextViewSat.text= MyImageFilterView.saturation.toString()
        MyTextViewCont.text= MyImageFilterView.contrast.toString()
        MyTextViewWarm.text= MyImageFilterView.warmth.toString()

        MySeekBarSat.setOnSeekBarChangeListener(
                object : SeekBar.OnSeekBarChangeListener{
            override fun onProgressChanged(seekBar: SeekBar?,
                                           progress: Int, fromUser: Boolean) {
                //update saturation
                MyImageFilterView.saturation = (progress / 100.0f) * 2
                //read back the saturation
                MyTextViewSat.text= MyImageFilterView.saturation.toString()
            }

            override fun onStartTrackingTouch(seekBar: SeekBar?) {}

            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
        })

        MySeekBarCont.setOnSeekBarChangeListener(
                object : SeekBar.OnSeekBarChangeListener{
            override fun onProgressChanged(seekBar: SeekBar?,
                                           progress: Int, fromUser: Boolean) {
                MyImageFilterView.contrast = (progress / 100.0f) * 2
                MyTextViewCont.text= MyImageFilterView.contrast.toString()
            }

            override fun onStartTrackingTouch(seekBar: SeekBar?) {}

            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
        })

        MySeekBarWarm.setOnSeekBarChangeListener(
                object : SeekBar.OnSeekBarChangeListener{
            override fun onProgressChanged(seekBar: SeekBar?,
                                           progress: Int, fromUser: Boolean) {
                MyImageFilterView.warmth = (progress / 100.0f) * 2
                MyTextViewWarm.text= MyImageFilterView.warmth.toString()
            }

            override fun onStartTrackingTouch(seekBar: SeekBar?) {}

            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
        })
    }
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;hr /&gt;
Then add the feature to change Crossfade, also show how overlay setting affect the crossfade result.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/5ggjjWsn-BA&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;/center&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Layout XML:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    android:layout_margin=&quot;20dp&quot;
    tools:context=&quot;.MainActivity&quot;&amp;gt;

    &amp;lt;LinearLayout
        android:id=&quot;@+id/header&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:orientation=&quot;vertical&quot;
        app:layout_constraintBottom_toTopOf=&quot;@id/imagefilterview&quot;
        app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
        app:layout_constraintRight_toRightOf=&quot;parent&quot;
        app:layout_constraintTop_toTopOf=&quot;parent&quot;&amp;gt;

        &amp;lt;TextView
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:layout_gravity=&quot;center&quot;
            android:text=&quot;ImageFilterView Example (Kotlin)&quot;
            android:textStyle=&quot;bold&quot; /&amp;gt;

        &amp;lt;TextView
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:layout_gravity=&quot;center&quot;
            android:text=&quot;Android-er.blogspot.com&quot; /&amp;gt;
        &amp;lt;ImageView
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:src=&quot;@android:mipmap/sym_def_app_icon&quot;/&amp;gt;

    &amp;lt;/LinearLayout&amp;gt;

    &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&amp;lt;androidx.constraintlayout.utils.widget.ImageFilterView
        android:id=&quot;@+id/imagefilterview&quot;
        android:layout_width=&quot;0dp&quot;
        android:layout_height=&quot;0dp&quot;
        app:layout_constraintBottom_toTopOf=&quot;@id/panel&quot;
        app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
        app:layout_constraintRight_toRightOf=&quot;parent&quot;
        app:layout_constraintTop_toBottomOf=&quot;@id/header&quot;

        android:src=&quot;@android:mipmap/sym_def_app_icon&quot;
        app:altSrc=&quot;@android:drawable/btn_star_big_on&quot;
        app:overlay=&quot;false&quot;
        app:crossfade=&quot;0.0&quot;
        app:saturation=&quot;1.0&quot;
        app:contrast=&quot;1.0&quot;
        app:warmth=&quot;1.0&quot;
         /&amp;gt;
&lt;/span&gt;&lt;/b&gt;
    &amp;lt;LinearLayout
        android:id=&quot;@+id/panel&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:orientation=&quot;vertical&quot;
        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
        app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
        app:layout_constraintRight_toRightOf=&quot;parent&quot;
        app:layout_constraintTop_toBottomOf=&quot;@id/imagefilterview&quot;&amp;gt;

        &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&amp;lt;TextView
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:text=&quot;Crossfade&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/crossfade&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;/&amp;gt;
        &amp;lt;SeekBar
            android:id=&quot;@+id/seekBarCrossfade&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:max=&quot;100&quot;
            android:progress=&quot;0&quot;/&amp;gt;&lt;/span&gt;&lt;/b&gt;

        &amp;lt;TextView
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:text=&quot;Saturation&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/sat&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;/&amp;gt;
        &amp;lt;SeekBar
            android:id=&quot;@+id/seekBarSat&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:max=&quot;100&quot;
            android:progress=&quot;50&quot;/&amp;gt;

        &amp;lt;TextView
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:text=&quot;Contrast&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/cont&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;/&amp;gt;
        &amp;lt;SeekBar
            android:id=&quot;@+id/seekBarCont&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:max=&quot;100&quot;
            android:progress=&quot;50&quot;/&amp;gt;

        &amp;lt;TextView
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:text=&quot;Warmth&quot;/&amp;gt;
        &amp;lt;TextView
            android:id=&quot;@+id/warm&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;/&amp;gt;
        &amp;lt;SeekBar
            android:id=&quot;@+id/seekBarWarm&quot;
            android:layout_width=&quot;match_parent&quot;
            android:layout_height=&quot;wrap_content&quot;
            android:max=&quot;100&quot;
            android:progress=&quot;50&quot;/&amp;gt;
    &amp;lt;/LinearLayout&amp;gt;

&amp;lt;/androidx.constraintlayout.widget.ConstraintLayout&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Kotlin code:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span&gt;package com.blogspot.android_er.eximgfilterview2

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.SeekBar
import android.widget.TextView
import androidx.constraintlayout.utils.widget.ImageFilterView

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val MyImageFilterView =
                findViewById&amp;lt;ImageFilterView&amp;gt;(R.id.imagefilterview)

        &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;val MySeekBarCrossfade = findViewById&amp;lt;SeekBar&amp;gt;(R.id.seekBarCrossfade)
        val MyTextViewCrossfade = findViewById&amp;lt;TextView&amp;gt;(R.id.crossfade)&lt;/span&gt;&lt;/b&gt;

        val MySeekBarSat = findViewById&amp;lt;SeekBar&amp;gt;(R.id.seekBarSat)
        val MyTextViewSat = findViewById&amp;lt;TextView&amp;gt;(R.id.sat)
        val MySeekBarCont = findViewById&amp;lt;SeekBar&amp;gt;(R.id.seekBarCont)
        val MyTextViewCont = findViewById&amp;lt;TextView&amp;gt;(R.id.cont)
        val MySeekBarWarm = findViewById&amp;lt;SeekBar&amp;gt;(R.id.seekBarWarm)
        val MyTextViewWarm = findViewById&amp;lt;TextView&amp;gt;(R.id.warm)

        //Get the first-run setting of crossfade, saturation, contrast and warmth
        &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;MyTextViewCrossfade.text= MyImageFilterView.crossfade.toString()&lt;/span&gt;&lt;/b&gt;
        MyTextViewSat.text= MyImageFilterView.saturation.toString()
        MyTextViewCont.text= MyImageFilterView.contrast.toString()
        MyTextViewWarm.text= MyImageFilterView.warmth.toString()

        &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;MySeekBarCrossfade.setOnSeekBarChangeListener(
                object : SeekBar.OnSeekBarChangeListener{
                    override fun onProgressChanged(seekBar: SeekBar?,
                                                   progress: Int, fromUser: Boolean) {
                        //update saturation
                        MyImageFilterView.crossfade = (progress / 100.0f)
                        //read back the saturation
                        MyTextViewCrossfade.text= MyImageFilterView.crossfade.toString()
                    }

                    override fun onStartTrackingTouch(seekBar: SeekBar?) {}

                    override fun onStopTrackingTouch(seekBar: SeekBar?) {}
                })&lt;/span&gt;&lt;/b&gt;

        MySeekBarSat.setOnSeekBarChangeListener(
                object : SeekBar.OnSeekBarChangeListener{
            override fun onProgressChanged(seekBar: SeekBar?,
                                           progress: Int, fromUser: Boolean) {
                //update saturation
                MyImageFilterView.saturation = (progress / 100.0f) * 2
                //read back the saturation
                MyTextViewSat.text= MyImageFilterView.saturation.toString()
            }

            override fun onStartTrackingTouch(seekBar: SeekBar?) {}

            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
        })

        MySeekBarCont.setOnSeekBarChangeListener(
                object : SeekBar.OnSeekBarChangeListener{
            override fun onProgressChanged(seekBar: SeekBar?,
                                           progress: Int, fromUser: Boolean) {
                MyImageFilterView.contrast = (progress / 100.0f) * 2
                MyTextViewCont.text= MyImageFilterView.contrast.toString()
            }

            override fun onStartTrackingTouch(seekBar: SeekBar?) {}

            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
        })

        MySeekBarWarm.setOnSeekBarChangeListener(
                object : SeekBar.OnSeekBarChangeListener{
            override fun onProgressChanged(seekBar: SeekBar?,
                                           progress: Int, fromUser: Boolean) {
                MyImageFilterView.warmth = (progress / 100.0f) * 2
                MyTextViewWarm.text= MyImageFilterView.warmth.toString()
            }

            override fun onStartTrackingTouch(seekBar: SeekBar?) {}

            override fun onStopTrackingTouch(seekBar: SeekBar?) {}
        })
    }
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/8052536679207881350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/8052536679207881350' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/8052536679207881350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/8052536679207881350'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/11/android-exercise-imagefilterview-kotlin.html' title='Android exercise: ImageFilterView (Kotlin)'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/HQIOdMTPuOY/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-4648700565529113411</id><published>2020-10-11T14:08:00.001-07:00</published><updated>2020-10-11T14:08:47.169-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio.how to"/><title type='text'>What&#39;s the difference between system image with Google API and Google APIs? when create Android Virtual Device</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrB0UQ5_BF88j-WtlYRYoTWACesq-DSpfsuZcAg6Lr98jA7lEFfO5Xk6L9ip2ZyyIyKRj45zAxsUonyPq8_bdWWk6rmu4c_rYx0COmQ89SzfxTljvkNLQJ-r_b2MpD1DCY30dv7CEXmBY/s1366/Select+a+system+image.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1366&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrB0UQ5_BF88j-WtlYRYoTWACesq-DSpfsuZcAg6Lr98jA7lEFfO5Xk6L9ip2ZyyIyKRj45zAxsUonyPq8_bdWWk6rmu4c_rYx0COmQ89SzfxTljvkNLQJ-r_b2MpD1DCY30dv7CEXmBY/w640-h360/Select+a+system+image.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;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&#39;s the difference?&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;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.&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;reference:&amp;nbsp;&lt;a href=&quot;https://developer.android.com/studio/run/managing-avds#system-image&quot; target=&quot;_blank&quot;&gt;https://developer.android.com/studio/run/managing-avds#system-image&lt;/a&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfEWSsz7uWnsZTAF1pSqahLQM32tugUBPlTpu_QV1W4eA1RQ4QBa-8fU18ABCmqBO4N7JNQk4Z9LySymP2OmFdtiMgWdnoMiWTk0nxHgKaQJ86gAPfiwI-NCdjU5Vb-tS0qgAQlWNsohs/s1366/System+Images.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1366&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfEWSsz7uWnsZTAF1pSqahLQM32tugUBPlTpu_QV1W4eA1RQ4QBa-8fU18ABCmqBO4N7JNQk4Z9LySymP2OmFdtiMgWdnoMiWTk0nxHgKaQJ86gAPfiwI-NCdjU5Vb-tS0qgAQlWNsohs/w640-h360/System+Images.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;i&gt;Including a Google Play tab in the Extended controls dialog that provides a convenient button for updating Google Play services on the device.&lt;/i&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3dQNCYEldUE1Fd3Jjn30e-wyiJsyX0ZGL9bpLB1THzQYgEWPAO310npowMEPIgrh5Xxbw9NLiexb5_3r-nZ0MZhbYlFpt3FSaYRosoxD-cCfm6B1wLXPgi3WjivpIJ4rartMC65bRfOw/s1366/Google+Play+Services.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1366&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3dQNCYEldUE1Fd3Jjn30e-wyiJsyX0ZGL9bpLB1THzQYgEWPAO310npowMEPIgrh5Xxbw9NLiexb5_3r-nZ0MZhbYlFpt3FSaYRosoxD-cCfm6B1wLXPgi3WjivpIJ4rartMC65bRfOw/w640-h360/Google+Play+Services.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/4648700565529113411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/4648700565529113411' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/4648700565529113411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/4648700565529113411'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/10/whats-difference-between-system-image.html' title='What&#39;s the difference between system image with Google API and Google APIs? when create Android Virtual Device'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrB0UQ5_BF88j-WtlYRYoTWACesq-DSpfsuZcAg6Lr98jA7lEFfO5Xk6L9ip2ZyyIyKRj45zAxsUonyPq8_bdWWk6rmu4c_rYx0COmQ89SzfxTljvkNLQJ-r_b2MpD1DCY30dv7CEXmBY/s72-w640-h360-c/Select+a+system+image.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-4037992588471410115</id><published>2020-09-03T06:57:00.002-07:00</published><updated>2020-09-03T06:59:53.440-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android Developer&#39;s news"/><title type='text'>Kotlin Multiplatform Mobile Alpha and portal released</title><content type='html'>&lt;p&gt;Kotlin Multiplatform Mobile is a solution to write once for Android and iOS apps, using Kotlin.&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;details: &lt;a href=&quot;https://blog.jetbrains.com/kotlin/2020/08/kotlin-multiplatform-mobile-goes-alpha/&quot; target=&quot;_blank&quot;&gt;Kotlin Blog -&amp;nbsp;Kotlin Multiplatform Mobile Goes Alpha&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The new&amp;nbsp;&lt;a href=&quot;https://kotlinlang.org/lp/mobile/&quot; target=&quot;_blank&quot;&gt;Kotlin Multiplatform Mobile developer portal&lt;/a&gt; is up, have all you need to know to create cross-platform apps.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/4037992588471410115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/4037992588471410115' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/4037992588471410115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/4037992588471410115'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/09/kotlin-multiplatform-mobile-alpha-and.html' title='Kotlin Multiplatform Mobile Alpha and portal released'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-7973533318955255442</id><published>2020-08-26T10:44:00.005-07:00</published><updated>2020-08-26T10:44:52.614-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ex.Android.Kotlin"/><category scheme="http://www.blogger.com/atom/ns#" term="ex.android.widget"/><title type='text'>Chronometer example (Kotlin)</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;span color=&quot;&quot; face=&quot;&quot; style=&quot;white-space: pre-wrap;&quot;&gt;Android example of using Chronometer (count-up and count-down) widget, with Kotlin&lt;/span&gt;&lt;/p&gt;&lt;center&gt;&lt;span color=&quot;&quot; face=&quot;&quot; style=&quot;white-space: pre-wrap;&quot;&gt;&lt;iframe allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/INZ0Mg-mYwY&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;/span&gt;&lt;/center&gt;&lt;span color=&quot;&quot; face=&quot;&quot; style=&quot;white-space: pre-wrap;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span color=&quot;&quot; face=&quot;&quot; style=&quot;white-space: pre-wrap;&quot;&gt;Layout with Chronometer&lt;/span&gt;&lt;/p&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;LinearLayout
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    android:orientation=&quot;vertical&quot;
    tools:context=&quot;.MainActivity&quot;
    android:layout_margin=&quot;10dp&quot;&amp;gt;

    &amp;lt;TextView
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:textStyle=&quot;bold&quot;
        android:text=&quot;Chronometer Example (Kotlin)&quot;
        android:layout_gravity=&quot;center&quot;/&amp;gt;
    &amp;lt;TextView
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Android-er.blogspot.com&quot;
        android:layout_gravity=&quot;center&quot;/&amp;gt;
    &amp;lt;Chronometer
        android:id=&quot;@+id/chronometer&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:textSize=&quot;34dp&quot;
        android:textStyle=&quot;bold&quot;/&amp;gt;
    &amp;lt;Button
        android:id=&quot;@+id/start&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Start (Count Up)&quot;/&amp;gt;
    &amp;lt;Button
        android:id=&quot;@+id/stop&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Stop&quot;/&amp;gt;
    &amp;lt;Button
        android:id=&quot;@+id/reset&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Reset&quot;/&amp;gt;

    &amp;lt;Chronometer
        android:id=&quot;@+id/chronometerDn&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:textSize=&quot;34dp&quot;
        android:textStyle=&quot;bold&quot;
        android:countDown=&quot;true&quot;/&amp;gt;
    &amp;lt;Button
        android:id=&quot;@+id/startDn&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Start (Count Down)&quot;/&amp;gt;
    &amp;lt;Button
        android:id=&quot;@+id/stopDn&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Stop&quot;/&amp;gt;
    &amp;lt;Button
        android:id=&quot;@+id/resetDn&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Reset&quot;/&amp;gt;

&amp;lt;/LinearLayout&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
Android Kotlin code&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;package com.blogspot.android_er.androidchronometer

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.SystemClock
import android.widget.Button
import android.widget.Chronometer
import android.widget.Toast

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val myChronometer = findViewById&amp;lt;Chronometer&amp;gt;(R.id.chronometer)
        val btnStart = findViewById&amp;lt;Button&amp;gt;(R.id.start)
        val btnStop = findViewById&amp;lt;Button&amp;gt;(R.id.stop)
        val btnReset = findViewById&amp;lt;Button&amp;gt;(R.id.reset)

        btnStart.setOnClickListener(){
            myChronometer.start();
            Toast.makeText(this,
                    &quot;myChronometer.start()&quot;,
                    Toast.LENGTH_LONG).show()
        }

        btnStop.setOnClickListener(){
            myChronometer.stop();
            Toast.makeText(this,
                    &quot;myChronometer.stop()&quot;,
                    Toast.LENGTH_LONG).show()
        }

        btnReset.setOnClickListener(){
            myChronometer.base = SystemClock.elapsedRealtime()
            Toast.makeText(this,
                    &quot;myChronometer.base = SystemClock.elapsedRealtime()&quot;,
                    Toast.LENGTH_LONG).show()
        }

        val myChronometerDn = findViewById&amp;lt;Chronometer&amp;gt;(R.id.chronometerDn)
        val btnStartDn = findViewById&amp;lt;Button&amp;gt;(R.id.startDn)
        val btnStopDn = findViewById&amp;lt;Button&amp;gt;(R.id.stopDn)
        val btnResetDn = findViewById&amp;lt;Button&amp;gt;(R.id.resetDn)

        btnStartDn.setOnClickListener(){
            myChronometerDn.base = SystemClock.elapsedRealtime() + 10000
            myChronometerDn.start()
            Toast.makeText(this,
                    &quot;myChronometerDn.base = &quot; +
                            &quot;SystemClock.elapsedRealtime() + 10000 \n&quot; +
                            &quot;myChronometerDn.start()&quot;,
                    Toast.LENGTH_LONG).show()
        }

        btnStopDn.setOnClickListener(){
            myChronometerDn.stop()
            Toast.makeText(this,
                    &quot;myChronometerDn.stop()&quot;,
                    Toast.LENGTH_LONG).show()
        }

        btnResetDn.setOnClickListener(){
            myChronometerDn.base = SystemClock.elapsedRealtime()
            Toast.makeText(this,
                    &quot;myChronometerDn.base = SystemClock.elapsedRealtime()&quot;,
                    Toast.LENGTH_LONG).show()
        }

    }
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/7973533318955255442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/7973533318955255442' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/7973533318955255442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/7973533318955255442'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/08/chronometer-example-kotlin.html' title='Chronometer example (Kotlin)'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/INZ0Mg-mYwY/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-2570138823957837780</id><published>2020-08-22T11:12:00.004-07:00</published><updated>2020-08-22T11:12:52.222-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ex.Android.Kotlin"/><category scheme="http://www.blogger.com/atom/ns#" term="ex.android.widget"/><title type='text'>Simple example using TextClock with Kotlin</title><content type='html'>&lt;p&gt;&lt;a href=&quot;https://developer.android.com/reference/android/widget/TextClock&quot; target=&quot;_blank&quot;&gt;TextClock&lt;/a&gt; can display the current date and/or time as a formatted string. It&#39;s a simple example of using TextClock with Kotlin.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvzYG_Yw38Kn_245JHo9kVlMVVraDaGn0X8ZA_Khdmc8Rafd5NvVHZ-K-yvWEfNmU1kR2lqM3Q9ZPy9Vefjx9PGZGq0y6Bp5JpGOZTd-4hUlX6BifrX9JXBRWs-n_UQJ3pGaQJqwuvahc/s1920/TextClock.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1920&quot; data-original-width=&quot;1080&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvzYG_Yw38Kn_245JHo9kVlMVVraDaGn0X8ZA_Khdmc8Rafd5NvVHZ-K-yvWEfNmU1kR2lqM3Q9ZPy9Vefjx9PGZGq0y6Bp5JpGOZTd-4hUlX6BifrX9JXBRWs-n_UQJ3pGaQJqwuvahc/s640/TextClock.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;layout XML with TextClock&lt;/p&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    tools:context=&quot;.MainActivity&quot;&amp;gt;

    &amp;lt;TextClock
        android:id=&quot;@+id/mytextclock&quot;
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:textStyle=&quot;italic|bold&quot;
        android:textSize=&quot;40dp&quot;
        android:format12Hour=&quot;hh:mm:ss a&quot;
        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
        app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
        app:layout_constraintRight_toRightOf=&quot;parent&quot;
        app:layout_constraintTop_toTopOf=&quot;parent&quot;
        /&amp;gt;

&amp;lt;/androidx.constraintlayout.widget.ConstraintLayout&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Access TextClock using Kotlin&lt;/p&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;package com.blogspot.android_er.androidtextclock

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.TextClock
import android.widget.Toast

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val myTextClock = findViewById&amp;lt;TextClock&amp;gt;(R.id.mytextclock)
        myTextClock.setOnClickListener{
            val s = myTextClock.text
            Toast.makeText(this, s, Toast.LENGTH_LONG).show()
        }

    }
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/2570138823957837780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/2570138823957837780' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/2570138823957837780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/2570138823957837780'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/08/simple-example-using-textclock-with.html' title='Simple example using TextClock with Kotlin'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvzYG_Yw38Kn_245JHo9kVlMVVraDaGn0X8ZA_Khdmc8Rafd5NvVHZ-K-yvWEfNmU1kR2lqM3Q9ZPy9Vefjx9PGZGq0y6Bp5JpGOZTd-4hUlX6BifrX9JXBRWs-n_UQJ3pGaQJqwuvahc/s72-c/TextClock.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-1521466111825104778</id><published>2020-08-21T13:44:00.001-07:00</published><updated>2020-08-21T13:44:03.798-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ex.Android.Kotlin"/><title type='text'>Get Android and SDK version using Kotlin</title><content type='html'>&lt;p&gt;&amp;nbsp;Exercise to get Android device info and compile SDK version using Kotlin.&lt;/p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizDs3iV2aYC96G1sXquw5HEFbgJeaGO0XyiYYiuNI-6YZpnBurqBhHN31QnVIg-80TQVQcKJlv_QcLIKMmFLketYmTU8BUPp1TRtKbqb7m3Ejg9LIeXeExSwddEeJlOKWogXDKIG3xmGc/s1366/AndroidInfo.png&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1366&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizDs3iV2aYC96G1sXquw5HEFbgJeaGO0XyiYYiuNI-6YZpnBurqBhHN31QnVIg-80TQVQcKJlv_QcLIKMmFLketYmTU8BUPp1TRtKbqb7m3Ejg9LIeXeExSwddEeJlOKWogXDKIG3xmGc/s640/AndroidInfo.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Run on Android Emulator of Android 10&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0SN9x72ix8A3n417A3mQJ0qVX9XfOaB_GWJ_GVrwO92Cr2Az6deoG4WVOQLiJM2c7aYOSxSzG1ls1ImcbSuVsQMqnDIaPJSpJpVw9dFbNAAFjIHpCTlOCqqGbBnuIDFokXpNuW3Iczt8/s2160/com.blogspot.android_er.androidinfo.jpg&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;2160&quot; data-original-width=&quot;1080&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0SN9x72ix8A3n417A3mQJ0qVX9XfOaB_GWJ_GVrwO92Cr2Az6deoG4WVOQLiJM2c7aYOSxSzG1ls1ImcbSuVsQMqnDIaPJSpJpVw9dFbNAAFjIHpCTlOCqqGbBnuIDFokXpNuW3Iczt8/s640/com.blogspot.android_er.androidinfo.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Run on Redmi 5 Plus (Android 8.1.0)&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;MainActivity.kt&lt;/p&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;package com.blogspot.android_er.androidinfo

import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.TextView
import androidx.annotation.RequiresApi

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val manufacturer = Build.MANUFACTURER
        val model = Build.MODEL
        val release = Build.VERSION.RELEASE

        val pkgInfo = packageManager.getPackageInfo(packageName, 0)
        val appInfo = pkgInfo.applicationInfo
        val targetSdkVersion = appInfo.targetSdkVersion
        val minSdkVersion = appInfo.minSdkVersion

        //Display system and SDK info for reference
        val tvInfo = findViewById&amp;lt;TextView&amp;gt;(R.id.info)
        tvInfo.setText(manufacturer + &quot;\n&quot;  +
                model + &quot;\n&quot; +
                &quot;Android: &quot; + release + &quot;\n&quot; +
                &quot;targetSdkVersion: &quot; + targetSdkVersion + &quot;\n&quot; +
                &quot;minSdkVersion: &quot; + minSdkVersion)
    }
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;layout xml&lt;/p&gt;
&lt;pre style=&quot;border: 1px solid black;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;LinearLayout
    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
    xmlns:tools=&quot;http://schemas.android.com/tools&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    android:orientation=&quot;vertical&quot;
    tools:context=&quot;.MainActivity&quot;&amp;gt;

    &amp;lt;TextView
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;Android-er&quot;
        android:textStyle=&quot;bold&quot;
        android:textSize=&quot;34dp&quot; /&amp;gt;
    &amp;lt;TextView
        android:layout_width=&quot;wrap_content&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:text=&quot;android-er.blogspot.com   &quot; /&amp;gt;
    &amp;lt;TextView
        android:id=&quot;@+id/info&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:textStyle=&quot;italic&quot;
        android:textSize=&quot;30dp&quot;/&amp;gt;

&amp;lt;/LinearLayout&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/1521466111825104778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/1521466111825104778' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/1521466111825104778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/1521466111825104778'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/08/get-android-and-sdk-version-using-kotlin.html' title='Get Android and SDK version using Kotlin'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizDs3iV2aYC96G1sXquw5HEFbgJeaGO0XyiYYiuNI-6YZpnBurqBhHN31QnVIg-80TQVQcKJlv_QcLIKMmFLketYmTU8BUPp1TRtKbqb7m3Ejg9LIeXeExSwddEeJlOKWogXDKIG3xmGc/s72-c/AndroidInfo.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-5500516112497622052</id><published>2020-07-22T17:47:00.001-07:00</published><updated>2020-07-22T17:48:13.166-07:00</updated><title type='text'>Android Codelab - Getting Started with CameraX</title><content type='html'>&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;Introduce the concept of&amp;nbsp;&lt;em&gt;use cases&lt;/em&gt;&amp;nbsp;in CameraX, which you can use for a variety of camera operations, from displaying a viewfinder to analyzing frames in real time.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://codelabs.developers.google.com/codelabs/camerax-getting-started/&quot;&gt;Android developer codelab, Getting Started with CameraX&lt;/a&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/5500516112497622052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/5500516112497622052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/5500516112497622052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/5500516112497622052'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/07/android-codelab-getting-started-with.html' title='Android Codelab - Getting Started with CameraX'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-8605212714646992684</id><published>2020-07-17T14:15:00.002-07:00</published><updated>2020-07-17T14:15:49.188-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="info"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Support for newer Java language APIs</title><content type='html'>&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/heCvGfOGH0s&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;/center&gt;
&lt;br /&gt;
When you use Android Gradle Plugin 4.0.0 and newer, you can now use several hundred APIs from newer OpenJDK versions and your app will work on any Android device? Some of these newer Java APIs in Android 11 are supported through backporting while other APIs are also available via desugaring on older devices where the Android platform does not have the APIs on the runtime.&lt;br /&gt;
&lt;br /&gt;
Resources:&lt;br /&gt;
Check out the website → &lt;a href=&quot;https://goo.gle/30FDT8S&quot; target=&quot;_blank&quot;&gt;https://goo.gle/30FDT8S&lt;/a&gt;&lt;br /&gt;
Full list of supported Java 8+ APIs → &lt;a href=&quot;https://goo.gle/3enaGD5&quot; target=&quot;_blank&quot;&gt;https://goo.gle/3enaGD5&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/8605212714646992684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/8605212714646992684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/8605212714646992684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/8605212714646992684'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/07/support-for-newer-java-language-apis.html' title='Support for newer Java language APIs'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/heCvGfOGH0s/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-7253205312275562817</id><published>2020-05-28T17:59:00.002-07:00</published><updated>2020-05-28T17:59:37.261-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio"/><title type='text'>What&#39;s new in Android Studio 4.0</title><content type='html'>&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/f1fHPqAYj5I&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;/center&gt;
&lt;br /&gt;
The Android Studio 4.0 release introduces a new Motion Editor, Build Speed window, Live Layout inspector, Multi Preview for your layouts, support for Kotlin DSL script files, and a Smart editor for R8 rules.&lt;br /&gt;
&lt;br /&gt;
The new Build Analyzer feature helps you understand and diagnose issues with your build process, such as disabled optimizations and improperly configured tasks.</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/7253205312275562817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/7253205312275562817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/7253205312275562817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/7253205312275562817'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/05/whats-new-in-android-studio-40.html' title='What&#39;s new in Android Studio 4.0'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/f1fHPqAYj5I/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-2945733289250652905</id><published>2020-05-23T08:27:00.001-07:00</published><updated>2020-05-23T08:27:35.277-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="info"/><category scheme="http://www.blogger.com/atom/ns#" term="maker"/><category scheme="http://www.blogger.com/atom/ns#" term="news"/><title type='text'>Virtually Maker Faire – May 23, 2020</title><content type='html'>&lt;h2&gt;&lt;b&gt;&lt;small&gt;Featuring Makers Responding to COVID-19&lt;/small&gt;&lt;/b&gt;&lt;/h2&gt;&lt;h3&gt;24 Hours of Presentations, Workshops, Demos, and Exhibits Across All Time Zones&lt;/h3&gt;&lt;p&gt;Across the world, makers have responded to shortages of medical supplies and equipment with agile designs, adaptive distributed manufacturing, and community organizing. Virtually Maker Faire will be a stage to share the projects and learn from the people behind this extraordinary civic response.&lt;/p&gt;&lt;p&gt;Virtually Maker Faire will take place online through video sessions and an exhibit showcase on&amp;nbsp;&lt;a href=&quot;https://makeprojects.com/&quot; target=&quot;_none&quot;&gt;Make: Projects&lt;/a&gt;.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/2945733289250652905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/2945733289250652905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/2945733289250652905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/2945733289250652905'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/05/virtually-maker-faire-may-23-2020.html' title='Virtually Maker Faire – May 23, 2020'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-2561844553086430452</id><published>2020-05-19T11:52:00.000-07:00</published><updated>2020-05-19T11:52:02.293-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="info"/><title type='text'>Google Play - Spring 2020 Policy Updates</title><content type='html'>Google Play PolicyBytes - Spring 2020 Policy Updates&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/TDF-GvnKC18&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;/center&gt;
&lt;br /&gt;
explains the spring 2020 Play policy updates on subscriptions, background location access, malware, resource downloads, and more. Stay tuned to learn more about these updates, plus best practices for app compliance on Google Play and resources to help you understand the new updates.</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/2561844553086430452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/2561844553086430452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/2561844553086430452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/2561844553086430452'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/05/google-play-spring-2020-policy-updates.html' title='Google Play - Spring 2020 Policy Updates'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/TDF-GvnKC18/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-882499523421766778</id><published>2020-04-30T08:19:00.001-07:00</published><updated>2020-04-30T08:34:38.733-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android Apps"/><category scheme="http://www.blogger.com/atom/ns#" term="Raspberry Pi"/><title type='text'>Playing Samsung Galaxy Tab S6 Lite</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAq5ldQU1KHMa-wOeaN2slAjGu04kYWMojbMxMFLMDmRDxkFswcH450RsjXOQCvO_8oZ2evsrfwp4_daQR26do2-02vcx0_QCaIEDRuSwSBAaoQMBPxJ2VlmZ8YD6ZMvUVsKcfb4dHGek/s1600/S6Lite-001.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;772&quot; data-original-width=&quot;1024&quot; height=&quot;482&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAq5ldQU1KHMa-wOeaN2slAjGu04kYWMojbMxMFLMDmRDxkFswcH450RsjXOQCvO_8oZ2evsrfwp4_daQR26do2-02vcx0_QCaIEDRuSwSBAaoQMBPxJ2VlmZ8YD6ZMvUVsKcfb4dHGek/s640/S6Lite-001.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI7qD2H9JKNyR9EIFsKn8NkLaxJ1auW0sUh2IHMSopi0RcYPkk8MhP0-zVeB_TGrK44FlyNjqYbYix29g7swcj2XvXzgOtaufXPBgE0XiRQpODCgUvWH2VKQ9iUaQpe2aCZcqn4yHmTg0/s1600/S6Lite-002.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;772&quot; data-original-width=&quot;1024&quot; height=&quot;482&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI7qD2H9JKNyR9EIFsKn8NkLaxJ1auW0sUh2IHMSopi0RcYPkk8MhP0-zVeB_TGrK44FlyNjqYbYix29g7swcj2XvXzgOtaufXPBgE0XiRQpODCgUvWH2VKQ9iUaQpe2aCZcqn4yHmTg0/s640/S6Lite-002.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Samsung Galaxy Tab S6 Lite&lt;/b&gt; is the newest tab from Samsung, is available to buy today, April 30, 2020. Running Android 10, Octa-Core (2.3GHz, 1.7GHz), 4G Ram, 10.4&quot;, 2000x1200 TFT display. Come with S Pen. You can check the full-spec here (&lt;a href=&quot;https://www.samsung.com/uk/tablets/galaxy-tab-s6-lite/SM-P610NZBABTU/&quot; target=&quot;_blank&quot;&gt;https://www.samsung.com/uk/tablets/galaxy-tab-s6-lite/SM-P610NZBABTU/&lt;/a&gt;). You have to choice your region/language on the most lower-left, different region with have slightly different configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiULYz91-ew5hDXygWYCX3wOQQK53Q5tjlFExdpsvqn2w7RZPAKFE_DmPDvmk6NoZFyO9KlJcKiXj1Mckdfkhq7g1y-PyS6HWe7366Ppy6kYhA9foilDNa0AAWAmNDRFIE-NAjol-FQww4/s1600/S6Lite+info-001.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;621&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiULYz91-ew5hDXygWYCX3wOQQK53Q5tjlFExdpsvqn2w7RZPAKFE_DmPDvmk6NoZFyO9KlJcKiXj1Mckdfkhq7g1y-PyS6HWe7366Ppy6kYhA9foilDNa0AAWAmNDRFIE-NAjol-FQww4/s640/S6Lite+info-001.jpg&quot; width=&quot;388&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcEvY5-AmDbf82D_4O7V0f7a8sxnv4QxlBeFeJeVJJ4xmwqxhKQgopmUfKJiGzYe1c3QcwAOtckLA8zFHO2_-7lcD7QC4YGng0Ej8aDpW4wco1DBu932rINEnwU0zUHPrgKT2HDVon71E/s1600/S6Lite+info-002.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1024&quot; data-original-width=&quot;621&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcEvY5-AmDbf82D_4O7V0f7a8sxnv4QxlBeFeJeVJJ4xmwqxhKQgopmUfKJiGzYe1c3QcwAOtckLA8zFHO2_-7lcD7QC4YGng0Ej8aDpW4wco1DBu932rINEnwU0zUHPrgKT2HDVon71E/s640/S6Lite+info-002.jpg&quot; width=&quot;388&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Just buy one and play:)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Remote control Raspberry Pi with VNC Viewer&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://play.google.com/store/apps/details?id=com.realvnc.viewer.android&quot; target=&quot;_blank&quot;&gt;VNC Viewer&lt;/a&gt; turns the Tab S6 Lite (or other phones) into a remote desktop, remote control Mac, Windows and Linux computers (Raspberry Pi in my case) from anywhere in the world. You can view your computer&#39;s desktop remotely, and control its mouse and keyboard as though you were sitting down in front of it.&lt;br /&gt;
&lt;br /&gt;
This view show how Galaxy Tab S6 Lite running VNC Viewer to control Raspberry Pi Zero W. It&#39;s supposed you have already enable VNC in Raspberry Pi Configuration -&amp;gt; Interface, and install in tablet, and setup completely.&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/qq5wDKraHWA&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;/center&gt;
&lt;br /&gt;
&lt;b&gt;Play dual Pokemon GO&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyjhreujiyT5HV_6A9aDqC0wjKTQFV_rlZ5Hc30ryequCIxRrZMvF84mxpg-CwXfpe3w6CJ7UxQlqQQz248Dm4Oseidyvqb_oE-7Qip38k60IlEDNX1phdsq0yhRxGXXL5WQbd7yCjDT0/s1600/Dual+PkGO.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyjhreujiyT5HV_6A9aDqC0wjKTQFV_rlZ5Hc30ryequCIxRrZMvF84mxpg-CwXfpe3w6CJ7UxQlqQQz248Dm4Oseidyvqb_oE-7Qip38k60IlEDNX1phdsq0yhRxGXXL5WQbd7yCjDT0/s640/Dual+PkGO.gif&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Yes, you can install two copy of Pokemon Go from both Google Play Store and Samsung Galaxy Store, currently version 0.173.2-G and 0.173.2-S. Then you can run both Pokemon Go with different account at same time.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMdp2Mp1yzHZiKmaqhRP6KrYATDR1LXFxz32FrWNcNoopb5BDk9zjPvGVyUle3f45bCPFICvuOaN6Q_rzlTfOdc0nJG7myYvEXGOJMZvdwyHCkK7SliVfiTISXDOsihjO9VTj3gNf4QnY/s1600/S6Lite+dual+PkGO-001.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;621&quot; data-original-width=&quot;1024&quot; height=&quot;388&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMdp2Mp1yzHZiKmaqhRP6KrYATDR1LXFxz32FrWNcNoopb5BDk9zjPvGVyUle3f45bCPFICvuOaN6Q_rzlTfOdc0nJG7myYvEXGOJMZvdwyHCkK7SliVfiTISXDOsihjO9VTj3gNf4QnY/s640/S6Lite+dual+PkGO-001.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVpdo3lpQNmKh6I9rBqJTF8Dvk2a87-se9THj_SYLOInnfMG8Yq4AWov2V6VHlw0rtcHqJsY0KDX5MguANI9SKUgsteVsKceMFQii8eExw9XG7a5ZU6lq2PjQC8aH6qAvVOSQ-qa3DXM4/s1600/S6Lite+dual+PkGO-002.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;621&quot; data-original-width=&quot;1024&quot; height=&quot;388&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVpdo3lpQNmKh6I9rBqJTF8Dvk2a87-se9THj_SYLOInnfMG8Yq4AWov2V6VHlw0rtcHqJsY0KDX5MguANI9SKUgsteVsKceMFQii8eExw9XG7a5ZU6lq2PjQC8aH6qAvVOSQ-qa3DXM4/s640/S6Lite+dual+PkGO-002.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9CGveV5Fxs3zjMPHmxPqjXGbS6-8CwEmfE6iADsHVuL28b_-iXCtfdLqGojV2qlQzDjZX98R-LH8yGW2SkDaCoikfMvfGemG_ogru4p6YfWGVmspW3BjiOHoo9IYN3LbzGBvuF14gB1w/s1600/S6Lite+dual+PkGO-003.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;621&quot; data-original-width=&quot;1024&quot; height=&quot;388&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9CGveV5Fxs3zjMPHmxPqjXGbS6-8CwEmfE6iADsHVuL28b_-iXCtfdLqGojV2qlQzDjZX98R-LH8yGW2SkDaCoikfMvfGemG_ogru4p6YfWGVmspW3BjiOHoo9IYN3LbzGBvuF14gB1w/s640/S6Lite+dual+PkGO-003.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/882499523421766778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/882499523421766778' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/882499523421766778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/882499523421766778'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/04/playing-samsung-galaxy-tab-s6-lite.html' title='Playing Samsung Galaxy Tab S6 Lite'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAq5ldQU1KHMa-wOeaN2slAjGu04kYWMojbMxMFLMDmRDxkFswcH450RsjXOQCvO_8oZ2evsrfwp4_daQR26do2-02vcx0_QCaIEDRuSwSBAaoQMBPxJ2VlmZ8YD6ZMvUVsKcfb4dHGek/s72-c/S6Lite-001.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-8580674706875160573</id><published>2020-04-13T12:44:00.003-07:00</published><updated>2020-04-13T12:44:49.772-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android Studio.how to"/><title type='text'>How to display layout xml in code view, for Android Studio 3.6.2</title><content type='html'>With Android Studio updated (currently 3.6.2), when you view layout xml file, the original&amp;nbsp;design/code option (on lower-left corner) removed. So how to view its xml code?&lt;br /&gt;
Answer: The option is now moved to upper-right corner, you can view it in Code/Splite/Design view.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5nTD37jffq4RvxWISHAS3tk-2ws2FVAZAzRXrzV3dZhV4ia7q223wNua53r7wZ0sT676bp0BufkWC2I7tp_jproM-DtldZvhi3gtM03SXH0MleEgu_IlowoqdMU8ky0y1yn8DpYDxsmA/s1600/layout+code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1366&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5nTD37jffq4RvxWISHAS3tk-2ws2FVAZAzRXrzV3dZhV4ia7q223wNua53r7wZ0sT676bp0BufkWC2I7tp_jproM-DtldZvhi3gtM03SXH0MleEgu_IlowoqdMU8ky0y1yn8DpYDxsmA/s640/layout+code.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEqzVNyqYBveLkjgHWjlm-kt4bFQkgJu5vlJHi-jRq7t9NheBIpm52Vda4a-7soOLu_og_3tGVFTiCNvqxAR96FVTK_RFkoE_aAOH9GHZ8vclVHYhi1hgwnGenIBdJ6k9WUYURmF2Avg8/s1600/layout+splite.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1366&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEqzVNyqYBveLkjgHWjlm-kt4bFQkgJu5vlJHi-jRq7t9NheBIpm52Vda4a-7soOLu_og_3tGVFTiCNvqxAR96FVTK_RFkoE_aAOH9GHZ8vclVHYhi1hgwnGenIBdJ6k9WUYURmF2Avg8/s640/layout+splite.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm36ZJ9Fc7pma9PC9xxbehxBpIyBthpCLzM2JFfFrzI1mRqfUBdVLnP-5S8QFBkaKnQe5G54ftqLTlfPclwUdgTP4TD4BTfusVDGL-esxuN1IspdRLheBLxtPs06gLVzOqtzRSKbeR0JU/s1600/layout+design.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;768&quot; data-original-width=&quot;1366&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm36ZJ9Fc7pma9PC9xxbehxBpIyBthpCLzM2JFfFrzI1mRqfUBdVLnP-5S8QFBkaKnQe5G54ftqLTlfPclwUdgTP4TD4BTfusVDGL-esxuN1IspdRLheBLxtPs06gLVzOqtzRSKbeR0JU/s640/layout+design.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/8580674706875160573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/8580674706875160573' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/8580674706875160573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/8580674706875160573'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/04/how-to-display-layout-xml-in-code-view.html' title='How to display layout xml in code view, for Android Studio 3.6.2'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5nTD37jffq4RvxWISHAS3tk-2ws2FVAZAzRXrzV3dZhV4ia7q223wNua53r7wZ0sT676bp0BufkWC2I7tp_jproM-DtldZvhi3gtM03SXH0MleEgu_IlowoqdMU8ky0y1yn8DpYDxsmA/s72-c/layout+code.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-5794632470423803234</id><published>2020-03-24T13:25:00.001-07:00</published><updated>2020-03-24T13:25:23.524-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Game development"/><title type='text'>What&#39;s new in Android game development tools</title><content type='html'>Learn about our new development and profiling tools built specifically for Android game developers. Improve productivity with new features that allow you to build and deploy your game more efficiently, and use updated profilers to fine tune your game&#39;s performance.&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/JXQBdMNDL7k&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;/center&gt;
&lt;br /&gt;
&lt;b&gt;Google for Games Developer Summit Keynote&lt;/b&gt;&lt;br /&gt;
Game Developers Conference is one of our most anticipated times of the year to connect with the gaming industry and share our latest product updates.&lt;br /&gt;
&lt;center&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/2haNNRU1Gxs&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;
&lt;/center&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/5794632470423803234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/5794632470423803234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/5794632470423803234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/5794632470423803234'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/03/whats-new-in-android-game-development.html' title='What&#39;s new in Android game development tools'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/JXQBdMNDL7k/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-1872945506878509245</id><published>2020-01-19T13:43:00.004-08:00</published><updated>2020-01-19T13:43:58.302-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="x86"/><title type='text'>Android-x86 - Run Android on your PC</title><content type='html'>&lt;b&gt;Android-x86&lt;/b&gt; is a project to port Android open source project to x86 platform.&amp;nbsp;This is an open source project licensed under Apache Public License 2.0. Some components are licensed under GNU General Public License (GPL) 2.0 or later.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSxw-_Ws3guNwcj7nw7Q3VefagSdRrNpZa4m_mj_505ttUwrUfiVy5DX1RWel-Oi20KsetlKqW12RN7zk4AjPADo-K_Y_AFMBUUWDifgzB0sS1YNyZMggmq_GamWn7qY47jsKdYLKSzE8/s1600/Android-x86+-+Porting+Android+to+x86.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;672&quot; data-original-width=&quot;1267&quot; height=&quot;338&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSxw-_Ws3guNwcj7nw7Q3VefagSdRrNpZa4m_mj_505ttUwrUfiVy5DX1RWel-Oi20KsetlKqW12RN7zk4AjPADo-K_Y_AFMBUUWDifgzB0sS1YNyZMggmq_GamWn7qY47jsKdYLKSzE8/s640/Android-x86+-+Porting+Android+to+x86.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
To know more and try it, visit:&amp;nbsp;&lt;a href=&quot;https://www.android-x86.org/&quot; target=&quot;_blank&quot;&gt;https://www.android-x86.org/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/1872945506878509245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/1872945506878509245' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/1872945506878509245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/1872945506878509245'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2020/01/android-x86-run-android-on-your-pc.html' title='Android-x86 - Run Android on your PC'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSxw-_Ws3guNwcj7nw7Q3VefagSdRrNpZa4m_mj_505ttUwrUfiVy5DX1RWel-Oi20KsetlKqW12RN7zk4AjPADo-K_Y_AFMBUUWDifgzB0sS1YNyZMggmq_GamWn7qY47jsKdYLKSzE8/s72-c/Android-x86+-+Porting+Android+to+x86.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-89878749563391212.post-628184020916429045</id><published>2019-12-19T12:26:00.000-08:00</published><updated>2019-12-19T12:26:28.867-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android Apps"/><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft"/><title type='text'>Link your phone and Windows PC, using Microsoft Your Phone Companion app</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQbgJ1ZwlOQQIAOGSTnwgC0FY2uWI2hJU6Nz_GqkcBMq-SplbeojREpkghHwqD_njK-JHkbyUnz2W_pF_j-9WAD8CPdtMDYi5tJkZ4iPp9VrZ4dDe7Cdpl4uueLQRnY4B-TP8V3E3yNUM/s1600/Microsoft+Your+Phone.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;394&quot; data-original-width=&quot;700&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQbgJ1ZwlOQQIAOGSTnwgC0FY2uWI2hJU6Nz_GqkcBMq-SplbeojREpkghHwqD_njK-JHkbyUnz2W_pF_j-9WAD8CPdtMDYi5tJkZ4iPp9VrZ4dDe7Cdpl4uueLQRnY4B-TP8V3E3yNUM/s320/Microsoft+Your+Phone.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
With &lt;b&gt;Your Phone Companion&lt;/b&gt; you can easily sync your Android phone with your Windows 10 PC. Get instant access to everything you love on your phone, right on your PC. Reply to your text messages with ease, stop emailing yourself photos, and receive your phone&#39;s notifications on your PC&#39;s bigger screen.&lt;br /&gt;
&lt;br /&gt;
Your Phone Companion features:&lt;br /&gt;
&lt;br /&gt;
Connect your phone and PC&lt;br /&gt;
• Receive and manage your Android phone&#39;s notifications on your PC&lt;br /&gt;
• Read and reply to your text messages from your PC&lt;br /&gt;
• Photos taken on your phone are instantly available on your PC&lt;br /&gt;
&lt;br /&gt;
To use it, install&amp;nbsp;&lt;a href=&quot;https://play.google.com/store/apps/details?id=com.microsoft.appmanager&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;Your Phone Companion&lt;/span&gt;&lt;/b&gt;&lt;/a&gt; app on your Android phone and&amp;nbsp;&lt;a href=&quot;https://www.microsoft.com/en-gb/p/your-phone/9nmpj99vjbwv&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;trebuchet ms&amp;quot; , sans-serif;&quot;&gt;Your Phone&lt;/span&gt;&lt;/b&gt;&lt;/a&gt; program on your Windows PC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-er.blogspot.com/feeds/628184020916429045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/89878749563391212/628184020916429045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/628184020916429045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/89878749563391212/posts/default/628184020916429045'/><link rel='alternate' type='text/html' href='http://android-er.blogspot.com/2019/12/link-your-phone-and-windows-pc-using.html' title='Link your phone and Windows PC, using Microsoft Your Phone Companion app'/><author><name>Erik</name><uri>http://www.blogger.com/profile/04983894331825656853</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQbgJ1ZwlOQQIAOGSTnwgC0FY2uWI2hJU6Nz_GqkcBMq-SplbeojREpkghHwqD_njK-JHkbyUnz2W_pF_j-9WAD8CPdtMDYi5tJkZ4iPp9VrZ4dDe7Cdpl4uueLQRnY4B-TP8V3E3yNUM/s72-c/Microsoft+Your+Phone.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>