0

In reference to the following 2 posts, regarding the use of System::Ioutils::TPath::Combine(System::Ioutils::TPath::GetDocumentsPath():

“Save to Files” on iOS (FMX)

How can I write to a file using C++ buider in an Android app?

Now I can save my data to an iPhone. But in vain, when running my app on an Android phone, I can't find my file in the phone.

Can somebody help to demonstrate how I can use SaveToFile() to save a file on an Android phone?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • Have you read the docs for [`TPath::GetDocumentsPath()`](http://docwiki.embarcadero.com/Libraries/en/System.IOUtils.TPath.GetDocumentsPath) and [Standard RTL Path Functions across the Supported Target Platforms](http://docwiki.embarcadero.com/RADStudio/en/Standard_RTL_Path_Functions_across_the_Supported_Target_Platforms) yet? On Android, `TPath::GetDocumentsDir()` is for "internal memory" that is private to your app. To access the file from the outside world, try [`TPath::GetSharedDocumentsPath()`](http://docwiki.embarcadero.com/Libraries/en/System.IOUtils.TPath.GetSharedDocumentsPath) instead – Remy Lebeau Jun 21 '21 at 22:06
  • Thanks Remy. I'll try to use the other function. But, is that means I have to use different function for iPhone and Android app? – Courant Yin-Jiun Tseng Jun 22 '21 at 05:55
  • when interacting with things related to the OS, like the file system, that is usually the case, yes – Remy Lebeau Jun 22 '21 at 06:07

0 Answers0