Android javascript api silent mode

285 views Asked by At

I am writing an app that works a bit like 'do not disturb' but with a timer.

So I want to set the phone onto 'silent mode' for a while and then switch it back to the original volume.

I also want to keep the app running (i.e. keep screen on) for the duration of the timer.

But I want to do all this from an HTML5 / Javascript app.

Is this possible with the javascript api? Or any html5/js toolkit?

1

There are 1 answers

0
kassim On BEST ANSWER

It should be possible to do with Javascript in a WebView. With WebView.addJavascriptInterface() you can insert a object from your Android code which you can call to from your Javascript code that is running in the WebView.