Skip to content
russa edited this page Aug 22, 2017 · 9 revisions

Getting Started

This chapter describes the system and software requirements for developing multimodal mobile interaction applications using MMIR-framework for Android operating system.

Supported Operating Systems

  • Windows XP, Vista, or Windows 7
  • Mac OS

Use MMIR for a Cordova 3 Project

TBD

Please see README file at mmir-cordova for instructions on how to create a new Cordova 3.x project and/or add MMIR to an existing Cordova 3.x project.


attention attention

 

NOTE: the following is a copy from the README file in mmir-cordova:

 


Add MMIR Resources To An Existing Cordova Project

Starting with your Cordova 5 (or later version) project which should look something like this

hooks/
merges/
platforms/
plugins/
www/
config.xml

create a new sub-direcotry build/.

Then, copy the the contents of the MMIR tooling repository into sub-directory build/.

Go into the new sub-directory and execute npm install and then gulp (i.e. execute these commands in directory build/).

This will copy some files into the Cordova-project's root directory (as well as some files into hooks/before_prepare/):

build/
mmir-build.properties
mmir-build.settingsDefault

Then you can use the contents of www-example/ from mmir-tooling as starting point for your application code in www/.

NOTE: You should replace the contents of www/mmirf/ with a current version from mmir-lib.

Create A New Cordova Project (Cordova CLI)

after creating a new Cordova project using cordova create DIR PACKAGE+APPNAME APPNAME, change into the newly created project directory DIR.

The contents of DIR should look something like:

hooks/
merges/
platforms/
plugins/
www/
config.xml

Now, in order to add the MMIR framework, do the following:

  1. add platforms, e.g. Android:

    cordova platform add android

    and you may also want to add the whitelist plugin

    cordova-plugin-whitelist (the recommended whitelist plugin)_

    or

    cordova-plugin-legacy-whitelist (the backwards-compatible whitelist plugin)_

  2. add plugin-dependencies (i.e. Cordova plugins required by the MMIR framework; for specific dependency details see below)

    cordova plugin add cordova-plugin-media

    cordova plugin add cordova-plugin-network-information

    cordova plugin add cordova-plugin-vibration

  3. edit config.xml: the src attribute of the content tag should be modified to set the query parameter of the URL:

    <content src="index.html?env=cordova" />

and add / modify other tags in config.xml as needed, e.g. set CORS filter to allow HTTPS access to domain www.some-site.com:

<access origin="https://www.some-site.com*"/>
  1. add the MMIR framework

    1. add the SCION queue plugin

    cordova plugin add https://github.com/mmig/mmir-plugin-scionqueue.git

    1. copy the MMIR tooling files into sub-directory build/ of the newly created Cordova project at DIR
    • there should not exist a directory build/ yet, so you should create it

    • after copying the files into build/, go into this new sub-direcotry and exectue npm install and then gulp. This will copy some scripts into hooks/before_prepare as well as several configuration files into the root directory DIR (these will have the prefix mmir- in their file name):

      ...
      hooks/before_prepare/**
      mmir-build.properties
      mmir-build.settingsDefault
      mmir-build.settings
      ...
      
    1. copy the JavaScript application code and the main index.html into DIR/www (you can use the example index.html and app.js as starting point)

    2. copy the the MMIR-library files into the sub-directory DIR/www/mmirf

    3. you may also want to add platform specific speech modules for speech input (recognition) and speech output (synthesis), e.g. the Android Speech Plugin:

    cordova plugin add https://github.com/mmig/mmir-plugin-speech-android.git

    or the Nuance Speech Plugin (besides Android also supports iOS but requires credentials, i.e. developer account ect.; see the plugin's README file for more details)

  2. build the project for all installed platforms using the command cordova build

    NOTE: You may have to create / configure mmir-build.settings within the project's root directory DIR. If this file does not exist yet, it will be created automatically as a copy of mmir-build.settingsDefault. You may have to edit mmir-build.settings to match your build environment (see comments within the file for more information).

    NOTE: If you want to update the platforms (with changes you made in /www) without triggering a complete build, you can use the command cordova prepare.

--

Use Cordova Platform-Specific Resources

See the Cordova documentation for platform specific development guides, .e.g. the guide for Android.


attention attention

 

NOTE: end of copy from mmir-cordova.

 


MMIR StarterKit for Android

Requirements

For development based on the MMIR Starter Kit application

  • Download and install Eclipse (3.4+)

    e.g. the Classic, or EE Developer edition (recommended, see also section below HTML Editing)

  • Download and install Android SDK (2.2+)

  • Download and install ADT Plugin

  • Download the MMIR-StarterKit.zip

You should also ensure that you have created at least one Android virtual device (AVD): in Eclipse select the Java perspective and open from the menu Window → Android Virtual Device Manager; for detailed instructions on how to create a new AVD in Eclipse, we refer to the online instructions. You will need an AVD to run your project in the Android emulator. You should have the Android tools/ and Android platform-tool/ folders listed in your system path. Both these folders can be found inside your Android installation directory.

Use Window → Android SDK Manager for installing the SDK of the Android version you are targeting with your application; at least one SDK has to be installed (we recommend to use at least ver. 2.2+).

Using Eclipse

While using Eclipse as development environment is not strictly required, we recommend it. The following gives some hints for setting up Eclipse in order to ease development of MMIR based applications.

HTML Editing

Hint: If your Eclipse environment brings an HTML editor (e.g. as the EE Developer edition does) [⊗] you can setup Eclipse to use this editor for eHTML files. eHTML is the template format used by the framework, similar to JSP (Java Server Pages) or ASP (Active Server Pages) templates.

For setting the HTML editor as default editor: Preferences → General → Editors → File Associations, then in File types, add an entry for *.ehtml and set the HTML editor as its default.


Figure 6: Eclipse Preferences dialog for associating file extensions with content types.

For using the syntax highlight of the HTML editor: in Preferences → General → Content Types select Text → HTML, then in Text → File Associations add an entry *.ehtml.


Figure 7: *.ehtml file without (left) and with (right) syntax highlighting for content type HTML in Eclipse.

Similary, you can use the JavaScript editor as default for opening JSON files, by adding the entry *.json to Text → File Associations (and adding the JavaScript editor if necessary).

Setting up Eclipse for Android

First, you should download and install the Android SDK; you should note the directory where the SDK is installed into, as you may need this information later. Next, install the ADT Plugins (e.g. in Eclipse, using the update site); see also section Requirements, above.

Android Source Code

For debugging purposes, you may want to configure Eclipse to have access to the Android source code. For Android 4.x you can use the SDK Manager, e.g. in Eclipse in the Java perspective, open Window → Android SDK Manager, expand the entry for the corresponding Android 4.x version and select Sources for Android SDK for installing the source. When prompted with No sources attached... for Android code (e.g. during debugging), select the [Android SDK directory]/sources/[version] subdirectory for the version currently used in your project from the Android SDK installation directory, e.g. /android-sdk/sources/android-16.

For some of the older Android versions [⊥], the plugin from http://code.google.com/p/adt-addons/ → Android Sources can be used to integrate source code support. You can use the update site http://adt-addons.googlecode.com/svn/trunk/source/com.android.ide.eclipse.source.update/ for installing the Android Sources plugin.


< previous: "Speech Processing in MMIR" | next: "Import MMIR StarterKit into Eclipse" >


[⊗] Eclipse Classic does not bring an editor for HTML by default; you can install an editor manually e.g. using your Eclipse’s update page Install New Software...: select the entry with [version name] - http://download.eclipse.org/releases/[version_name], there expand the entry Web, XML and Java EE development and select Web Page Editor.

[⊥] Note, that currently no source code is available for Android ver. 3.x.

Clone this wiki locally