public class I2PAndroidHelper
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
I2PAndroidHelper.Callback |
| Modifier and Type | Field and Description |
|---|---|
static int |
REQUEST_START_I2P |
static java.lang.String |
URI_I2P_ANDROID |
static java.lang.String |
URI_I2P_ANDROID_DONATE |
static java.lang.String |
URI_I2P_ANDROID_LEGACY |
| Constructor and Description |
|---|
I2PAndroidHelper(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
areTunnelsActive()
Check if tunnels are active.
|
void |
bind()
Try to bind to I2P Android.
|
void |
bind(I2PAndroidHelper.Callback callback)
Try to bind to I2P Android.
|
boolean |
bind(android.content.ServiceConnection serviceConnection,
int flags)
Try to bind to I2P Android, using the provided ServiceConnection and
flags.
|
boolean |
isI2PAndroidInstalled()
Check if I2P Android is installed.
|
boolean |
isI2PAndroidRunning()
Check if I2P Android is running.
|
void |
promptToInstall(android.app.Activity activity)
Show dialog - install I2P Android from market or F-Droid.
|
void |
requestI2PAndroidStart(android.app.Activity activity)
Show dialog - request that I2P Android be started.
|
void |
unbind()
Unbind from I2P Android.
|
public static final java.lang.String URI_I2P_ANDROID
public static final java.lang.String URI_I2P_ANDROID_DONATE
public static final java.lang.String URI_I2P_ANDROID_LEGACY
public static final int REQUEST_START_I2P
public void bind(I2PAndroidHelper.Callback callback)
Activity.onStart().callback - will be called once the helper has bound to the I2P app.public void bind()
Activity.onStart().
If you need to be notified as soon as the helper has been bound to the
I2P app, use bind(Callback) instead.public boolean bind(android.content.ServiceConnection serviceConnection,
int flags)
Service.onStartCommand(android.content.Intent, int, int).
The ServiceConnection will be provided with an IBinder
that can be converted to an
net.i2p.android.router.service.IRouterState with
IRouterState.Stub.asInterface(IBinder).public void unbind()
Activity.onStop().public boolean isI2PAndroidInstalled()
public void promptToInstall(android.app.Activity activity)
activity - the Activity this method has been called from.public boolean isI2PAndroidRunning()
bind()
has not been called previously, this will always return false.
Do not call this from Activity.onResume(). The Android lifecycle
calls that method before binding the helper to the I2P app, so this will
always return false. Use bind(Callback) instead
and call this method inside the callback.public void requestI2PAndroidStart(android.app.Activity activity)
activity - the Activity this method has been called from.public boolean areTunnelsActive()
bind() has not been called
previously, this will always return false.
Do not call this from Activity.onResume(). The Android lifecycle
calls that method before binding the helper to the I2P app, so this will
always return false. Use bind(Callback) instead
and call this method inside the callback.