Android: File.applicationDirectory.url and File.applicationStorageDirectory.url

Hi there,

I’d like to load some files directly from the application directory and the application directory using the file:// protocol but I couldn’t get it done without using the Assets.loadText() method - which let’s me access some assets.

Anyway - I already completely finished an mechanism to load a huge set of different data by providing a root directory url e. g. file://path/to/my/application/ and file://path/to/my/applicationStorage/

But I don’ know how to resolve these two crucial directories. Could you please point me to the right direction?

The lime.system.System class could help:

Hi and thanks - yes - we tried that but applicationDirectory is null.

Must be because it’s an apk and not a directory like in native targets.

But anything inside the apk can be accessed with Assets,
why the need to use the file:// protocol?

For apk assets you could always drop everything below the root and you’d end up with the normal asset path.

Boy - didn’t I look into this for a long time. I was just in the google group. Sorry for not responding.

Why using file protocol? Because I want to download files from remotes first to a local file and load everything from there (relatively).

Or can I somehow access loaded files through Assets? But anyway, I’d like to use the Loader, URLLoader classes because I implemented complex views already. We simply use Adobe AIR for now - but would love to switch to “native”

ByteArray.fromFile, or URLLoader (without file://) should work, I believe