How to Build Android Apps with Kotlin
A hands-on guide to developing, testing, and publishing your first apps with Android
Alex Forrester, Eran Boudjnah, Alexandru Dumbravan, Jomar Tigcal
- 794 Seiten
- English
- ePUB (handyfreundlich)
- Über iOS und Android verfügbar
How to Build Android Apps with Kotlin
A hands-on guide to developing, testing, and publishing your first apps with Android
Alex Forrester, Eran Boudjnah, Alexandru Dumbravan, Jomar Tigcal
Über dieses Buch
Master the fundamentals of Android programming and apply your skills to create scalable and reliable apps using industry best practices
Key Features
- Build apps with Kotlin, Google's preferred programming language for Android development
- Unlock solutions to development challenges with guidance from experienced Android professionals
- Improve your apps by adding valuable features that make use of advanced functionality
Book Description
Are you keen to get started building Android 11 apps, but don't know where to start? How to Build Android Apps with Kotlin is a comprehensive guide that will help kick-start your Android development practice.
This book starts with the fundamentals of app development, enabling you to utilize Android Studio and Kotlin to get started building Android projects. You'll learn how to create apps and run them on virtual devices through guided exercises. Progressing through the chapters, you'll delve into Android's RecyclerView to make the most of lists, images, and maps, and see how to fetch data from a web service.
Moving ahead, you'll get to grips with testing, learn how to keep your architecture clean, understand how to persist data, and gain basic knowledge of the dependency injection pattern. Finally, you'll see how to publish your apps on the Google Play store.
You'll work on realistic projects that are split up into bitesize exercises and activities, allowing you to challenge yourself in an enjoyable and attainable way. You'll build apps to create quizzes, read news articles, check weather reports, store recipes, retrieve movie information, and remind you where you parked your car.
By the end of this book, you'll have the skills and confidence to build your own creative Android applications using Kotlin.
What you will learn
- Create maintainable and scalable apps using Kotlin
- Understand the Android development lifecycle
- Simplify app development with Google architecture components
- Use standard libraries for dependency injection and data parsing
- Apply the repository pattern to retrieve data from outside sources
- Publish your app on the Google Play store
Who this book is for
If you want to build your own Android applications using Kotlin but are unsure of how to begin, then this book is for you. To easily grasp the concepts in this book, it is recommended that you already have a basic understanding of Kotlin, or experience in a similar programming language and a willingness to brush up on Kotlin before you start.
Häufig gestellte Fragen
Information
1. Creating Your First App
Introduction
Creating an Android Project with Android Studio
Exercise 1.01: Creating an Android Studio Project for Your App
- Upon opening Android Studio, you will see a window asking whether you want to create a new project or open an existing one. Select Create New Project.The start up window will appear as follows:
- Now, you'll enter a simple wizard-driven flow, which greatly simplifies the creation of your first Android project. The next screen you will see has a large number of options for the initial setup you'd like your app to have:
- Welcome to your first introduction to the Android development ecosystem. The word displayed in most of the project types is Activity. In Android, an Activity is a page or screen. The options you can choose from on the preceding screen all create this initial screen differently. The descriptions describe how the first screen of the app will look. These are templates to build your app with. Select Empty Activity from the template and click on next. The project configuration screen is as follows:
- The preceding screen configures your app. Let's go through all the options:a. Name: Similar to the name of your Android project, this name will appear as the default name of your app when it's installed on a phone and visible on Google Play. You can replace the Name field with your own or set it now to the app you are going to create.b. Package name: This uses the standard reverse domain name pattern for creating a name. It will be used as an address identifier for source code and assets in your app. It is best to make this name as clear and descriptive and as closely aligned with the purpose of your app as possible. Therefore, it's probably best to change this to use one or more sub-domains (such as com.sample.shop.myshop). As shown in Figure 1.3, the Name of the app (in lowercase with spaces removed) is appended to the domain.c. Save location: This is the local folder on your machine where the app will be initially stored. This can be changed in the future, so you can probably keep the default or edit it to something different (such as Users/MyUser/android/projects). The default location will vary with the operating system you are using.d. Language – Kotlin: This is Google's preferred language for Android app development.e. Minimum SDK: Depending on which version of Android Studio you download, the default might be the same as displayed in Figure 1.3 or a...