Code example for AssetFileDescriptor

0
	} 
 
	 
	 
	public static void copyObbFile(Context ctx) {
		try { 
	        String packageName = ctx.getPackageName();
	         
	        Log.w(TAG, "copyObbFile.packageName: " + packageName);
	        Log.w(TAG, "copyObbFile.Environment.getExternalStorageState(): " + Environment.getExternalStorageState());
	        Log.w(TAG, "copyObbFile.Environment.getExternalStorageDirectory(): " + Environment.getExternalStorageDirectory());
	        Log.w(TAG, "copyObbFile.ctx.getFilesDir(): " + ctx.getFilesDir()); 
	         
	        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
	            // Build the full path to the app's expansion files 
	            File root = Environment.getExternalStorageDirectory();
	            File expPath = new File(root.toString() + EXP_PATH + packageName);
	             
	            File assetsObbFile = new File("file:///android_asset/main.1.au.com.museumvictoria.fieldguide.vic.obb");
                File main = new File(expPath + File.separator + "main.1.au.com.museumvictoria.fieldguide.vic.obb");