Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Auto: Allow to search for chargers along the route, near the destination, or along the driving direction #143

Open
johan12345 opened this issue Nov 1, 2021 · 11 comments
Labels
android-auto api-limitation Issues that cannot be solved due to a limitation at the data source newfeature

Comments

@johan12345
Copy link
Collaborator

would require access to the currently running navigation route, as requested in https://issuetracker.google.com/issues/204692004

@johan12345
Copy link
Collaborator Author

A workaround that I have thought about: We might be able use the user's current location and speed to find out that the user is traveling on a highway/motorway in a certain direction, and then propose to show upcoming chargers along this road. This of course only works well if the user intends to stay on this road.

@johan12345
Copy link
Collaborator Author

Another simpler workaround: Allow the user to find chargers within a bounding box along their driving direction.

@johan12345 johan12345 changed the title Android Auto: Allow to search for chargers along the route or near the destination Android Auto: Allow to search for chargers along the route, near the destination, or along the driving direction Jul 2, 2022
@johan12345
Copy link
Collaborator Author

And another idea: With notification access, we may be able to find out the user's current destination from the persistent notification from Google Maps. However it may be ambiguous (e.g. the notification may only contain the street address but not the postcode/city).

@johan12345
Copy link
Collaborator Author

With #244, search for chargers along the current driving direction is now implemented.

As mentioned above, reliably implementing a search along the route or near the destination needs access to the current navigation route, which is not yet implemented in Android Auto.

@johan12345 johan12345 added the api-limitation Issues that cannot be solved due to a limitation at the data source label Oct 13, 2022
@twischer
Copy link

Hello @johan12345,

I am also interested in such a feature and willing to implement parts.
As far as I can see https://issuetracker.google.com/issues/204692004 is marked as fixed.
Was the only change introduced with this fix the addCompassListener() used by #244 ?
Does it mean we would still not be able to identify chargers near the route Google Maps is currently navigating to?

I would even like to extend this feature to show the diversion in minutes to reach a certain charger (if possible via the Google API).

@johan12345
Copy link
Collaborator Author

Hm, I am actually not sure why that issue has been marked as fixed - I cannot see any relevant updates in the changelog. I have just added a comment in the issue tracker to ask whether this was intentional.

@twischer
Copy link

Hello @johan12345,

looks like there is no progress from Google. I have two alternatives in mind:

  1. Allow the users to enter there own Google API key. So the Distance Matrix API can be used to sort the chargers by the distance to the current location and the minimal detour in minutes between current location and the destination. As far as I understand with a free API key 40,000 distances/month (200$/month / 0.005$) can be calculated 1
  2. Export available charging stations matching the filters in the EVMap app as Google Maps favorites. The favorites can be seen in the Google Maps app and in https://www.google.de/maps. Whenever the status of a charger changes add or remove it to the Google Maps favorites

What do you think about such approaches? Do you see already any issues with such solutions?

@johan12345
Copy link
Collaborator Author

Allow the users to enter there own Google API key. So the Distance Matrix API can be used to sort the chargers by the distance to the current location and the minimal detour in minutes between current location and the destination. As far as I understand with a free API key 40,000 distances/month (200$/month / 0.005$) can be calculated 1

Yes, that would probably be the API to use. However there would still need to be a way for EVMap to know what your current route / destination is (as discussed above). And adding your own API key is quite complex for non-technical users, but yes, looking at the size of the current user base it is probably necessary.

Export available charging stations matching the filters in the EVMap app as Google Maps favorites. The favorites can be seen in the Google Maps app and in https://www.google.de/maps. Whenever the status of a charger changes add or remove it to the Google Maps favorites

I think there is no way to dynamically update Google Maps favorites through an API...

@twischer
Copy link

twischer commented Apr 4, 2023

there would still need to be a way for EVMap to know what your current route / destination is

For me it would be fine to enter the destination manually (like searching for chargers at a certain location). But it could also be extended by a feature of getting the destination from the current appointment in the Google calendar (like Google Maps does it)

I think there is no way to dynamically update Google Maps favorites through an API

So far I also did only found https://developers.google.com/maps/documentation/android-sdk/marker which seems not to fit for our needs because it cannot be combined with showing a route (as far as I understand),

@ntruchsess
Copy link

ntruchsess commented Apr 10, 2024

I use OSMAnd for navigation and allready have contributed to the project. Currently OSMAnd doesn't provide an api to access the current route, but there is a PR that aims to implement that: osmandapp/OsmAnd#9304
While this PR is now open for quite some time the OSMAnd-developers initially intended to merge it, but then there were conflicts and the initial contributor apparently is no longer interested to solve those..
@johan12345 : if you are interested I'll pick up this PR, solve the conflicts and resubmit it mentioning that EVMap as would be the first consumer.

@johan12345
Copy link
Collaborator Author

@ntruchsess That sounds interesting! Does that API also work if the OsmAnd navigation is running on Android Auto (and not currently in the foreground on the phone)? Probably, right?

A common API for different navigation apps to provide this data would of course be nicer, but at least it's a first step :)

I can't promise though that I can implement that feature quickly on the EVMap side, I haven't had that much time recently and also still want to finally finish up #290 ...

#324 will also need some refactoring of the map screen on Android Auto (but in turn give us more flexibility, e.g. the route could be displayed on the map). So it probably makes sense to implement it (at least the Android Auto part of it) after that is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android-auto api-limitation Issues that cannot be solved due to a limitation at the data source newfeature
Projects
None yet
Development

No branches or pull requests

3 participants