find Binary bin folder - Android java.io

Android examples for java.io:Folder

Description

find Binary bin folder

Demo Code

import android.util.Log;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.InputStreamReader;

public class Main{


    public static boolean findBinary(String binaryName) {
        boolean found = false;
        String[] places = { "/sbin/", "/system/bin/", "/system/xbin/",
                "/data/local/xbin/", "/data/local/bin/",
                "/system/sd/xbin/", "/system/bin/failsafe/", "/data/local/" };
        for (String where : places) {
            if (new File(where + binaryName).exists()) {
                found = true;//ww w . j a v  a2  s  .c o  m
                break;
            }
        }
        return found;
    }

}

Related Tutorials