Geofencing API Tutorial for Android | raywenderlich.com

In this geofence tutorial, you’ll learn how to use Android’s Geofencing API to build an app with custom geofences.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/7372-geofencing-api-tutorial-for-android

I know this is an old topic but…

The tutorial no longer “works” as expected. As of Android O, the tutorial will not wake up the app from background. It will “trigger” geofence notifications if the app is in the foreground.

In order to make this work as intended you will need to take Google’s suggestion but using the JobIntentService instead of just the IntentService.

There is a Java based sample here that demonstrates the use of the BroadcastReceiver and JobIntentService method. This sample is in stark contrast even to Google’s on recommendation on their documentation. I believe this is possibly because the material is out of date and has not been updated by Google.

@fernandospr Do you have any feedback about this? Thank you - much appreciated! :]

Hi, this tutorial was based on the official documentation and sample project from Google. Unfortunately I’ve seen that there’re issues and questions about them on the web stating that they won’t work. So let me investigate and get back to you.

EDIT: @liltimtim after checking the Google samples and some Stackoverflow questions/answers, I’ve edited this tutorial. Now, the geofences work better in Android O. Although I’ve experienced that it depends on the devices and OS versions since Android O.

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!