Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top