安卓应用里编程 怎么把apk里的assets里的zip解压到sd卡?求代码或教程~

2026年09月28日 06:36
有2个网友回答
网友(1):

private void assetsDataToSD(String fileName) throws IOException
{
InputStream myInput;
OutputStream myOutput = new FileOutputStream(fileName);
myInput = this.getAssets().open("myfile.zip");
byte[] buffer = new byte[1024];
int length = myInput.read(buffer);
while(length > 0)
{
myOutput.write(buffer, 0, length);
length = myInput.read(buffer);
}

myOutput.flush();
myInput.close();
myOutput.close();
}
希望对你。有帮助。→_→

网友(2):

你猜