API: The Module Manifest - ColoradoSchoolOfMines/interface_sdk GitHub Wiki
Related pages: Extending Modules
Each module needs a manifest.xml file so that it can be loaded. The manifest describes several elements about the module, from the title and author of the module to the sensor data that it depends upon.
The basic format for the module manifest is like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="edu.mines.acmX.samples.module"
class="Module"
icon="some_image.jpg"
title="some_title"
author="Kinect Exhibit Team"
version="1.2">
<uses-sdk
minSdkVersion="0.1.0"
targetSdkVersion="0.1.0"/>
<inputs>
<input optional="true" input-type="acceleration" />
<!-- without the optional, it will default to required -->
<input input-type="rgbimage" />
</inputs>
<requires-module>
<module package="edu.mines.acmX.some_other_game" />
<!-- By default, modules are required. To mark it as optional, add the optional tag -->
<module optional="true" package="edu.mines.acmX.another_game" />
</requires-module>
</manifest>
The root tag of the manifest. Has six attributes:
- package
- The name of the package that the module is identified by. Needs to be unique from all other modules. Uses reverse package naming, for example: com.example.test
- class
- The name of the class that extends a module (ProcessingModule, AWTModule, etc.). This class will be run first when the module is launched.
- icon
- The name of the image icon of the module.
- title
- The title of the visualization.
- author
- The author of the visualization.
- version
- The module version.
Declares what version sdk the module uses. Has two attributes:
- midSdkVersion
- The minimum sdk version that the module can safely use.
- targetSdkVersion
- The sdk version that the module would ideally like to use.
Contains all "input" tags that exist in the manifest. Has no attributes.
Defines a single input data dependency that the module wants to use. Has two attributes:
- optional
- A non-required attribute that defines whether this particular input is option or not. Can be set to "true" or "false". Without this tag, input default to optional="false".
- input-type
- Defines what sort of input data the module is expecting. See Hardware Manager manifest for supported input types
Defines what other modules this visualization depends upon. Contains all module tags that specify what modules are required, including "module" and "optional-all" tags. Has one optional attribute.
- optional-all
- A non required tag that allows this module to optionally depend upon all other modules in the module directory. Useful for launchers.
Defines a module dependency. Has two attributes:
- optional
- A non-required attribute that defines whether this particular module is optional or not. Can be set to "true" or "false". Without this tag, input default to optional="false".
- package
- The package name of the depended upon module