AndroidはFileを使用して一時ファイルFile.createTempFileを作成します



Android Uses File Create Temporary File



Ado、コードに直接

File files = new File('/mnt/sdcard/log.txt') // If the file does not exist, then began to create a temporary file if (files.exists()==false) { try { File tempFile=null tempFile = tempFile.createTempFile('users', 'properties') byte[] buffer = new byte[1024] FileOutputStream writeFile = new FileOutputStream(tempFile) InputStream inStream = getResources().getAssets().open('log.txt') int length = inStream.read(buffer) writeFile.write(buffer, 0, length) writeFile.flush() inStream.close() writeFile.close() files = tempFile } catch (IOException e) { e.printStackTrace() } }

さて、ファイルファイルは一時ファイルであり、ファイルファイルは通常の違いはありません。