- Home /
Open a local html file in the Android's default browser
Hi everyone,
I would like to open an html file that is stored locally on the device from my Unity app.
The file is located in
Application.persistentDataPath + "/Site/index.html"
It contains html, css and javascript.
I use
Application.OpenURL (Application.persistentDataPath + "/Site/index.html");
to open this file.
Everything works fine on Windows (it opens the file in my default web browser) but when I deploy my app on an Android device, it allows me to open it only with the "HTML viewer" app and not with the default browser. The problem with HTML viewer is that the Javascript seems to be disable and I need it.
I already search a lot. I tried to open it with the browser activity "com.android.browser.BrowserActivity". The only thing that is working is to install this app on the device
https://play.google.com/store/apps/details?id=ru.gelin.android.browser.open
This app allow me to redirect the file to chrome and everything works as I want. But I would like to avoid to use this app if it's possible.
I'm waiting for your help.