Java tutorial
//package com.java2s; //License from project: Open Source License import android.app.Activity; import android.net.Uri; import java.io.FileNotFoundException; import java.io.InputStream; public class Main { private static InputStream getDeviceFileAsInputStream(Uri uri, Activity activity) throws FileNotFoundException { return activity.getContentResolver().openInputStream(uri); } }