Visit the Titanium page on the PropertyCross website for screenshots and code sharing metrics.
The Titanium APIs provide an abstraction layer for the Android and iOS UI elements, allowing you to write your view code against the Titanium abstraction. Platform specific view concepts have not been abstracted and are available under their own namespaces.
Appcelerator Alloy is the official MVC for Titanium. It uses XML for views and CSS-like TSS for styles. Controllers use BackBone. Alloy compiles to a classic Titanium project before Titanium compiles to a native app. This way, the developer can take advantage of MVC without having to worry about adding any overhead.
Building the Application
To run this example you'll need to install Titanium Studio, and depending on your OS the Android SDK and XCode (OSX only).
Open Titatnium Studio, then select:
File, Import, General>Existing Projects into Workspace.
To run on a device, within the App Explorer tab select:
Run, Android Device/iOS Device.
\app- Alloy MVC
\app\controllers- Alloy controllers
\app\styles- Alloy controller styles
\app\styles\app.tss- Alloy global styles
\app\views- Alloy views
\app\models- Alloy models
\app\lib- Helper libraries
\app\lib\alloy\sync\nestoria.js- Custom Alloy sync adapter for Nestoria
\app\widgets- Alloy widgets
\app\assets\iphone- iPhone specific assets
\app\assets\android- Android specific assets
\platform\android- Android specific assets (stored under Android.R)
\plugins- Titanium plugins (hooking up Alloy)
\Resources- Where Alloy will compile to as classic project
\.settings- Titanium Studio metadata files
.project- Titanium Studio project file
manifest- Application manifest, used by the build process
tiapp.xml- Titanium application configuration.
*.png- Assets generated from
stats-config.json- Used by the PropertyCross build in order to compute code sharing metrics.
- Rewriting PropertyCross in Titanium Alloy - Fokke Zandbergen, who rewrote the Titanium PropertyCross implementation using Alloy MVC, shares his experiences.