This guide details the module creation process inside Appcelerator Studio. For more information on what methods and properties are available as part of the module API and specific platform notes, see the Android Module Development Guide and iOS Module Development Guide.
Preparing Appcelerator Studio for Module Creation
If you are going to be creating Android modules, you will need to install Java support inside Appcelerator Studio. See Installing the Java Development Tools for the brief steps if you have not already done so.
For Android Module Development
You will need to install the Android NDK. Download the appropriate .zip file from http://developer.android.com/sdk/ndk/index.html and extract it to some location on disk. Remember this location.
Creating a New Module
Creating a new module is accomplished by running through a wizard. Below summarizes the properties required, and a description of the values.
This is a read-only module id of your module that is generated when you created your project. You should not edit this value.
This is the version of your module. You should change this value each time you make major changes and distribute them. Version should be in the dotted notation (X.Y.Z) and must not con-tain any spaces or non-number characters.
This is a human-readable description of your module. It should be short and suitable for display next to your module name.
This is a human-readable author name you want to display next to your module. It can simply be your personal name or an organizational name such as "Appcelerator".
This is a human-readable name of your license. You should use a short description such as "Apache Public License" or "Commercial".
This is a human-readable copyright string for your module. For example, "Copyright (c) 2010 by Appcelerator, Inc."
Module Creation Steps
- Open File > New > Mobile Module Project.
- Choose a project name, a module ID, and a deployment target (native platform).
- Click Next.
- Fill out the remainder of the items on the next page.
- Click Finish.
Your module is created. Note the two different folder structures, depending on the platform.
Building/Packaging a Module
Choose Deploy > Package - iOS Module or Package - Android Module.
You may then choose to deploy the module for all projects, or for a specific project. This follows the installation rules as noted in Using Titanium Modules, though to summarize:
- For all projects: the module .zip file is dropped at the root of the the Titanium SDK installation location.
- For a particular project: The module .zip file is dropped at the root of your project.
Troubleshooting Build Errors
Your Android application project path contains spaces
You need to change your Studio workspace to not have spaces in the path. See the top of the page for information on how to do that.
Android.ndk property is not set
If you see this, you need to add android.ndk to the build.properties file. Set it to the path where you installed the NDK to begin with.
Using Your Module
Follow the instructions in Using Titanium Modules for more information.