Book Image

Learning Kotlin by building Android Applications

By : Eunice Adutwumwaa Obugyei, Natarajan Raman
Book Image

Learning Kotlin by building Android Applications

By: Eunice Adutwumwaa Obugyei, Natarajan Raman

Overview of this book

<p>Today Kotlin is an official programming language for Android development and is widely adopted. Kotlin is expressive, concise, and powerful. It also ensures seamless interoperability with existing Android languages like JAVA and C++, which means that it's even easier for developers to use.</p> <p>This book adopts a project-style approach, where we focus on teaching Android development by building three different Android Application: a Tic-Tac-Toe application, a location- based alarm and a To-Do list application.</p> <p>The book begins by giving you a strong grasp of the Kotlin language and its APIs as a preliminary to building stunning applications for Android. You'll learn to set up an environment and as you progress through the chapters and the building of the different applications, the difficulty level will steadily grow.</p> <p>The book also introduces you to the Android Studio IDE, which plays an integral role in Android Development. It covers Kotlin's basic programming concepts such as functions, lambdas, properties, object-oriented code, safety aspects and type parameterization, testing, and concurrency, and helps you write Kotlin code to production.</p> <p>Finally, you'll be taken through the process of releasing your app on the Google Play Store. You will also be introduced to other app distribution channels such as Amazon App Store.</p> <p>As a bonus chapter, you will also learn how to use the Google Faces API to detect faces and add fun functionalities.</p>
Table of Contents (21 chapters)
Title Page
Packt Upsell
Contributors
Preface
Index

Generation of a Google Maps API key


As soon as the build process is complete, we will see the following resources file screen being opened by default and displayed by Android Studio:

The file is named google_maps_api.xml by default. The file clearly indicates that before we run our application, we need to get a Google Maps API key. The procedure to get the Google Maps API key for the app is listed in detail.

The key that is generated should be replaced by the placeholderYOUR_KEY_HERE mentioned in the file:

<resources>
 <!--
TODO: Before you run your application, you need a Google Maps API key.

To get one, follow this link, follow the directions and press "Create" at the end:

https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=00:ED:1B:E2:03:B9:2E:F4:A9:0F:25:7A:2F:40:2E:D2:89:96:AD:2D%3Bcom.natarajan.locationalarm

You can also add your credentials to an existing key, using these values:
Package name:
 00:ED:1B:E2...