Book Image

Android Programming with Kotlin for Beginners

By : John Horton
5 (1)
Book Image

Android Programming with Kotlin for Beginners

5 (1)
By: John Horton

Overview of this book

Android is the most popular mobile operating system in the world and Kotlin has been declared by Google as a first-class programming language to build Android apps. With the imminent arrival of the most anticipated Android update, Android 10 (Q), this book gets you started building apps compatible with the latest version of Android. It adopts a project-style approach, where we focus on teaching the fundamentals of Android app development and the essentials of Kotlin by building three real-world apps and more than a dozen mini-apps. The book begins by giving you a strong grasp of how Kotlin and Android work together before gradually moving onto exploring the various Android APIs for building stunning apps for Android with ease. You will learn to make your apps more presentable using different layouts. You will dive deep into Kotlin programming concepts such as variables, functions, data structures, Object-Oriented code, and how to connect your Kotlin code to the UI. You will learn to add multilingual text so that your app is accessible to millions of more potential users. You will learn how animation, graphics, and sound effects work and are implemented in your Android app. By the end of the book, you will have sound knowledge about significant Kotlin programming concepts and start building your own fully featured Android apps.
Table of Contents (33 chapters)
Android Programming with Kotlin for Beginners
Contributors
Preface
Index

The Basic Activity project


The next simplest project type with an autogenerated UI is the Basic Activity project. This is the same type of project that we created in Chapter 1, Getting Started with Android and Kotlin. Feel free to open that project up now, but it is recommended to generate a new one so that we can examine it without any of our alterations and additions clouding the discussions.

Let's create a Basic Activity project, as follows:

  1. In Android Studio, select File | New | New Project….

  2. On the Choose your project screen, select the Basic Activity template and click on Next.

  3. Change the Name field to Basic Activity App.

  4. Choose the same package name and save the location as in the previous project.

  5. Be sure to select Kotlin as the language.

  6. Check the Use AndroidX artifacts checkbox as we did previously.

  7. The rest of the settings can be left at their defaults, so just click on Next.

Now we can dig into the files. We won't look at everything in the same detail that we did for the Empty Activity...