You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to test what happens on first install of my app, but there seems to be some residual settings (kivy config?) files stored somewhere that aren't deleted when I uninstall the app, or when I "Clear app data" as per this link
What steps do I need to follow to completely delete the app, all settings and all user data?
With the latest version of p4a I experience no such thing.
interpreter + kv: data/data/your.app.name
java stuff + jni/C: data/app/your.apk
Maybe you've tried App.user_data_dir, which is a folder on sdcard/your.app.name or I think I saw it even in sdcard/Android/your.app.name and your app uses such config from user_data_dir?
No, this is purely Kivy thing and I didn't find anything from p4a to even target such file (that env. var is something different). I think it's just unhandeled behavior from the Kivy side, because the Config for some reason places the .ini outside of the app folder.
I'm not sure if it's desired, however the app contains the default kivy.ini file at the same folder where folder with logs is (data/data/...) and you probably should target that file if needed. It's still an issue so I'll open one in Kivy repo.
If you'd target kivy.ini file and your app is both android and e.g. some desktop, your default desktop config will be most likely overwritten (<user profile>/.kivy/config.ini)
Checked this with newest p4a and yes, config file and user_data_dr still reside in the same place and are not deleted with the app. However I don't have the same issue on ios. Can close if this should be moved to kivy repo? Cheers
Are you sure there are no leftovers in iOS somewhere in the system? About the user_data_dir, that folder isn't deleted anywhere afaik - desktops & android.
I made the ios comment because if I delete my app and reinstall it it
behaves as if it has just been installed for the first time, which makes me
think that the config file for my app is getting deleted on uninstall. I
haven't actually checked the file system.
Thanks
@hottwaj Could you please post some minimal example that creates such a config file? I tested with latest kivy and p4a this one:
from kivy.base import runTouchApp
from kivy.uix.boxlayout import BoxLayout
from kivy.config import Config
Config.set('graphics', 'height', 50)
Config.write()
runTouchApp(BoxLayout())
But both on Windows and Android it either creates a new one or overwrites in:
Windows -> %appdata%/.kivy/config.ini
Android -> /data/data/app.dir/app/.kivy/config.ini or if sdl2 launcher /sdcard/kivy/app/.kivy/config.ini
If your code uses Config.read() or Config.update_config() it's most likely your fault by choosing a path that's not automatically deletable. Still I think I've seen this behavior before, but I'm not sure how to reproduce.
Sure, I have it on my list. I just looked through my config code and can't see anything obvious - I don't use Config.read of Config.update_config.
It will take me more time to build a simplified test I'm afraid.
In the meantime in case it's useful, I use the following config related functions, roughly in this order:
First I provide a build_config method for my app in which I use config.setdefaults.
Later I use config.getint, config.set and config.write during the build() method of my app (when the app runs for the first time)
I use app.load_config somewhere.
I also use ConfigParserProperty in a few places.
Sorry, probably not very helpful... will try to put a simple test together soon. Thanks
Uh oh. I currently rely on this (mis?)feature. Can you give me some time to have a more detailed look and think of a solution that addresses both the described issue, and the way I'm currently using it?
@llfkj here, I zoomed it for you 🐼 bad line. This is why the config is thrown to sdcard like if it is a root folder. It could be fixed with targeting directly external storage directory, which I guess is removed after uninstalling the app (or removing its data, testing welcome).
More about it here. According to that quote it's removed, yet I experienced weird stuff on Gingerbread like 2 years ago, so...:
The SDK provides us with handy methods to determine where to put our stuff. These places will be deleted automatically when a user removes our apps and this keeps things tidy.
That, however, fixes things only for android and I'm still waiting for a reply about iOS, so that it could be fixed globally. :)
Activity
KeyWeeUsr commentedon Dec 8, 2016
With the latest version of p4a I experience no such thing.
data/data/your.app.namedata/app/your.apkMaybe you've tried
App.user_data_dir, which is a folder onsdcard/your.app.nameor I think I saw it even insdcard/Android/your.app.nameand your app uses such config from user_data_dir?JonAnCla commentedon Dec 8, 2016
Thanks, I'll look into this further... In case it makes a difference I'm still using the SDL/Pygame bootstrap.
JonAnCla commentedon Dec 8, 2016
Aha just found it...
The file ".myapp.ini" (Kivy config file for my app) is stored in "Main Storage" i.e.
/storage/emulated/0/.myapp.ini
My app's user_data_dir folder is:
/storage/emulated/0/myapp
These don't get deleted if I uninstall my app. Is this an issue with the pygame bootstrap?
JonAnCla commentedon Dec 8, 2016
Probably something to do with this change which I may not have pulled into my p4a repo... Will verify later - sorry for the posting noise.
KeyWeeUsr commentedon Dec 8, 2016
No, this is purely Kivy thing and I didn't find anything from p4a to even target such file (that env. var is something different). I think it's just unhandeled behavior from the Kivy side, because the
Configfor some reason places the.inioutside of the app folder.I'm not sure if it's desired, however the app contains the default
kivy.inifile at the same folder where folder with logs is (data/data/...) and you probably should target that file if needed. It's still an issue so I'll open one in Kivy repo.If you'd target
kivy.inifile and your app is both android and e.g. some desktop, your default desktop config will be most likely overwritten (<user profile>/.kivy/config.ini)JonAnCla commentedon Dec 10, 2016
Checked this with newest p4a and yes, config file and user_data_dr still reside in the same place and are not deleted with the app. However I don't have the same issue on ios. Can close if this should be moved to kivy repo? Cheers
KeyWeeUsr commentedon Dec 10, 2016
Are you sure there are no leftovers in iOS somewhere in the system? About the
user_data_dir, that folder isn't deleted anywhere afaik - desktops & android.JonAnCla commentedon Dec 11, 2016
KeyWeeUsr commentedon Dec 12, 2016
@hottwaj Could you please post some minimal example that creates such a config file? I tested with latest kivy and p4a this one:
But both on Windows and Android it either creates a new one or overwrites in:
%appdata%/.kivy/config.ini/data/data/app.dir/app/.kivy/config.inior if sdl2 launcher/sdcard/kivy/app/.kivy/config.iniIf your code uses
Config.read()orConfig.update_config()it's most likely your fault by choosing a path that's not automatically deletable. Still I think I've seen this behavior before, but I'm not sure how to reproduce.JonAnCla commentedon Dec 14, 2016
Sure I will get this done, but probably not until next week - busy times! Cheers
KeyWeeUsr commentedon Dec 22, 2016
@hottwaj Please don't forget about this issue, it seems really useful for resolving the additional permission of casual kivy apps.
JonAnCla commentedon Dec 22, 2016
Sure, I have it on my list. I just looked through my config code and can't see anything obvious - I don't use Config.read of Config.update_config.
It will take me more time to build a simplified test I'm afraid.
In the meantime in case it's useful, I use the following config related functions, roughly in this order:
First I provide a build_config method for my app in which I use config.setdefaults.
Later I use config.getint, config.set and config.write during the build() method of my app (when the app runs for the first time)
I use app.load_config somewhere.
I also use ConfigParserProperty in a few places.
Sorry, probably not very helpful... will try to put a simple test together soon. Thanks
KeyWeeUsr commentedon Dec 22, 2016
Probably it won't be needed anymore, the description was enough. It's the example from
Appdocs. So yeah, a bug 🙍 thanks for the description.JonAnCla commentedon Dec 23, 2016
Cool, glad that description was helpful! Thanks
llfkj commentedon Jan 3, 2017
Uh oh. I currently rely on this (mis?)feature. Can you give me some time to have a more detailed look and think of a solution that addresses both the described issue, and the way I'm currently using it?
KeyWeeUsr commentedon Jan 3, 2017
@llfkj here, I zoomed it for you 🐼 bad line. This is why the config is thrown to sdcard like if it is a root folder. It could be fixed with targeting directly external storage directory, which I guess is removed after uninstalling the app (or removing its data, testing welcome).
More about it here. According to that quote it's removed, yet I experienced weird stuff on Gingerbread like 2 years ago, so...:
That, however, fixes things only for android and I'm still waiting for a reply about iOS, so that it could be fixed globally. :)
inclement commentedon Jan 31, 2019
Closing as a Kivy issue rather than a p4a one, which we're aware of and working to fix.
inclement commentedon Jan 31, 2019
@Jonast Thanks, I wasn't sure if it was actually fixed yet. That's great :)