Skip to main content
Top

2018 | Book

Pro Android with Kotlin

Developing Modern Mobile Apps

insite
SEARCH

About this book

Develop Android apps with Kotlin to create more elegant programs than the Java equivalent. This book covers the various aspects of a modern Android app that professionals are expected to encounter. There are chapters dealing with all the important aspects of the Android platform, including GUI design, file- and data-handling, coping with phone calls, multimedia apps, interaction with location and mapping services, monetizing apps, and much more.

Pro Android with Kotlin is an invaluable source for developers wanting to build real-world state-of-the-art apps for modern Android devices.

What You Will Learn

Integrate activities, such as intents, services, toasts and more, into your Android apps

Build UIs in Android using layouts, widgets, lists, menus, and action bars

Deal with data in your Android apps using data persistence and cloud access

Design for different Android devices

Create multimedia apps in Android

Secure, deploy, and monetize your Android apps

Who This Book Is For

Professional Android app developers.

Table of Contents

Frontmatter
Chapter 1. System
Abstract
The Android OS was born as the child of the Android Inc. company in 2003 and was later acquired by Google LLC in 2005. The first device running Android came on the market in 2008. Since then it has had numerous updates, with the latest version number at the beginning of 2018 reading 8.1.
Peter Späth
Chapter 2. Application
Abstract
An Android app consists of components such as activities, services, broadcast receivers, and content providers, as shown in Figure 2-1. Activities are for interacting with device users, services are for program parts that run without a dedicated user interface, broadcast receivers listen for standardized messages from other apps and components, and content providers allow other apps and components to access a certain amount and kind of data provided by a component.
Peter Späth
Chapter 3. Activities
Abstract
Activities represent user interface entry points of your app. Any app that needs to interact functionally with the user in a direct way, by letting the user enter things or telling the user graphically about the functional state of an app, will expose at least one activity to the system. I say functionally because telling the user about events can also happen via notifications through toasts or the status bar, for which an activity is not needed.
Peter Späth
Chapter 4. Services
Abstract
Services are components running without a user interface and with a conceptual affinity toward long-running processes. They are separate from notifications in the status bar or a Toast. Services can be started by apps, or they can be bound to by apps, or both.
Peter Späth
Chapter 5. Broadcasts
Abstract
Android broadcasts are messages following the publish-subscribe pattern. They are sent across the Android OS, with the internals hidden by the Android OS, so both publishers and subscribers see only a lean asynchronous interface for sending and receiving messages. Broadcasts can be published by the Android OS itself, by standard apps, and by any other app installed on the system. Likewise, any app can be configured or programmed to receive the broadcast messages they are interested in. Like activities, broadcasts can be explicitly or implicitly routed, which is the responsibility of the broadcast sender to decide.
Peter Späth
Chapter 6. Content Providers
Abstract
This chapter will cover content providers.
Peter Späth
Chapter 7. Permissions
Abstract
Securing sensitive data is an important task during the development of apps. With more and more apps on handheld devices being used for sensitive everyday tasks such as banking, security has been gaining more importance, and it will continue to do so in the future. You as a developer must take every precaution possible to handle your app users’ data responsibly.
Peter Späth
Chapter 8. APIs
Abstract
The subject of this chapter is to introduce APIs, which are the cornerstones of your app. The APIs include the following:
  • Databases
  • Scheduling
  • Loaders
  • Notifications
  • Alarm Manager
  • Contacts
  • Search Framework
  • Location and Maps
Peter Späth
Chapter 9. User Interface
Abstract
The user interface is certainly the most important part of any end-user app. For corporate usage, apps without user interfaces are possible, but even then in most cases you will have some kind of rudimentary UI, if for no other reason just to avoid the Android OS killing your app too readily during resource housekeeping tasks.
Peter Späth
Chapter 10. Development
Abstract
This chapter covers issues closer to development matters, compared to the previous chapters. The topics we will be talking about here are less tightly coupled to specific Android OS APIs. It is more our concern here to find out how technical requirements can best be accomplished using Kotlin methodologies.
Peter Späth
Chapter 11. Building
Abstract
In this chapter, we talk about the building process of your apps. Although building an app with source files can be done both using a terminal and using the graphical interface of the Android Studio IDE, this is not an introduction to Android Studio nor a code reference. For this type of in-depth instruction, please refer to the help included or to other books and online resources.
Peter Späth
Chapter 12. Communication
Abstract
Communication is about sending data through component or app or device boundaries. A standardized way for the components of one or more apps to communicate with each other is by using broadcasts, which were discussed in Chapter 5.
Peter Späth
Chapter 13. Hardware
Abstract
Android can do more than present a GUI on a smartphone. Android is also about wearables, talking to appropriately equipped TV sets and infotainment in cars. Smartphones also have cameras, NFC and Bluetooth adapters, and sensors for position, movement, orientation, and fingerprints. And yes, smartphones can do phone calls as well. This chapter describes how the Android OS can run on devices other than smartphones and how to interact with the device’s hardware.
Peter Späth
Chapter 14. Testing
Abstract
A lot has been said about testing in information technology. There are three reasons for the attention testing has gained during the last decades.
  • Testing is the interface between the developers and the users.
  • Testing can be engineered to some extent.
  • Testing helps increase profits.
Peter Späth
Chapter 15. Troubleshooting
Abstract
In the previous chapter, we talked about ways to test your app. If tests fail, the logs usually tell you what exactly happens, and if this is not enough, you can extend the logging of your app to see where things went wrong.
Peter Späth
Chapter 16. Distributing Apps
Abstract
If you have finished your app, you need to find a way to distribute it. The primary place where to go for that purpose is the Google Play store, but it is also possible to use other distribution channels if you can convince your users to allow app installations from “other sources.” I do not present a list of distribution channels here, nor do I present detailed instructions for using the Google Play store. There are just too many options depending on which market you are targeting. Also, this book is not intended to be an introduction into app marketing in general.
Peter Späth
Chapter 17. Instant Apps
Abstract
Instant apps allow a device user to use apps without actually installing them. On the Google Play store, the “Try it” button you sometimes see starts such an instant app.
Peter Späth
Chapter 18. CLI
Abstract
In this chapter, we summarize the command-line tools that you can use for building, administering, and maintaining tasks running outside Android Studio.
Peter Späth
Backmatter
Metadata
Title
Pro Android with Kotlin
Author
Peter Späth
Copyright Year
2018
Publisher
Apress
Electronic ISBN
978-1-4842-3820-2
Print ISBN
978-1-4842-3819-6
DOI
https://doi.org/10.1007/978-1-4842-3820-2

Premium Partner