Android Noop Question

75 views
Skip to first unread message

der Raab

unread,
Nov 25, 2015, 5:33:24 AM11/25/15
to Haxe

Again we struggle with real native targets :) 


I'd like to load some files directly from the application directory and the application storage directory using the file:// protocol.


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. I tried several classes like System, openfls SystemPath and openfls File - but nothing worked.


Could you please point me to the right direction? Turns out that without specific platform knowledge actually supporting them is hard (hopefully in the beginning). Looks like Adobe AIR still does an great job. But we really want to support native.

der Raab

unread,
Nov 25, 2015, 4:20:35 PM11/25/15
to Haxe
Nobody any idea on such a "basic" thing? I found a basic topic about the android file system but I don't have any clue how that helps me? :) http://www.howtogeek.com/202644/how-to-manage-files-and-use-the-file-system-on-android/

Philippe Elsass

unread,
Nov 25, 2015, 6:31:07 PM11/25/15
to Haxe
OpenFl/NME may have Java code to deal with that in their Android target.

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.



--
Philippe

Hugh

unread,
Nov 25, 2015, 11:34:03 PM11/25/15
to Haxe
Nme has nme.filesystem.File.applicationDirectory.nativePath and
 nme.filesystem.File.applicationStorageDirectory.nativePath 

From this name, you can add your file part, and use the standard haxe calls, like sys.io.File.getBytes or sys.FileSystem.readDirectory

You can also use nme.utils.ByteArray.readFile

Hugh
Reply all
Reply to author
Forward
0 new messages