A note for early adopters of this book

At time of completing this book, Android 9 and Android Studio 3.2 had just been released. This book was written to accommodate these latest versions. One of the changes in the new releases is the way that Android supports devices running older versions of Android. It has just been significantly improved. Android uses a support library, which means that old devices (within reason) can make use of newer features.

The good news is that this book uses the new, improved version!

However, if you are a very early adopter (late 2018 and maybe into early 2019) of this book and you look very closely at the code generated by Android Studio, you will notice some slight differences with the code presented in the book. The differences occur in the import… statements at the top of the Java code files. The book presents code that looks a bit like this:

import androidx.appcompat.app.AppCompatActivity;

Whereas you might notice code in Android Studio 3.2 or earlier that looks a little more like this:

Import android.support.v7.app.AppCompatActivity;

Perhaps surprisingly, Android Studio version 3.2 auto-generates code that uses the old-style support library despite already fully supporting the new style (used in this book).

For the purposes of learning to make Android apps and code in Java, you can safely ignore these slight differences. All the code that this book uses remains the same, regardless of whether you are using the old style or the new style.

If Android Studio is auto-generating the old style and you want to bring your code up to date and have the exact same code as shown in this book, you can simply select Refactor | Migrate to AndroidX… immediately after you have started each new project and Android Studio has auto-generated the code from your chosen project template. This is optional and not required.

Note that for this refactoring option to be available you need Android Studio 3.2. So, if you had previously been learning Android programming with an older version of Android Studio then you will need to update it (when prompted at application startup). Again, this is optional; you could just ignore the slight differences.

If you keep Android Studio up to date when prompted to do so occasionally when you start the application, then soon you will notice that the new-style code is auto-generated for you.

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

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