MMIR2 4.1 Import MMIG StarterKit into Eclipse - mmig/mmir GitHub Wiki

Importing MMIG-StarterKit into Eclipse

To import the MMIG-StarterKit (MSK) to Eclipse follow these steps:

  1. Start Eclipse and go to File → Import.

  2. Select Existing Project into Workspace and click the Next button.

  1. Click the radio button next to Select archive file and click the Browse button on the following dialog.

  1. Navigate to MMIG-StarterKit.zip on your disk. Click open to select it.

MSK is based on the Apache Cordova platform and has almost the same structure as a Cordova project. Figure 10 illustrates the structure of MSK in Eclipse.

Common Problems

The following sections gives help for some common problem and issues that may occur when importing the MMIG-StarterKit into Eclipse.

If you experience compilation errors, some of the following steps may help:

  • After importing, set the correct Android version: open the project's PropertiesAndroid, in the section Project Build Target select the Android version you target. If you reference other Android projects, ensure that they are correctly linked in the Library section; if in doubt, go through the steps to Remove, Apply, and re-Add... for the referenced projects.

  • Ensure that the correct Java compiler version is used: in the project's Properties → Java Compiler, set the Java compiler compliance level to 1.5 (5) or 1.6 (6).

  • For Android ADT version 22+: If you experience problems that classes cannot be found which should be available by referenced JAR libraries, go through the following steps:

    • ensure that all referenced libraries are located in the project folder /libs (or in a subfolder thereof)
    • open the project's Properties → Java Build Path
    • select the Libraries tab and ensure that all required JAR files are referenced (note that there is an entry Android Private Libraries which older ADT versions do not show)
    • Go to the Order and Export tab and check all boxes for the referenced JAR libraries (i.e. export them, see Figure 12)
  • If you remove or replace a JAR library in /libs, you should "physically" first remove the library, rebuild the project, and – in case of a replacement – then add the new library (and rebuild). Simply removing the library in the project's Properties → Java Build Path may not be enough to work (in this case you may experience some error messages containing something similar to Conversion to Dalvik format failed with error 1 in the LogCat output console).

Deploy to Simulator

  • Right click the project and select Run As →Android Application.
  • Eclipse will ask you to select an appropriate AVD. If there does not exist one, then you need to create it.

Deploy to Device

  • Make sure USB debugging is enabled on your device and plug it into your system (Settings → Applications → Development).
  • Right click the project and select Run As →Android Application.

Deployment for Web Site

  • Open assets/www/index.html in a web browser (see also Notes on compatibility below)
  • Alternatively, you can also host the contents of assets/www/ on a web server

Notes on Browser compatibility:

  • Google Chrome has additional restrictions for accessing local files. For Web Site Deployment as local file (i.e. directly opening /index.html in a browser) an additional command-line switch is required in order to allow the MMIR framework access to its local files: --allow-file-access-from-files Note, that
    • This command-line option will only work, if no other instances of Chrome are running, when starting the application with this switch
    • Afterwards, this command-line option applies to all (newly opened) instances of Chrome
    • This option should not be used, when browsing the Internet, but only for development purposes, since it may pose a security risk

Notes on support for speech interactions:

  • Currently, only Google Chrome (version 25.x.x) supports access to the microphone
    • To enable Chrome for accessing the microphone activate the Web Audio Input in chrome://flags/
    • On opening the index.html choose Accept for granting access to the microphone
  • MSK is setup to use the Google web service for speech recognition. This requires converting the audio stream from the microphone in WAV format to the FLAC format. TBD: a lightweight web service component will be released (e.g. to be run on a Tomcat server), that allows conversion from WAV to FLAC