public abstract class DimplePluginActivity
extends Activity
<activity android:name="ActivityName">
<intent-filter>
<action android:name="io.dimple.action.PLUGIN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
to list this activity as simple plugin or
<activity android:name="ActivityName">
<intent-filter>
<action android:name="io.dimple.action.PLUGIN_LONGPRESS"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
to list this activity as long-press plugin in Dimple (replacing ActivityName with your activity).Constructor and Description |
---|
DimplePluginActivity() |
Modifier and Type | Method and Description |
---|---|
void |
cancelCreatingPlugin()
Cancels plugin creation and finishes activity
|
abstract void |
createPlugin(boolean longPress,
int memorySize) |
void |
execute(byte[] data)
Override this function to execute action on plugin.
|
void |
finishCreatingPlugin(byte[] data)
Sets activity result and finishes activity.
|
void |
finishCreatingPlugin(byte[] data,
long interval)
Sets activity result and finishes activity.
|
protected void |
onCreate(Bundle savedInstanceState) |
protected void onCreate(Bundle savedInstanceState)
public void execute(byte[] data)
data
- Data that was set to Dimplepublic abstract void createPlugin(boolean longPress, int memorySize)
public void cancelCreatingPlugin()
public void finishCreatingPlugin(byte[] data)
data
- data to send back to Dimple. This data will be sent back to app when plugin is launched.public void finishCreatingPlugin(byte[] data, long interval)
data
- data to send back to Dimple. This data will be sent back to app when plugin is launched.interval
- interval between hold events. Interval can be:
negative = don't send hold events,
0 = send as fast as possible,
>0 = try to send hold event once each @interval milliseconds (exact send rate not guaranteed, depends on RF communication delays)