|
Android-File-Extension-ANE Native Extension for Adobe AIR Features: - - open local file in native application. Can open any file type.
复制代码Important! Be shure you are using latest version of AIR SDK. This ANE builded for 15.0.356How to use:Connect com.illuzor.extensions.FileExtension.ane file to your android air project. Import com.illuzor.fileextension.FileExtension;Add permissions to your application: - <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
复制代码Using example: - // create and write simple text file
- var textString:String = "This is sample text file";
- var file:File = File.documentsDirectory.resolvePath("OpenFileTest.txt");
- var stream:FileStream = new FileStream();
- stream.open(file, FileMode.WRITE);
- stream.writeUTFBytes(textString);
- stream.close();
- FileExtension.openFile(file); // open created text file in native application.
复制代码
If you don`t need extension after use, dispose it:
Demo app - http://yadi.sk/d/Se_LR8fm1lgsD
相关链接:
https://github.com/illuzor/Android-File-Extension-ANE
|