Jump to content
schaumermal

General Question

Recommended Posts

Hi,

I have a general question:

I create a local config file on the Android device.

 

TIniFile.Create(System.IOUtils.TPath.GetDocumentsPath + System.SysUtils.PathDelim + 'config.ini') 

 

to store user data (login, servername, etc.).

 

When I uninstall the app, this config file is still available.

 

Do i put it in the wrong folder or why is it still present when i uninstall and reinstall the app?

 

 

 

 

Edited by schaumermal

Share this post


Link to post
7 hours ago, schaumermal said:

When I uninstall the app, this config file is still available.

That does not sound right.  TPath.GetDocumentsPath() is documented as using Android's Context.getFilesDir() method, and Android documents that as an app-specific internal folder that gets removed during app uninstall.

7 hours ago, schaumermal said:

Do i put it in the wrong folder

Clearly.  But the question is, why?  What path does TPath.GetDocumentsPath() actually return on your device?

7 hours ago, schaumermal said:

why is it still present when i uninstall and reinstall the app?

It must be using a public/shared folder, rather than an internal app-specific folder.

Share this post


Link to post

i use it like this:

 

  ini := TIniFile.Create(System.IOUtils.TPath.GetDocumentsPath + System.SysUtils.PathDelim + 'config.ini');

 

When i call the function

 

  ShowMessage(System.IOUtils.TPath.GetDocumentsPath + System.SysUtils.PathDelim + 'config.ini');

 

i get the result

 

/data/user/0/"bundle identifier"/files/config.ini

 

It looks like i have the problem with all of my apps 😞

 

 

Edited by schaumermal

Share this post


Link to post
On 10/22/2022 at 6:14 AM, schaumermal said:

i get the result

 

/data/user/0/"bundle identifier"/files/config.ini

That is an app-specific internal folder, so it should get deleted on app uninstall.  Are you saying that is not the case?  If so, then you will have to take up that issue with Google.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×