Delete SaveText etc when project/app is deleted?

81 views
Skip to first unread message

Alan Hendry

unread,
Sep 26, 2022, 10:12:07 AM9/26/22
to DroidScript
HI,
When we delete a project from the DS Home Page, does it delete the SaveText (etc) files?
Regards, ah

Right2TheV0id

unread,
Sep 26, 2022, 1:18:03 PM9/26/22
to DroidScript
I tested it by creating, deletingn, then re-creating a project of the same name and it appears that previously saved values are kept.
Tested with and without restarting DS (same results).

Alan Hendry

unread,
Sep 27, 2022, 8:14:59 AM9/27/22
to DroidScript
HI,
I guess you could change the code to app.ClearData() and run it, before deleting the project
(to clear out files, particularly if there's a lot of data).
I would guess that renaming the project doesn't move the saved data across. 
Regards, ah

Alan Hendry

unread,
Oct 14, 2022, 5:14:50 AM10/14/22
to DroidScript
HI,
I suspect that any files you create (running under DS) using path app.GetPrivate
are not deleted when you delete the app/project from the DS Home screen.
Regards, ah

Alan Hendry

unread,
Oct 14, 2022, 6:11:35 AM10/14/22
to DroidScript
HI,
The simple code below tells you if a file exists, then creates it, then tells you if it exists.
If you put it in an app, run it under DS , then delete the app, then recreate the app and run it again 
it shows that the file is not deleted when the app is deleted.
Further if you put the code in an app with a different name then the file still exists.
So it looks like (at least running under DS) it doesn't have one GetPrivateFolder per app/project, 
but all your app/projects use the same one.
Scoped Storage should clean up when an app is deleted, so presumably each built app has their own PrivateFolder
(and not share it between everything with the same packagename).
Regards, ah

function OnStart() {
    gp = app.GetPrivateFolder("test") + "/test.txt"
    alert(app.FileExists(gp))
    app.WriteFile(gp,"hi","Append")
    alert(app.FileExists(gp))
}

Alan Hendry

unread,
Oct 14, 2022, 7:17:08 AM10/14/22
to DroidScript
HI,
Running under DS GetPrivateFolder("test") is /data/user/0/com.smartphone.androidscriptfree/app _test
(com.smartphone.androidscriptfree is the package name for DS)
Regards, ah

Reply all
Reply to author
Forward
0 new messages