Can an app delete its own internal resources?

Posted by user637884 on Stack Overflow See other posts from Stack Overflow or by user637884
Published on 2011-02-28T15:15:02Z Indexed on 2011/02/28 15:24 UTC
Read the original article Hit count: 226

Filed under:

I am trying to find a way to delete an internal resource after an app installs. More specifically, I have a zip file included in the apk, that I unzip to the SD Card when the app is first run. But then want to delete the now unneeded zip file (the purpose being to save the user internal phone memory).

I access the zip file with,

Resources resources = this.getResources(); 
InputStream is = resources.openRawResource(R.raw.assets);

But am uncertain how to then delete the resource (if even possible).

I know one may ask why not simply install the app to SD Card at download. But the app includes a screen widget, and installing apps to the SD Card and using a screen widget is problematic.

Thanks, Matt

© Stack Overflow or respective owner

Related posts about android