- Home /
Open an HTML file from streamingAssets - Android
Hello everyone. I have Googled this question and found several answers that were close, but have still failed to implement this for my specific case. All I want to do is open a .html file, which is stored locally, on a button click. I have placed the file in the StreamingAssets folder before my build. Below is my code which executes on the button click. Can anyone give me detailed instructions on how to accomplish this?
Thanks so much in advance.
string filepath = Application.persistentDataPath + "/" + usingAppUrl;
WWW usingAppUrlTemp = new WWW("jar:file://" + Application.streamingAssetsPath + "!/assets/" + usingAppUrl);
while(!usingAppUrlTemp.isDone){}
System.IO.File.WriteAllBytes(filepath, usingAppUrlTemp.bytes);
Application.OpenURL(Application.persistentDataPath + "/" + usingAppUrl);
Your answer
Follow this Question
Related Questions
Android StreamingAssets File Access 6 Answers
Application.dataPath is incorrect after install on Android 0 Answers
Choosing which files to move to Android apk expansion file 0 Answers
Can't read lines from file by using StreamReader on Android platform 2 Answers
Opening data file from asset folder 2 Answers