0 Replies Latest reply on Feb 10, 2013 1:23 PM by xinfinite

    Cannot save data with FB/Air app running on Android

    xinfinite

      Hi,

      I'm finishing a iOS+Android project and have only left 1 bug.

      My App has to save some data and I'm using the functions printed below.

      On iOS everything is working as should but on Android no files are created.

      I'm working with FB(4.6) with AirSDK(3.5.0.1060).

       

      public function dataLoad(fn:String):String {

                var data:String="";

                var f:File = File.applicationStorageDirectory;

                f=f.resolvePath(fn);

                if ( f.exists ) {

                               var fs:FileStream = new FileStream();

                               fs.open(f,FileMode.READ);

                               data = fs.readUTFBytes(fs.bytesAvailable);

                               fs.close();

                }

                return data;

      }

       

      public function dataSave(fn:String,data:String):void {

                var f:File = File.applicationStorageDirectory;

                f=f.resolvePath(fn);

                var fs:FileStream = new FileStream();

                fs.open(f,FileMode.WRITE);

                fs.writeUTFBytes(data);

                fs.close();

      }