Skip to content

ivere27/dorypuppy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dorypuppy

  • event-driven process manager on Android by JNI(libuv)
  • shared objects are included for arm64

how to use

1 'Import Moudle' in Android Studio. Source directory : (git root)/android/dorypuppy
or manualy add the below code to settings.gradle(replace the path with yours)

include ':dorypuppy'
project(':dorypuppy').projectDir = new File(rootProject.projectDir, '../../dorypuppy/android/dorypuppy')
  1. add "compile project(':dorypuppy')" to dependencies{} in your build.gradle
  2. set "release { minifyEnabled false" to buildTypes{} in build.gradle

example

DoryProcess p = new DoryProcess("/system/bin/ls", "/system/bin"); // cmd, args...
p.directory(new File("/system"));                   // cwd, optional
p.environment().put("KEY","VALUE");                 // env, optional

p.setOnExitListener(new DoryPuppy.ExitListener() {  // optional
    @Override
    public void listener(long code, int signal) {
        Log.d("exit", code + " / " + signal);
    }
});
p.setOnStdoutListener(new DoryPuppy.StdListener() {  // optional
    @Override
    public void listener(byte[] array) {
        Log.d("stdout", new String(array));
    }
});
p.setOnStderrListener(new DoryPuppy.StdListener() {  // optional
    @Override
    public void listener(byte[] array) {
        Log.d("stderr", new String(array));
    }
});

try {
    int pid = p.start();                             // p.start(long timeout)
    Log.d("app", "pid : " + pid);
} catch (IOException e) {
    e.printStackTrace();
}

About

ProcessBuilder Alternative on Android

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published