What’s New in the Fourth Edition?

This edition involved a major overhaul – every chapter was altered. The biggest change in this version is that the apps are written using Kotlin instead of Java. Because of this, our unofficial working name for this edition has been “Android 4K.”

Another sweeping change is the inclusion of Android Jetpack component libraries. We now use Jetpack (sometimes called AndroidX) libraries in place of the Support Library. Additionally, we incorporated new Jetpack APIs when applicable. For example, we use ViewModel to persist UI state across rotation. We use Room and LiveData to implement a database and to query data from it. And we use WorkManager to schedule background work. These are just a few examples; you will find Jetpack components woven into all the projects in this book.

To focus on how modern Android applications are developed, this book now uses third-party libraries instead of just the APIs within the framework or within Jetpack. One example is dropping HttpURLConnection and other lower-level networking APIs in favor of using Retrofit and the suite of libraries it depends on. This is a big departure from our previous books, and we believe that this will better prepare you to dive into professional application development after reading our book. The libraries we chose to use are libraries we use in our daily lives as Android developers for our clients.

Kotlin vs Java

Official support for Kotlin for Android development was announced at Google I/O in 2017. Before that, there was an underground movement of Android developers using Kotlin even though it was not officially supported. Since 2017, Kotlin has become widely adopted, and it is most developer’s preferred language for Android development. At Big Nerd Ranch, we use Kotlin for all our app development projects – even legacy projects that are mostly Java.

The tide has continued to turn toward Kotlin in a very big way. The Android framework team has started adding @nullable annotations to legacy platform code. They have also released more and more Kotlin extensions for Android. And, as of this writing, Google is in the process of adding Kotlin examples and support to the official Android documentation.

The Android framework was originally written in Java. This means most of the Android classes you interact with are Java. Luckily, Kotlin is interoperable with Java, so you should not run into any issues.

We have chosen to display API listings in Kotlin, even if they are implemented behind the scenes in Java. You can see the Java API listings by browsing for the class you are interested in at developer.android.com/​reference.

Whether you prefer Kotlin or Java, this book teaches you how to write Android apps. The knowledge and experience you gain in developing apps for the Android platform will translate to either language.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.55.55.239