Skip navigation
xinfinite
Currently Being Moderated

Cannot save data with FB/Air app running on Android

Feb 10, 2013 1:23 PM

Tags: #save #data #android_app

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

}

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points