March 2016
Intermediate to advanced
428 pages
9h 2m
English
We'll start this chapter with a simple recipe that is commonly needed: how to get the last known location. This is an easy way to use APIs with very little overhead resource drain. (This means, your app won't be responsible for killing the battery.)
This recipe also provides a good introduction to setting up the Google Location APIs.
Create a new project in Android Studio and call it: GetLastLocation. Use the default Phone & Tablet options, and select Empty Activity when prompted for Activity Type.
First, we'll add the necessary permissions to the Android Manifest, then we'll create a layout with a Button and a TextView element. Finally, we'll create a GoogleAPIClient API to access the last ...
Read now
Unlock full access