For more simple usage examples of Alloy, go to the alloy/test/app directory on the Alloy GitHub project.
To use the sample applications from the GitHub project, first clone the project:
git clone https://github.com/appcelerator/alloy
Using Titanium Studio:
- Create a new Alloy project.
- Select File > Import.
- Select General > File System and click the Next button. The Import dialog appears.
- Click the first Browse button (From directory), then navigate to a test application in the cloned Alloy project and click the Open button. For example, if you want to import the Master-Detail application, select
- Select all folder and files, that is, make sure they are all checkmarked.
- Click the second Browse button (Into folder), then navigate to your project's app directory and click the OK button.
- Click the Finish button. The sample application is imported in your project and you can run it.
Using the Titanium CLI, run the following commands:
ti create --name ProjectName cd ProjectName alloy new cp -r <path_to_alloy_git_repo>/test/apps/<path_to_app>/* . ti build
Review Alloy Concepts to learn more about Alloy and how to structure your project. From there, visit the links on Alloy Views, Alloy Controllers, and Alloy Models to learn how to write views, controllers and models, respectively.