Setup the plugin project
1. Install Android Studio
https://developer.android.com/studio/
2. Open Android Studio and New a project

- Company domain must be "mcaplugin.com", otherwise the plugin can't be found by MCA Pro.
- Set any name you like to "Application name".
- If you want to use JNI, select "Including C++ support"
- Click next.

- Select API 21

- Select "Add No Activity"

- Change to "Project"

- Find Plugin.jar, click right button of the mouse, and press "Add as Library"

- Press "Ok"

- Change back to "Android"
- New the class by right-clicking app/java/com.mcaplugin.[your Application] and press "New" -> Java Class

- The name of the class must be [your Application name] in lower case. Otherwise the plugin can't be found by MCA Pro.
- Set Superclass to "com.mcapro.pluginif.MCA_Plugin"
- Set Interface(s) to the plugin type you want to implement. One plugin can only one type.
- com.mcapro.pluginif.EncodeInputIF
- com.mcapro.pluginif.EncodeOutputIF
- com.mcapro.pluginif.DecodeInputAudioIF
- com.mcapro.pluginif.DecodeInputSampleIF
- com.mcapro.pluginif.DecodeOutputIF
- public abstract class MCA_Plugin {
public static final int LIBERARY_VERSION = 20181013;
public abstract int getType();
public static final int TYPE_ENCODE_INPUT = 1; //Must implements EncodeInputIF
public static final int TYPE_ENCODE_OUTPUT = 2; //Must implements EncodeOutputIF
public static final int TYPE_DECODE_INPUT_AUDIO = 11; //Must implements DecodeInputAudioIF
public static final int TYPE_DECODE_INPUT_SAMPLE = 12; //Must implements DecodeInputSampleIF
public static final int TYPE_DECODE_OUTPUT = 13; //Must implements DecodeOutputIF
//Common
public abstract String getName(Object resource);
public abstract String getDescription(Object resource);
public abstract int getVersion();
public abstract int getMinSDK();
//State control
public abstract boolean init();
public abstract boolean start();
public abstract boolean stop();
public abstract boolean release();
//Return false if the action is succeed.
//Return true if something is wrong.
//But MCA Pro doesn't handle these return states currently.
public abstract Object getView(Object context, Object resource);
//Control flow:
//Load in plugin: init() -> getView()
//Unload plugin: stop() -> release()
//After pressing "Encode" or "Decode" button: stop() -> start() -> getInputString() or getInput() or handleOutput() -> Process by MCAPro -> handleOutput()
//After pressing "Stop" button or whenever need it: stop()
}