Would you like to contribute to the Titanium docs? To get started, sign up for an account on the Appcelerator Wiki and sign our CLA.

Skip to end of metadata
Go to start of metadata
Chapters

Once you've found a module you wish to use in your mobile project, you'll need to install it such that you can use it inside Studio.

Finding Modules

Go to http://marketplace.appcelerator.com to find the most complete list of available modules.

Downloading Modules

Once you have selected and purchased the modules you are interested in using, you'll need to download them.

  1. In marketplace.appcelerator.com, click on My Products.
  2. Click on the module you wish to download. It should download a .zip file to your computer. You may need to click on the little gear icon to find the download link the first time you download a module.
  3. Locate the .zip file on disk.

Installing Modules

Modules can be installed one of two ways--per-project, or globally.

Per-Project Installation

  1. Open Studio.
  2. Expand the project folder in the Project Explorer view.
  3. Drag the .zip file from the download location into the current project, placing it at the root of the project. Choose to "Copy Files".

Global Installation

  1. Locate your Titanium SDK installation location. For help, see Installing Titanium SDK Continuous Builds for the default location of the SDK folder.
  2. Drag the .zip file under the /Titanium folder. As an example, on OS X, the path might look like "/Library/Application Support/Titanium/module.zip".
Icon

On OS X Lion, the Titanium SDK folder may be hidden. Use Shift+Command+G in the Finder to open a dialog allowing you to navigate to the folder directly

Using Your Module

To use your module in a mobile app, follow these steps:

Using the tiapp.xml Editor

Studio has a module section inside the tiapp.xml editor to greatly simplify the usage of modules. In order to use the module editor:

  1. Double-click on the tiapp.xml file
  2. In the right-hand column, click the + to add a new module. It will show you a list of modules available in your global directory and in your project.
  3. Once you've added a module, clicking the pencil (edit) icon allows you to switch versions if there are multiple version available.
  4. If you wish to delete a module, click the x (delete) button to delete the module.

Switching a SDK will re-validate the modules based on their compatibility with the selected SDK. If they are not compatible, they will show warnings as appropriate, allowing you to update as appropriate.

Manually

  1. Open the module's .zip file, and look at the folder structure. The path will look like the following:

    • Folder Structure: modules/platform/moduleid/version
    • Example: modules/iphone/ti.greystripe/1.1
  2. Open Studio, and the tiapp.xml file for the project in question.
  3. Switch to the tiapp.xml tab.
  4. In the application's tiapp.xml, find the <modules/> node, and replace it with the new <modules> content. If you already have modules, just add a new node for the new module. Note that the "version" and "platform" attributes are optional. When "version" is not specified, the latest version of the module will be used (as of Titanium SDK 2.0.0), and the "platform" tag is only necessary when using a module that is not available on both platforms.

  5. Use the require function to load the module in the app's code, for example:

  6. The next time the app is launched or built, the module should be included with the application.
  • No labels