Demo
August 12, 2019 ยท View on GitHub
Demo project for the mmir framework in combination with Apache Cordova
with platform android.
This project uses mmir-lib version 5.x.x, and jQuery Mobile as a GUI library:
although jQuery Mobile is somewhat dated, this projects demonstrates, how to use
mmir-lib in a project that does not utilize any additional build-tools
like webpack, browserify or similar.
Demo
Try the demo page:
- speech input will only work in Chrome
(mmirprovides speech plugins for other browser, see the mmir wiki for more details) - for speech input, permission to use the browser's microphone needs to be granted
Further Reading
See the mmir project page for more details, guides, API documentation etc.
Custom Build Configuration
Extended build configuration settings for mmir-lib can be specified via file
mmir.build.config.js which is automatically read by mmir-tooling/utils/cordova-build-tool.js
if it exists (see step 3 in section Create Manually).
The example file mmir.build.config.js contains an empty configuration (i.e.
default build configuration will be used), and in addition an alternative
configuration that specifies a different state model for the DialogManager
which will use animated transitions when changing views.
To enable the "animated transitions" state model, export the variable
stateModelWithViewTransitions instead of defaultConfig in mmir.build.config.js.
For more options and setting see mmir-tooling.
Create Manually
-
create a new
cordovaproject, for details see cordova documentation:cordova create ... -
setup
cordovaandmmir# setup cordova and cordova-plugins cordova platform add android cordova plugin add cordova-plugin-vibration cordova plugin add cordova-plugin-network-information # custom version of cordova-plugin-media that provides media-ready event (for asnyc audio loading) cordova plugin add git+https://github.com/mmig/cordova-plugin-media.git#CB-6880-mediaready-state-impl # setup mmir npm install --save git+https://github.com/mmig/mmir-lib.git npm install --save-dev git+https://github.com/mmig/mmir-tooling.git # install mmir-lib files into www/mmirf # as npm script -> see "scripts" in package.json npm run install-mmir-lib # or as bin-script (Windows) node_modules\.bin\mmirinstall www/mmirf --force # install mmir-plugins cordova plugin add git+https://github.com/mmig/mmir-plugin-speech-android.git#mmir-v5 -
integration
mmir-toolingintocordovabuild process:
add entry toconfig.xml<hook type="before_prepare" src="node_modules/mmir-tooling/utils/cordova-build-tool.js" /> -
copy assets from this project's
www/directory into thewww/directory of the newly createdcordovaproject -
run
mmir-toolingviacordova# run mmir-tooling via cordova cordova prepare # ... or run mmir-tooling and build cordova cordova build android # ... or run mmir-tooling and build cordova and run platform cordova run android
Previous Versions
for previous versions of the mmir-starter-kit see repository mmir-v4-starter-kit
which contains examples that use mmir-lib v4.x and before.
Note that these examples are deprecated and will not be updated anymore.
License
If not stated otherwise, the code, resource files etc. are provided under the MIT license (see license file).