Android Streaming Assets

Hello,

I am trying to load files from Streaming assets because I have some xhtml and some other extension files I want to load
and my application cannot find the folder or file or anything.

I am using:
string AndroidPath = “jar:file://” + Application.dataPath + “!/assets/” + filename;
and it’s not working even though I can find everything in the apk when I unzip it…

if(!File.Exists( “jar:file://” + Application.dataPath ))
{
Debug.debug( “NOT EXIST A” );
}
if(!File.Exists( “jar:file://” + Application.dataPath+ “!/assets/” ))
{
Debug.debug( “NOT EXIST B” );
}

What am I doing wrong? Any ideas?

You can’t do it like that. The “jar:file://” + Application.dataPath + “!/assets/” + filename;" is not a valid file path, it’s a url. To access resources inside zip files you have two options. Access individual resources in the .apk by using the WWW api or use a zip file reader and open the .apk file explicitly.

I am using the WWW path but it still giving me problems depending whether I use persisten path, data path or streamed path

If you put your files in the StreamingAssets folder you can use string path = Application.streamingAssetsPath + “/” + filename; to create valid url to a file.