Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic save and load diagram (Read 4423 times)
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
save and load diagram
Jan 24th, 2016 at 6:19pm
Print Post  
Hi, I saved the diagram using:
try {
FileOutputStream fileOut = openFileOutput(fileName,Context.MODE_PRIVATE);
fileOut.flush();
diagram.saveTo(fileOut);
fileOut.close;
} catch (IOException e) {
    e.printStackTrace();
}

and I load it using:
try {
    FileInputStream inputStream = openFileInput(o);
     diagram.loadFrom(inputStream);
      inputStream.close();
  } catch (IOException e) {
        e.printStackTrace();
}

but I would like to know in which folder of the device it saves the diagram, because I need the file saved, could you tell me or is there another way to save the file in order to get it outside the application? I don't mean the diagram but the file serialized when saved, in which folder does it put it?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: save and load diagram
Reply #1 - Jan 25th, 2016 at 11:39am
Print Post  
Hi,

Call the Context.getFileStreamPath method to find the absolute path of file created by openFileOutput.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
Re: save and load diagram
Reply #2 - Jan 30th, 2016 at 10:10am
Print Post  
I found the path the problem is that I cannot access to it, I can simply read the string with the name of the path but I cannot access to the files and I need a way to get the files saved. In this way I have the name of the folder but I cannot find the folder on my device.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3343
Joined: Oct 19th, 2005
Re: save and load diagram
Reply #3 - Feb 1st, 2016 at 8:59am
Print Post  
Hello there,

I think that's the idea of Context.MODE_PRIVATE flag - it keeps the files private to your application package and other apps cannot find them. See if it will work if you change the flag to MODE_WORLD_READABLE.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint