check Socket Pipes using shell - Android Android OS

Android examples for Android OS:Shell

Description

check Socket Pipes using shell

Demo Code


//package com.java2s;

import android.util.Log;
import java.io.File;

public class Main {
    private static String[] known_pipes = { "/dev/socket/qemud",
            "/dev/qemu_pipe" };

    public static boolean checkPipes() {
        for (int i = 0; i < known_pipes.length; i++) {
            String pipes = known_pipes[i];
            File qemu_socket = new File(pipes);
            if (qemu_socket.exists()) {
                Log.v("Result:", "Find pipes!");
                return true;
            }//from w w w .j  a  v a  2  s .  c  o m
        }
        Log.i("Result:", "Not Find pipes!");
        return false;
    }
}

Related Tutorials