Actually I am confronted with a Problem. I've got a ".apk-File" in one Package of my Application. apk is a kind of a jar File (apk = Android Package). I now want to copy this jar-file out of my Programm onto any other Location at the PC. Normally I would do this by using:
FileInputStream is = new FileInputStream(this.getClass().getResource("/resources/myApp.apk").getFile());
And then write it on the disk with using a FileOutputStream. ... but since an .apk is a kind of a .jar it doesn't work. It just copies the .apk file. but without the containing other files.
any help would be appreciated
Since .apk
is a .jar
file by another name (in other words it is a zip file with some specific definitions of where configuration files are stored inside the directory) then look at ZipInputStream to read the file and walk through the contents and write them out as files.