July 2018
Intermediate to advanced
400 pages
12h 14m
English
There are many open-source libraries designed to enhance the developer experience when working with Kotlin and Android. We will highlight two here to give an idea of what is possible.
The Android KTX project (github.com/android/android-ktx) provides a number of useful Kotlin extensions for Android app development, often also granting a more Kotlinesque interface to the Android Java APIs than would otherwise be possible. For example, consider the following code, which uses Android’s shared preferences to persist a small amount of data for later use:
sharedPrefs.edit()
.putBoolean(true, USER_SIGNED_IN)
.putString("Josh", USER_CALLSIGN)
.apply()
With Android KTX, you can shorten ...
Read now
Unlock full access