Hi, Matt,
Which file API are you tried, native file system API or w3c file API?
Crosswalk has native file system API besides w3c file API, which can 
read/write/mange file out of sandbox. Here demos the usage of this API, 
https://github.com/crosswalk-project/crosswalk/blob/master/test/android/data/native_file_system.html.
Crosswalk restricts the ability of native file system API for security reason. 
Only following path is opened for Android app developer,
*         ALARMS
*         DCIM
*         DOWNLOADS
*         MOVIES
*         MUSIC
*         NOTIFICATIONS
*         PICTURES
*         PODCASTS
*         RINGTONES
*         CACHEDIR  # Cache directory of your app
*         EXTERNAL_CACHEDIR  # External cache directory of your app
Thanks,
Shawn

From: Min, Hongbo
Sent: Friday, August 15, 2014 9:27 AM
To: Matt Bargar; [email protected]
Cc: Huo, Halton; Gao, Shawn
Subject: RE: [Crosswalk-help] Accessing file system

+ Halto and Shawn

________________________________
From: Crosswalk-help [[email protected]] on 
behalf of Matt Bargar [[email protected]]
Sent: Friday, August 15, 2014 3:22 AM
To: 
[email protected]<mailto:[email protected]>
Subject: [Crosswalk-help] Accessing file system
Hi-
We're working on a Crosswalk app, and have a question. We are planning on 
writing a Crosswalk extension that deals with expansion files. At a high level, 
this theoretical extension would have two main tasks: 1. checking to make sure 
any necessary OBB files were downloaded correctly, and, in our case, unzipping 
the OBB file somewhere 2. providing a path to where the files were unzipped.

One of the tasks we know will need to be accomplished is reading files (html, 
css, images, audio) from the file system, after the expansion file has been 
unzipped. We have investigated the File API, and it's great for what it does! 
We are able to successfully read in images and text and deal with them from the 
javascript side (adding them to the DOM, etc.)

However, our ideal use case would be to be able to point Crosswalk to the 
unzipped expansion file (presumably mounted on /sdcard/ somewhere, we could get 
the path from the Java side) and have it read html files natively. i.e., we 
would have a /www/ folder in our expansion file, and we could direct Crosswalk 
to display files inside that /www/ folder (in an iframe, for example). What 
would be the best approach to this?

We have tried various forms of file:///<file:///\\> URLs (we always get "Not 
allowed to load local resource:" errors in the Chrome logs) and app:/// URLs 
(we get a 403 Forbidden if we try to reach outside our app's sandbox).

We are currently using Canary (9.37.192.0). Thanks for any help you can give us!
-Matt Bargar

_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

Reply via email to