开发者

Open file from Playbook app

开发者 https://www.devze.com 2023-03-20 00:21 出处:网络
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

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();
0

精彩评论

暂无评论...
验证码 换一张
取 消