I am wondering if it’s possible to delete file, which has been downloaded by URL connetion as a autoupdate right after installation? This *.apk should not be available for public, so I am deleting it from SD card when the app starts for the next time, but is there any other (better) way of dealing with it right after installation?
Thanks
edit: instalation of APK
menu.mProgressDialog.dismiss();
Intent install=new Intent(Intent.ACTION_VIEW);
install.setDataAndType(Uri.fromFile(new File(ctx.getCacheDir()+"/app.apk")), "application/vnd.android.package-archive");
ctx.startActivity(install);
Try saving it at
context.getCacheDir(). It’s not visible to other apps (or non-root users).Be sure to delete it as soon as possible (next time user starts your app, or listen for PACKAGE_INSTALLED broadcast) to avoid filling up your user’s phone’s internal memory!
Good luck
Tom