Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: permanent files on android and iOS


This question is answered.


Permlink Replies: 4 - Last Post: Dec 26, 2015 6:12 AM Last Post By: Erick Engelke
Erick Engelke

Posts: 101
Registered: 12/5/02
permanent files on android and iOS  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 25, 2015 8:06 AM
I am converting a Win/Mac FMX app to run on android and iOS, but where I'm having a problem is determining the file location to save my config information. Suprisingly, all the other code works pretty well with only minor $IFDEFs.

The code uses TIniFile presently. I thought mobile apps would save files to a safe local directory, but TIniFile always wants to save to /blah.ini when I specify blah.ini. So I'm guessing I have to specify an absolute path. But what would that path be? Maybe com.erickengelke.blah

I notice getcurrentdir/getcurrentdirectory are not available, and forcedirectories() doesn create from the root... don't know where it creates the directory.

So how do I speciify a path to some read/writeable storage?

Thanks
Erick
--
Erick Engelke
HTML5 Builder Book
http://www.erickengelke.com
Brian Hamilton ...

Posts: 556
Registered: 10/14/04
Re: permanent files on android and iOS
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 25, 2015 9:30 AM   in response to: Erick Engelke in response to: Erick Engelke
I use Gethomepath or Android
for iOS I use Apple.IniFiles, Apple.Utils units and

TuserIniFile.Create;

(note that this unti uses a differnet ini file structure)
Erick Engelke

Posts: 101
Registered: 12/5/02
Re: permanent files on android and iOS  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 25, 2015 11:06 AM   in response to: Brian Hamilton ... in response to: Brian Hamilton ...
Brian Hamilton Hamilton wrote:
I use Gethomepath or Android
for iOS I use Apple.IniFiles, Apple.Utils units and

TuserIniFile.Create;

(note that this unti uses a differnet ini file structure)

I see this works for android.

I tried using GetHomePath for Apple to store temporary files but get an error, even though it appears to point to /var/...apple-id... and my filename looks sane. Is there anywhere safe to store files on the IOS? I'm sure I'm just missing the detail.


--
Erick Engelke
HTML5 Builder Book
http://www.erickengelke.com

Brian Hamilton ...

Posts: 556
Registered: 10/14/04
Re: permanent files on android and iOS
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 25, 2015 2:46 PM   in response to: Erick Engelke in response to: Erick Engelke
http://edn.embarcadero.com/article/43065
and see the section towards the end re the tuserinifile
Erick Engelke

Posts: 101
Registered: 12/5/02
Re: permanent files on android and iOS  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 26, 2015 6:12 AM   in response to: Brian Hamilton ... in response to: Brian Hamilton ...
Great. That solves my problem perfectly. I wish the files were included in FMX and you didn't have to download them from an ancient version.

Erick

Brian Hamilton Hamilton wrote:
http://edn.embarcadero.com/article/43065
and see the section towards the end re the tuserinifile

--
Erick Engelke
HTML5 Builder Book
http://www.erickengelke.com
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02