Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.os.Build;

import java.io.File;

public class Main {
    public static boolean hasFileAccess(String filePath) {
        if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP) {
            return true;
        }
        File file = new File(filePath);
        if (file.canRead()) {
            return true;
        } else {
            return false;
        }
    }
}