My playbook app downloads a 开发者_运维百科zip file and opens it.
So can we create air objects on the playbook for file i/o operations since an api for the playbook I guess hasn't been developed. For example:
var file =new air.File(path);
First, this document will help you understand the layout of the Playbook's file system, and which directories are available to you, as a developer:
http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/BlackBerry-PlayBook-File-System-Layout/ta-p/773327
After that, working with a file can be as simple as:
var fs:FileStream = new FileStream();
var f:File = File.applicationDirectory;
f = f.resolvePath("myfile.txt");
fs.open(f, FileMode.READ);
// work with the file contents here
fs.close();
精彩评论