About Store Forum Documentation Contact



Post Reply 
TextData cannot save at android platform
Author Message
rect Offline
Member

Post: #1
TextData cannot save at android platform
Hi all,I use TextData to save my game config at Android device.my code is like:

Code:
int nRect4 = 0;
void SaveSettings(TextData &data)
{
   TextNode &sv=data.getNode("Rect");
   sv.getNode("Rect4").value=S+4;
}
void LoadSettings(TextData &data)
{

   if(TextNode *sv=data.findNode("Rect"))
   {
      if(TextNode *n=sv.findNode("Rect4"))
      {
         nRect4 = n.asFlt();
      }
   }

}
void SaveSettings(C Str &name="Settings.txt")
{
   TextData settings; SaveSettings(settings); settings.save(name);
}
void LoadSettings(C Str &name="Settings.txt")
{
   TextData settings;
   if(settings.load(name))
      LoadSettings(settings);
}

I call SaveSettings(),and LoadSettings().

at win platform nRect4 is 4
at andrpid platfomr nRect4 is 0

my question is:
1.why?
2.Is TextData cannot save file in android device?

thanks.
06-02-2015 05:04 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: TextData cannot save at android platform
Hi,

http://www.esenthel.com/?id=doc#Mobile
For Android you need to use SystemPath(SP_APP_DATA) and save files in that location.
06-02-2015 05:51 AM
Find all posts by this user Quote this message in a reply
rect Offline
Member

Post: #3
RE: TextData cannot save at android platform
thanks.
06-02-2015 07:15 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply