Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting the end of navigation in Waze or Google Maps for mobile

I want my mobile app to be triggered by the "end-of-navigation" in either Waze or the Google Maps app. In it's simplest form, I would like my app to do something when the user gets the "You've arrived at your destination" notification from the navigation app.

I realize, in Android at least, that I can start the navigation (either in Waze, or Google Maps app) by creating an intent. Then, I can run my own proximity sensor in my app to wait for the user to arrive. However, I wanted something far cleaner - a situation where all that is required from the user is to have my app working in the background and then for this app to able to respond to the event of arrival directly.

Solutions either in iOS or Android are very welcome. Hacky solutions are also very welcome.

Thanks

like image 480
stav Avatar asked Jul 01 '14 13:07

stav


People also ask

Which navigation app is better Waze or Google Maps?

Google Maps seems to be more reliable, accurate and has better real-time traffic, whereas Waze has a larger army of fans who think the app is amazing who love its voice prompts feature. However, updates caused issues for both apps.

How do I end navigation on Waze?

There is a left arrow button on the bottom of the Waze app. Otherwise, use a similar physical button. Via a pop-up window, select Shut down option.

Why do people use Waze instead of Google Maps?

In a nutshell, Waze is a community-driven navigation app, whereas Google Maps takes a data-driven approach. Waze users can alert other drivers about accidents, heavy traffic, speed traps, police control, and more. Additionally, since its acquisition by Google, Waze has developed more additional features.

Can you use Waze instead of Google Maps?

Google Maps vs Waze: AvailabilityBoth apps are available on iOS and Android devices, and are compatible with Android Auto and Apple CarPlay. So it doesn't matter what device you use, or what car you drive, you've got the option of using both.


2 Answers

A simple solution will be to create a GeoFence just before the intent for navigation is started. You can listen to Geofence.GEOFENCE_TRANSITION_ENTER event using an intent service running in background. When this event happens you can do what ever task you need to do from the service class. This same principle can be implemented in ios also: Here is a tutorial for implementing Geofence in ios http://www.raywenderlich.com/95014/geofencing-ios-swift and in android http://paulusworld.com/technical/android-geofences

like image 141
Jossy Paul Avatar answered Oct 11 '22 06:10

Jossy Paul


A super hacky thing you could do (almost don't want to post this) would be to use the NotificationListenerService and keep an eye out for the notifications from google maps or waze.

http://developer.android.com/reference/android/service/notification/NotificationListenerService.html#nestedclasses

I think it should be for public to use as long as you have the permission.

You're going to have to think of something smart for languages, maybe reading resources from the google maps / waze apps to ensure you don't miss notifications that are not in English.

This may be viable for iOS as well: https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Specification/Specification.html I don't have personal experience with the watch Apis for iOS so you'll have to dig around there yourself.

like image 27
JohanShogun Avatar answered Oct 11 '22 04:10

JohanShogun