Intergrate jar file into ionic project

Hey there,

I’m developing an app (Ionic v3) with a chatbot using AIML. My project goal: The chatbot should ask questions and the user have to answer. But I’ve one big problem: There’s no working AIML-Interpreter. There’s only ProgramAB as a jar file and I’ve found this tutorial to work with ProgramAB in java.
My plan: I’ve tried to integrate this jar file into my projekt as a cordova plugin like this…


<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="" id="aiml-interpreter" version="1.0.0">
    <name>AIML Interpreter</name>

    <js-module src="www/plugin.js" name="plugin">
        <clobbers target="AIMLInterpreter" />

    <!-- android -->
    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="AIMLInterpreter">
                <param name="android-package" value="com.example.AIMLInterpreter" />
                <param name="onload" value="true" />
        <source-file src="src/android/libs/aiml-plugin.jar" target-dir="src/com/example/" />

and in config.xml

<lib-file src="plugins/aiml-plugin/src/android/libs/aiml-plugin.jar"/>

…and now - I’m honest - I’ve no idea what to do next. What should I write into the plugin.js and the chat.ts files? Can anyone help me?




And, in particular:

It demonstrates how you can use Cordova’s plugin architecture to access Java (and ‘C’) from JavaScript.