Skip to Content
Android 9 Development Cookbook - Third Edition
book

Android 9 Development Cookbook - Third Edition

by Rick Boyer
October 2018
Intermediate to advanced
464 pages
15h 17m
English
Packt Publishing
Content preview from Android 9 Development Cookbook - Third Edition

How to do it...

We won't need a layout for this recipe as we'll use Toasts and Notifications for the user interaction. We will need to create an additional Java class for IntentService, which handles the Geofence alerts. Open the Android Manifest and follow these steps:

  1. Add the following permission:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  1. Open the build.gradle (Module: app) file and add the following statement to the dependencies section:
implementation 'com.google.android.gms:play-services:12.0.1'
  1. Create a new Java class called GeofenceIntentService and extend the IntentService class. The declaration will look as follows:
public class GeofenceIntentService extends IntentService { 
  1. Add the following ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Android Application Development Cookbook - Second Edition

Android Application Development Cookbook - Second Edition

Rick Boyer, Kyle Mew
Android High Performance Programming

Android High Performance Programming

Enrique López Mañas, Diego Grancini
Android Things Projects

Android Things Projects

Francesco Azzola

Publisher Resources

ISBN: 9781788991216Supplemental Content