Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: fixed broken link and headings

...

This guide provides basic instructions on creating a quick Alloy project.  Alloy is an MVC framework to help you quickly build Titanium applications.

Command-

...

line interface installation

To create and manage Alloy applications, you need the Alloy command-line interface.  If you already installed Appcelerator Studio or the Appcelerator CLI, the Alloy CLI will be automatically installed for you.  If you need to install Appcelerator Studio, see the Titanium SDK Quick Start or if you need to manually install the Appcelerator CLI:

  1. Download and install Node.js from http://nodejs.org/#download, which includes the npm package manager needed to install the Appcelerator CLI.
  2. From a terminal, run the following command to install the CLI: 

    Code Block
    [sudo] npm install appcelerator -g
  3. After installation, run the setup command to install required components: 

    Code Block
    appc setup

    After the CLI downloads and installs the required components, you will be prompted to login and authorize your computer.  The CLI will ask to send an authorization token to your e-mail account or as a text to your mobile phone.  Enter the authorization token once you receive it to complete the registration process.

Create a

...

project

Using Studio

To create a new Alloy project, start Appcelerator Studio, then

...

A new skeleton Alloy project will be generated in the directory named after the application name.

Simple

...

example

The following example converts the image_view_file.js file from the Titanium KitchenSink sample application to an Alloy project.

...

Create a folder called app/assets/images and copy the apple_logo.jpg file from the KitchenSink project. This file will be copied to Resources/images/apple_logo.jpg by Alloy during the build process.

Compile and

...

run

The Alloy CLI converts the view, style and controller in to a Titanium project, which can be built and ran by Studio or the Appcelerator CLI.

Using Studio

In the Project Explorer view, select your project, then from the global tool bar, select Run from the Launch Mode drop-down and select the device to launch the application on in the Target drop-down. Alloy will generate the Titanium files from the Alloy project files, which will then be compiled by Studio and launched on the device simulator.

Using the CLI

From a console window, go to the root directory of the project, then

...

Refer to the Appcelerator Command-Line Interface Reference for more information about using the appc run command.

More

...

examples

For more examples of Alloy, see see Alloy Samples.

Next

...

steps

Review Alloy Concepts to learn more about Alloy and how to structure your project.  From there, visit the links on Alloy ViewsAlloy Controllers, and Alloy Models to learn how to write views, controllers and models, respectively.

...