android without qt initial commit

This commit is contained in:
hypnosis-i2p 2016-07-10 04:54:11 +08:00
parent 40a4c3ccbd
commit 69c954760a
17 changed files with 567 additions and 3 deletions

View file

@ -0,0 +1,20 @@
package org.purplei2p.i2pd;
import android.app.Activity;
import android.widget.TextView;
import android.os.Bundle;
public class I2PD extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText( "libi2pd.so was compiled with ABI " + getABICompiledWith());
setContentView(tv);
}
public String getABICompiledWith() {
return I2PD_JNI.getABICompiledWith();
}
}

View file

@ -0,0 +1,16 @@
package org.purplei2p.i2pd;
public class I2PD_JNI {
public static native String getABICompiledWith();
/**
* returns 1 if daemon init failed
* returns 0 if daemon initialized and started okay
*/
public static native int startDaemon();
//should only be called after startDaemon() success
public static native void stopDaemon();
static {
System.loadLibrary("i2pd");
}
}