jyothi s

unread,
May 2, 2019, 2:46:07 AM5/2/19
to MIT App Inventor Forum
My app creates a folder in internal storage of the phone. How to remove this folder while uninstall the app.

BodyMindPower

unread,
May 2, 2019, 4:37:53 AM5/2/19
to MIT App Inventor Forum
If this folder is an app-specific external storage folder
/storage/emulated/0/Android/<packageName>/files
this folder will be removed automatically when deinstalling the app. Otherwise that folder remains.

A very good overview on this topic (internal / external storage):

Anke

jyothi s

unread,
May 2, 2019, 5:47:44 AM5/2/19
to MIT App Inventor Forum
That folder is created once the app is installed and registration process is completed.The path of folder is /storage/emulated/0/Demo/
I am not able to find the installation path of my app. Could you please help me to find it? 
 

BodyMindPower

unread,
May 2, 2019, 6:09:02 AM5/2/19
to MIT App Inventor Forum
Internal storage folders location (for the app) is /data/data/<app packageName>/
Without a rooted device, you will not have access to it. Also you can not create a folder in this internal storage through the app.
/storage/emulated/0/Demo/ is a non-app-specific external folder which will not be removed when uninstalling the app.

Anke

jyothi s

unread,
May 2, 2019, 6:31:39 AM5/2/19
to MIT App Inventor Forum
How can I make an app specific folder. Since I am new to android programming, I don't have much idea about these things. 

BodyMindPower

unread,
May 2, 2019, 6:48:22 AM5/2/19
to MIT App Inventor Forum

jyothi s

unread,
May 2, 2019, 6:51:10 AM5/2/19
to MIT App Inventor Forum
Oh thank you so much for your kind help.

Chris Ward

unread,
May 2, 2019, 7:10:45 AM5/2/19
to MIT App Inventor Forum

BodyMindPower

unread,
May 2, 2019, 8:34:45 AM5/2/19
to MIT App Inventor Forum
Hi Chris,

No, it is NOT possible to create an app-specific folder on your way.

Regardless, READ_ / WRITE_EXTERNAL_STORAGE permissions are requested. However, these are NOT required for an app-specific folder.

Try to create such an app-specific folder on your way ...
and moreover, if you uninstall the app, this folder remains, which means it's not app-specific.

Lastly, compare this:
with your blocks:

Chris Ward

unread,
May 2, 2019, 12:18:15 PM5/2/19
to MIT App Inventor Forum
Hello Anke

I did not realise the goal was an App-Specific folder in those terms. Of course a folder created "my way" (It's not my way, it's a generally known way) can be used specifically for an App, but indeed it is not part of the installation, not exclusive to the App and the OS would not remove it at the time of the App being removed. That is commonplace.

There is an important consideration there - not every App should have "the folder" removed on uninstall - it could be storing things like images that the User does not want to lose.

We (including Taifun) endeavour to provide a solution that does not require an extension whenever we can, for good reasons:
  • Schools want their students to code solutions for their further understanding of programming
  • Extensions can fall out of date with App Inventor and no longer work
  • Many thousands of App Inventor Users cannot afford even a $5 extension
Finally you are mocking the App Inventor code compared to the Extension, in terms of what? Number of blocks? Even though a large proportion of them are comments to help Users understand the Blocks? You are riding a mighty high horse.

BodyMindPower

unread,
May 2, 2019, 1:19:01 PM5/2/19
to mitappinv...@googlegroups.com
Hi Chris,
"There is an important consideration there - not every App should have "the folder" removed on uninstall - it could be storing things like images that the User does not want to lose."
Of course, for this purpose it is also possible to create a non-app-specific folder.
 
"We (including Taifun) endeavour to provide a solution that does not require an extension whenever we can, for good reasons: ..."
And again: of course. But in this case there is no alternative.


"Finally you are mocking the App Inventor code compared to the Extension, in terms of what?"
It's far from me to mock something. I'm just showing the only (and for the user simpliest) way to create an app-specific folder.

But, if you did not know it's about an app-specific folder, why do you intervene?

Taifun

unread,
May 4, 2019, 3:50:06 PM5/4/19
to MIT App Inventor Forum
thank you BodyMindPower for your contribution

yes, you can use the CreateApplicationSpecificDirectory method from the file extension to create a directory, which will be deleted automatically while uninstalling the app. Also you can read and write files from/to that directory without read or write permission....

asd.JPG



Creates the application specific directory /storage/emulated/0/Android/<packageName>/files in case it does not exist.       

of course you always can create directories on the internal sdcard, which will not be removed while uninstalling the app... but make sure to have read/write permission in this case...

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

BodyMindPower

unread,
May 5, 2019, 3:47:43 AM5/5/19
to MIT App Inventor Forum
At this point a big thank you to Taifun. Almost everything I learned about App Inventor I learned from him. Without his help (for a little money / donation) none of my apps would have been created / published. His website offers so much info, tutorials, extensions etc. It is by far the best website for AI2.

Whenever I had a problem with my apps, I got a perfect solution from Taifun. In particular, his app-specific directory solution is very useful because I know from my app users that they do not like permissions at all. With the new CreateApplicationSpecificDirectory method, I can completely avoid these (read/write) permissions.

Great job, thanks a lot!

Reply all
Reply to author
Forward
0 new messages