Skip to content

Instantly share code, notes, and snippets.

View wpfilf's full-sized avatar

Will wpfilf

View GitHub Profile
@tatocaster
tatocaster / RealPathUtil.java
Last active October 25, 2024 07:18
Real Path Utility class for Android, works for all API
public class RealPathUtil {
public static String getRealPath(Context context, Uri fileUri) {
String realPath;
// SDK < API11
if (Build.VERSION.SDK_INT < 11) {
realPath = RealPathUtil.getRealPathFromURI_BelowAPI11(context, fileUri);
}
// SDK >= 11 && SDK < 19
else if (Build.VERSION.SDK_INT < 19) {