These forums are specific to the Waze mobile app. Post here if you experienced a problem while using the app, have a question about the app functionality or a feature such as navigation or search.

Post Reply
Forum rules
Waze App Useful Resources

How do we resume Waze from Android Terminal?

Post by SoulEater85
Hi everyone,

I've been using Waze for some time now, and been through its ups and downs as well. Though only now have I developed enough courage/determination to make a thread.

I use Lenovo K900 (yes, not a standard Android phone, I guess), running Android 4.3 and Waze works perfectly for me! Well, there are some GPS black spots, but I don't think that's solely Waze's fault. But there is one very annoying problem that I constantly face.

When driving, I often "sleep" my device while running Waze and listen for directions by voice. It works great, sometimes, but other times, the app gets shut down. Not sure if it's by Android or the app closing itself when in sleep mode - and it doesn't happen everytime. Funny that.
The reason why I do this is because I don't really have a place to put the phone where I can see it, and I don't really fancy using the clips that attach to the AC blower flaps. Also, sometimes I use it while riding motorbike (through earphones).

Anyway, having a rooted device and have a very slight small clue about Linux, I ran a while loop on Android Terminal to keep checking whether Waze is running or not, if not, then run it. The command is as follows:
while ((1)); do ps | grep waze > /dev/null; if II$?!=0)); then am start -n com.waze/.MainActivity; fi; sleep 10; done

I found that the command above technically works, since it re-launches Waze when it gets shut down during sleep mode, but it doesn't automatically resume the previous route. I find that the program sort of runs but not completely (GPS is not even activated, as far as I know - the symbol doesn't appear on the top taskbar). When I unlock the phone, the program runs completely, going to the map and asking whether I want to resume the previous route.

So, I guess from the story above I have addressed a number of questions. I'll start with my most important one:
- Is there any way we can make the above command more effective to launch the Waze program so that it runs the GPS and resumes the previous route? Through analysing the manifest.xml I can only find MainActivity to be the command that works. Any suggestion would be appreciated.
- Why does Waze shut down? Is it an Android memory clean-up thing during sleep mode? - Just FYI, I already disabled the built-in Lenovo Power Manager settings that says clean up apps that's not running.
- FInally, is there a way to protect Waze from shutting down altogether during the sleep mode?

All and any help/advice/suggestion would be highly appreciated.

Thanks in advance.

Cheers,
Henry
SoulEater85
Posts: 1

POSTER_ID:17060228

1

Send a message