Android & Kotlin

Android Apprentice

Build four complete Android apps from scratch using Kotlin! Android Apprentice is our book for complete beginners to Android development. By Fuad Kamal, Kevin D Moore, Darryl Bayliss & Namrata Bandekar.

Read for Free with the Beginner subscription* * Includes this and all other Beginner books in our online library See all benefits
Buy Individually $59.99 $35.99* *Includes access to all of our online reading features.
Login to leave a rating/review
Download materials
Buy paperback—Amazon Comments
Save for later
Share

Who is this for?

If you’re completely new to Android or developing in Kotlin, this is the book for you.

Covered concepts

  • Layouts
  • Debugging
  • Communication
  • Scrolling Layouts
  • Google Places
  • Networking
  • Material Design
For Complete Beginners to Android!

If you’re completely new to Android or developing in Kotlin, this is the book for you.

Android Apprentice takes you all the way from building your first app, to submitting your app for sale. By the end of this book, you’ll be experienced enough to...

more

Before You Begin

This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.

Section I: Your First Android App

This is your introduction to creating apps in Android. This section will take you step-by-step through installing Android Studio and working inside the IDE and visual designer while you build Timefighter, a simple game that uses many common Android components.

1
Hide description
To begin creating that killer Android App, you’ll need some guidance on how to install the tools you’ll need as a young apprentice. Android development takes place inside Android Studio, a customized IDE based on IntelliJ that gives you a powerful set of tools to work with.
2
Hide description
If bricks and mortar are the foundation of a sturdy building, then Layouts are the Android equivalent of a sturdy app. Layouts are incredibly flexible and let you define how your user interface is presented on the device to the user.
3
Hide description
Android apps are built around a set of screens that have a specific purpose. Each screen you see in an app is known as an Activity. An Activity is built around a single task that you want your user to perform.
4
Hide description
In the previous two chapters, you focused on developing TimeFighter into a fully-fledged app. In this chapter, you’ll focus on how to debug your app when it begins to exhibit bugs.
5
Hide description
In this final chapter, you’ll learn how to adjust colors and themes in your app, how to add some small touches to give your app that "polished" feeling, and how to add a simple animation to your app to give it some life.

Section II: Building a List App

Welcome to Section II of the book! You’re going to leave behind the last app you made and create a completely new app. This new app is called Listmaker, and will allow you and your users to create handy lists that you can look at later.

In the previous section, you had a starter project to begin building your app. But in this section, you’re going to create your own project from scratch! You’ll go through the steps and choices given to you to ensure your project is set up right from the very start.

You’ll also learn how to persist data to your app using SharedPreferences and create different screens dedicated to different tasks. Towards the end of the section, you’ll learn how to change your App to adapt to different screen sizes using Fragments. Finally, you’ll give Listmaker a design overhaul by enhancing it to follow Material Design. The recommended design language for Android apps.

Hide description
In the previous section, you had a starter project to begin building your app. In this section, you’re going to create your own project from scratch! You’ll go through the steps and choices given to you to ensure your project is set up right from the very start.
Hide description
In Android development, the simplest way to implement lists in your app is to use a class named RecyclerView. You’ll learn how to get started with RecyclerView, how to set up a RecyclerView Adapter to populate your list with data, and how to set up a ViewHolder to handle the layout of each item in your list.
In this chapter, you’ll add functionality to ListMaker to create, save, and delete lists. You’ll learn what SharedPreferences are and how you can use them to save and retrieve user data. You'll also begin to use ViewModels and understand their usage in Android development
As your app gets more complex, trying to cram more visual elements into a single screen becomes difficult, and can make your app confusing for users. In this chapter, you’ll learn how to create separate Activities, how to communicate between Activities using an Intent, and how to pass data between Activities.
Hide description
In this chapter, you’re going to build up the Activity you created in the previous chapter with familiar components such as a RecyclerView to display the list, and add a FloatingActionButton to add tasks to the list. You’ll also learn how to communicate back to the previous Activity using an Intent.
Hide description
When it comes to coding an appealing user interface that adapts across all Android devices with varying screen sizes, things can get tricky! Although you won’t be building an app for a fridge just yet (give it time), in this chapter, you’ll learn what Fragments are, how they work with Activities, and how to split up Activities into Fragments.
Hide description
Material Design is a design language aiming to standardize how a user interacts with apps. It covers everything from button clicks to widget presentation and positioning. Even animation within the app. In this final chapter for section II, you’ll update Listmaker to adopt some Material Design principles.

Section III: Creating Map-Based Apps

In this section, you’ll build PlaceBook, a location based app that lets you bookmark your favorite places and save some notes about each place. This section introduces several new concepts including Google Maps, Room database, drawer navigation, and camera control.

Hide description
Have you ever been on a road trip and wanted to make notes about the places you’ve visited? Or needed to warn your future self about some heartburn-inducing greasy food from a roadside diner? If so, then you’re in luck! You’re about to build PlaceBook, an app that meets all of those needs by letting you bookmark and make notes using a map-based interface.
Hide description
In this chapter, you’ll tighten up the map experience by automatically centering the map on the user’s location at startup, and allowing the user to recenter the map to their current location at any time.
Hide description
Before you can achieve your ultimate goal of allowing users to bookmark places, you need to let them identify existing places on the map. In this chapter, you'll learn how to identify when a user taps on a place and use the Google Places API to retrieve detailed information about the place.
Hide description
Now that the user can tap on places to get an info window pop-up, it’s time to give them a way to bookmark and edit a place. You’ll learn about the Room Persistence Library and how it fits into the overall Android Component Architecture.
Hide description
In this chapter, you'll add the ability to edit bookmarks. This will involve creating a new activity to display the bookmark details with editable fields.
Hide description
Currently, the only way to find an existing bookmark is to locate its pin on the map. In this chapter, you’ll add the ability to navigate directly to bookmarks, and you’ll replace the photo for a bookmark.
Hide description
In this chapter, you’ll add some finishing touches that improve both the look and usability of the PlaceBook app. Even though PlaceBook is perfectly functional as-is, it’s often the little touches that make an app go from good to great.

Section IV: Building a Podcast Manager & Player

This section gets a bit more advanced. You’re going to build a podcast manager and player app named PodPlay. You’ll cover networking, notifications, working with REST and XML, and the Android media libraries.

Hide description
In this section, you’re going to use many of the skills you’ve already learned and dive into some more advanced areas of Android development. You’ll build a full-featured Podcast manager and player app named PodPlay. This app will allow searching and subscribing to podcasts from iTunes and provide a playback interface with speed controls.
Hide description
Creating a search interface can be as simple as adding a text view, responding to the user entering text, and populating a RecyclerView with the results. While this method works fine, the Android SDK provides a built-in search feature that helps future-proof your apps.
Hide description
Now that the user can find their favorite podcasts, you’re ready to add a podcast detail screen. In this chapter, you’ll design and build the podcast detail fragment, expand on the app architecture, and add a podcast detail fragment.
Hide description
Until this point, you’ve only dealt with the top-level podcast details. Now it’s time to dive deeper into the podcast episode details, and that involves loading and parsing the RSS feeds.
By giving users the ability to search for podcasts and displaying the podcast episodes, you made great progress in the development of the podcast app. In this section, you’ll add the ability to subscribe to favorite podcasts.
Now that the user can subscribe to podcasts, it’s helpful to notify them when new episodes are available. In this chapter, you’ll update the app to periodically check for new episodes in the background and post a notification if any are found.
Hide description
So far, you’ve built a decent podcast management app — too bad there’s no way to listen to content. In this chapter, you’ll learn how to build a media player that plays audio and video podcasts, and integrates into the Android ecosystem.
Hide description
In the last chapter, you succeeded in adding audio playback to the app, but you stopped short of adding any built-in playback features. In this final chapter of this section, you’ll finish up the PodPlay app by adding a full playback interface and support for videos.

Section V: Android Compatibility

This section covers two Android topics that are almost as important as your Android app itself: how to handle the collection of Android versions out there, known as the fragmentation problem, and how to best keep your app up to date in the face of constant updates to Android.

In a perfect world, every Android device would run a single version of Android and app development would be easy. Sadly, the world isn’t perfect. As of May 2019, there were two and a half billion active Android devices around the world, all running various versions and flavors of Android. This chapter explores the history of Android versions, and how developers can target as many versions of Android as possible.
Hide description
The more you commit to your app, the more value your users will see in the product. Keeping your app up-to-date is an incentive to growing that important group of users. Publishing an app is an achievement, but supporting an app over the years to come is a labor of love.

Section VI: Publishing Your App

Now that you’ve created your app, you need to get it out to the world! This section has two chapters that teach you how to prepare your app for release, how to test your app, and how to publish your app to your waiting fans!

Hide description
So you finally built that app you’ve been dreaming about. Now it’s time to share it with the world! But where do you start? Although this chapter will focus primarily on preparing the app for the Google Play store, most of the steps will apply regardless of the publishing platform.
Hide description
In this chapter, you’ll complete the app publishing process and discover additional ways to distribute your app. You’ll also go through the Alpha and Beta testing process to make sure your app is ready to share with the world.