I want to find a hands-free method of periodically displaying information (drawn from a local database) while I am navigating using Google Maps without disrupting Google Maps.
I started with the assumption that I could use Google Assistant to use a voice command to summon the app when it is safe for me to do so, but when I installed test apps (for example one called xyz) and asked Google Assistant to "open xyz" it simply responded by typing "open xyz" on the screen.
"Voice access" does seem to be able to launch apps, including my test apps. However, when I tried to use it while driving it didn't respond to my commands.
I next tried using JobScheduler to run a JobService that could display a Toast. (I considered using Text-To-Speech but that could be confusing if it tried to speak at the same time as Google Maps, so a text display is probably better.) This has two obvious disadvantages:
- the job cannot be run more frequently than every 15 minutes. Since the app would be for my own use I would like to specifiy a shorter interval. I tried following the advice in job scheduler in android N with less then 15 minutes interval but couldn't make that work.
- a Toast can only be displayed for about 3 seconds, which won't be long enough while I'm driving. I tried following the advice in How to show a Toast for a specific duration but the Toast still stayed for only about 3 seconds. I then thought of using a SnackBar instead, but it seems that this can't be used from a JobService.
I would welcome any advice.