Appcelerator Titanium Alloy

18
Alloy Powerful MVC from Appc

description

Appcelerator Titanium Alloy MVC Framework

Transcript of Appcelerator Titanium Alloy

Page 1: Appcelerator Titanium Alloy

Alloy

Powerful MVC from Appc

Page 2: Appcelerator Titanium Alloy

Ajenda

● What is Alloy● Why Alloy● How to work with Alloy● Examples● Questions

Page 3: Appcelerator Titanium Alloy

What Is Alloy?

● Alloy is built on Node.js, available on npm, and integrated with Titanium Studio

● Alloy is an open source MVC framework with the goal of making Titanium development easier, faster, and more scalable

Page 4: Appcelerator Titanium Alloy

Why Alloy?

● Scaffolding generation and advanced tooling

● Best Practices

● With Alloy, developers can build apps not only faster, but of higher quality, effortlessly leveraging features like compile time validation, advanced code generation, and reusable components.

Page 5: Appcelerator Titanium Alloy

Alloy Key Features

● UI and app logic separation through MVC framework

● Develop your apps using XML and JSON ● Reusable widgets and templates ● Built-in Backbone.js and Underscore.js

support ● Command Line interface

Page 6: Appcelerator Titanium Alloy

How to Start?

● Alloy Quickstart Guidehttp://projects.appcelerator.com/alloy/docs/Alloy-bootstrap/index.html

● Alloy Google Grouphttps://groups.google.com/forum/?fromgroups=#!forum/appc-ti-alloy

● Alloy on Githubhttps://github.com/appcelerator/alloy

Page 7: Appcelerator Titanium Alloy

Getting Start

Requirements● Ti SDK and Studio 2.1 or greater● Node.js 0.6.3 or greater● Support only on OSX 10.6 or greater(Windows and Linux Support Later)

Platform Support● Android - 2.2 (API8) or greater ● iPad - 4.2 or greater ● iPhone - 4.2 or greater ● Mobile Web

Page 8: Appcelerator Titanium Alloy

Install Alloy

Once Titanium and Node.js are installed then run the below command from the OSX terminal app to install Alloy

$sudo npm install alloy -g

Page 9: Appcelerator Titanium Alloy

Sample Project

Objectives

● Create Tab based App● Call XHR request● Display Results

Page 10: Appcelerator Titanium Alloy

New Alloy Project

● Create a new Titanium Mobile Project

● Using Terminal change to the directory where the newly created project lives

● To set up the project to use Alloy run $alloy new

Page 11: Appcelerator Titanium Alloy

Directory Structure

Page 12: Appcelerator Titanium Alloy

views - index.xml

Page 13: Appcelerator Titanium Alloy

styles - index.tss

Page 14: Appcelerator Titanium Alloy

controllers - index.js

Page 15: Appcelerator Titanium Alloy

Create Controller$alloy generate controller row

Above command will create following filesa. controllers/row.jsb. views/row.xmlc. styles/row.tss

Page 16: Appcelerator Titanium Alloy

Create Model$alloy generate model todo name:string

active:boolean

Above command will create following filesa. models/todo.jsb. models/todo.jsonc. migrations/201208061357439_todo.js

Page 17: Appcelerator Titanium Alloy

Code Walkthrough

Github Link: https://github.com/railskarthi/sample-alloy-app

Page 18: Appcelerator Titanium Alloy