aplicações móveis multi-plataforma com titanium - geek night
TRANSCRIPT
![Page 1: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/1.jpg)
Aplicações móveis multi-plataforma com
Titanium Mobile
![Page 2: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/2.jpg)
var palestrante;
palestrante = { nome : 'Eric Cavalcanti', empresa : 'CESAR', titulação : 'Mestre em Eng. de Software', certificação : 'TCAD', titan : true,contato : '[email protected]',twitter : '@ericoc',linkedin : 'https://goo.gl/jT5ioX',slideshare : 'http://slideshare.net/ericoc'
}
![Page 3: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/3.jpg)
Apoiada pela Storm Ventures, Sierra Ventures e eBay. Appcelerator Inc. foi fundada em 2007 por especialista em desenvolvimento
web.
![Page 4: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/4.jpg)
O que é Titanium Mobile?
Aplicações Móveis Nativas
JavaScript
Licença Apache
![Page 5: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/5.jpg)
LicençaSDK - open source
Licença Apache 2.0
![Page 6: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/6.jpg)
Licença
![Page 7: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/7.jpg)
Appcelerator Platform
Mobile Test Automation Arrow BuilderArrow CloudPush NotificationsMobile Lifecycle DashboardBusiness InsightsPerformance & Crash Analytics
![Page 8: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/8.jpg)
OSS Versionhttps://github.com/m1ga/titanium_with_atom
![Page 9: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/9.jpg)
Quem usa?
... e mais
![Page 10: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/10.jpg)
Plataformas suportadas
![Page 11: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/11.jpg)
Tipos de aplicações
NativaMobile Web Híbrida
![Page 12: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/12.jpg)
Mobile Web
![Page 13: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/13.jpg)
Mobile Web
CSS3 JavaScript
Geolocalização Câmera Banco de dados{
![Page 14: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/14.jpg)
Mobile Web
![Page 15: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/15.jpg)
Mobile Web
![Page 16: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/16.jpg)
Mobile Web
![Page 17: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/17.jpg)
Híbrida
Porção nativa da aplicação
Browser (WebView)
HTMLCSS
JavaScript
UI
chamadas da API Nativa
Geolocalização Câmera Banco de dados Contatos Bússola Notificações Microfone Sistemas de arquivos
{Mobile JavaScript API
![Page 18: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/18.jpg)
Híbrida
Porção nativa da aplicação
Browser (WebView)
HTMLCSS
JavaScript
UI
Mobile JavaScript API
.ipa .apk .xap
![Page 19: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/19.jpg)
Híbrida
Porção nativa da aplicação
Browser (WebView)
HTMLCSS
JavaScript
UI
.ipa .apk .xap
Mobile JavaScript API
![Page 20: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/20.jpg)
Híbrida
![Page 21: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/21.jpg)
Híbrida
![Page 22: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/22.jpg)
Nativa
Java / Groovy
Objective-C / Swift
C# / VB.NET
.ipa .apk .xap
![Page 23: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/23.jpg)
Nativa
Java / Groovy
Objective-C / Swift
C# / VB.NET
.ipa .apk .xap
![Page 24: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/24.jpg)
Nativa
![Page 25: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/25.jpg)
E o Titanium Mobile?
HíbridaMobile Web Nativa
![Page 26: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/26.jpg)
E o Titanium Mobile?
Nativa
?
![Page 27: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/27.jpg)
Como funciona?
JavaScript runtime (JavaScriptCore, V8)
Application code - JavaScript
Native-JavaScript Bridge
Titanium API - Custom Modules
Native APIs
iOS, Android e Windows Phone
![Page 28: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/28.jpg)
Exemplo
Bridge (JavaScript - Nativo)
Titanium JavaScript API
UIButton Class
var btn = Ti.UI.createButton();
![Page 29: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/29.jpg)
BridgeJS - Nativo
JavaScript +
Assets +
InterpretadorJS
Titanium Mobile
.ipa .apk .xap
![Page 30: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/30.jpg)
BridgeJS - Nativo
JavaScript +
Assets +
InterpretadorJS
Titanium Mobile
.ipa .apk .xap
![Page 31: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/31.jpg)
Soluções similares
![Page 32: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/32.jpg)
Por que nativa?
O usuário já está acostumado em utilizar aplicações nativas em seu dispositivo
UI nativa tem melhor performance
Aumentamos consideravelmente a probabilidade de aprovação por lojas mais criteriosas
![Page 33: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/33.jpg)
Plataforma Android
![Page 34: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/34.jpg)
Plataforma iOS
![Page 35: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/35.jpg)
Por que nativa com Titanium?
Não estamos limitados a uma plataforma específica
1
Suporte para as maiores plataformas
(iOS, Android, Mobile Web, Windows)
![Page 36: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/36.jpg)
Por que nativa com Titanium?
Reduz o tempo gasto aprendendo diversas linguagens
2
Conhecimento facilmente transferido
![Page 37: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/37.jpg)
Por que nativa com Titanium?
Código base único
3
Reduz duplicação de esforço
![Page 38: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/38.jpg)
código nativoiOS
// Objective-C
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"Hello World" delegate:nil cancelButtonTitle:@"OK"otherButtonTitles:nil];
[alert show];
![Page 39: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/39.jpg)
código nativoiOS
// Swift
let alertView = UIAlertController(title: "Alert", message: "Hello World", preferredStyle: UIAlertControllerStyle.Alert)
alertView.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: nil))
presentViewController(alertView, animated: true, completion: nil)
![Page 40: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/40.jpg)
código nativoAndroid
// Java/Android
AlertDialog.Builder alertDialog = new AlertDialog.Builder(this).create();alertDialog.setMessage("Hello World");alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) { // Fazer alguma coisa }
});
alertDialog.show();;
![Page 41: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/41.jpg)
Com o Titanium
alert("Hello World");
...e multi-plataforma!
![Page 42: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/42.jpg)
Windows Phone
MessageBox.Show(“Hello World”);
![Page 43: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/43.jpg)
Showcase
http://www.appcelerator.com/customers/app-showcase/
![Page 44: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/44.jpg)
NBC iOS
![Page 45: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/45.jpg)
Scoutmob iOS e Android
![Page 46: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/46.jpg)
ZIP CAR IOS e Android
![Page 47: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/47.jpg)
Wotchapp! iOS e Android
![Page 48: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/48.jpg)
VIBEZONE iOS e Android
![Page 49: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/49.jpg)
gamestop iOS e Android
![Page 50: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/50.jpg)
Snowciety Social ski tracker
iOS e Android
![Page 51: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/51.jpg)
Carddi iOS e Android
![Page 52: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/52.jpg)
PiniOn iOS e Android
![Page 53: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/53.jpg)
PiniOn iOS e Android
![Page 54: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/54.jpg)
Curta Nordeste iOS e Android
![Page 55: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/55.jpg)
Cia Athletica iOS e Android
![Page 56: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/56.jpg)
Pré-requisitos
Mac OS X 10.9.4 (Mavericks) ou superior
Windows 7 ou superior (Windows Phone necessita da versão 8.X)
Ubuntu Linux 12.04 LTS
iOS SDK
Android SDK
Windows Phone 8 SDK
![Page 57: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/57.jpg)
Appcelerator Studio e SDKs
Appcelerator Studio é uma IDE baseada no eclipse que interage com vários scripts contidos no Titanium SDK
Os scripts interagem com as ferramentas nativas de cada plataforma
![Page 58: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/58.jpg)
Open Mobile Marketplace
http://marketplace.appcelerator.com
![Page 59: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/59.jpg)
Tipos de Projeto
![Page 60: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/60.jpg)
Titanium Classic
Interface definida via código
CommonJS Modules
![Page 61: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/61.jpg)
Classic
![Page 62: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/62.jpg)
Executando código específico para uma
plataforma (CLASSIC)
if (Ti.Platform.osname == "android") {...
} else {...
}
[android, iphone, ipad, mobileweb, windows]
![Page 63: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/63.jpg)
Titanium Alloy
UI declarativa (XML)
Framework MVC
Widgets
Themes
![Page 64: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/64.jpg)
Alloy App
index.xml index.tss
index.js
$.index.open();
![Page 65: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/65.jpg)
Estrutura do Projeto
![Page 66: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/66.jpg)
Estrutura do Projeto
![Page 67: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/67.jpg)
Estrutura do Projeto
![Page 68: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/68.jpg)
Estrutura do Projeto
![Page 69: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/69.jpg)
Estrutura do Projeto
![Page 70: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/70.jpg)
Alloy
![Page 71: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/71.jpg)
Executando código específico para uma
plataforma (ALLOY)
if (OS_ANDROID) {...
} else {...
}
[OS_IOS, OS_ANDROID, OS_MOBILEWEB, ENV_DEV, ENV_TEST, ENV_PRODUCTION]
![Page 72: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/72.jpg)
UI específico para uma
plataforma (ALLOY)
<Alloy> <Window> <View ns="Ti.Map" id="mapview"> <Annotation title="Cupertino" platform='ios' formFactor='tablet' latitude='37.3231' longitude='-122.0311'/> <Annotation title="Redwood City" platform='ios' formFactor='handheld' latitude='37.4853' longitude='-122.2353'/> <Annotation title="Mountain View" platform='android' latitude='37.3861' longitude='-122.0828'/> <Annotation title="Palo Alto" platform='android,ios,mobileweb' latitude='37.4419' longitude='-122.1419'/> <Annotation title="San Francisco" platform='mobileweb' latitude='37.7750' longitude='-122.4183'/> </View> </Window></Alloy>
![Page 73: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/73.jpg)
[android, ios, mobileweb, windows]
<Alloy> <Window> <View ns="Ti.Map" id="mapview"> <Annotation title="Cupertino" platform='ios' formFactor='tablet' latitude='37.3231' longitude='-122.0311'/> <Annotation title="Redwood City" platform='ios' formFactor='handheld' latitude='37.4853' longitude='-122.2353'/> <Annotation title="Mountain View" platform='android' latitude='37.3861' longitude='-122.0828'/> <Annotation title="Palo Alto" platform='android,ios,mobileweb' latitude='37.4419' longitude='-122.1419'/> <Annotation title="San Francisco" platform='mobileweb' latitude='37.7750' longitude='-122.4183'/> </View> </Window></Alloy>
[tablet, handheld]
UI específico para uma
plataforma (ALLOY)
![Page 74: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/74.jpg)
ALLOY TSS Platform-Specific styles
// iPhone"Label[platform=ios formFactor=handheld]": { backgroundColor: "#f00", text: 'iPhone'},// iPad and iPad mini"Label[platform=ios formFactor=tablet]": { backgroundColor: "#0f0", text: 'iPad'},// Android handheld and tablet devices"Label[platform=android]": { backgroundColor: "#00f", text: 'Android'},// Any Mobile Web platform"Label[platform=mobileweb]": { backgroundColor: "#f0f", text: 'Mobile Web'}
![Page 75: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/75.jpg)
Alloy Temas• app
◦ assets■ appicon.png■ background.png
◦ controllers◦ styles
■ index.tss■ window.tss
◦ themes■ mytheme
■ assets■ background.png
■ styles■ app.tss
◦ views■ index.xml■ window.xml
![Page 76: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/76.jpg)
Backbone no alloy
Models
Mantém o controle dos seus dados
Collections
Gerencia listas/array desses seus
dados
Sync/Adapters
SQLite, Properties, REST, ACS, CouchDB...
![Page 77: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/77.jpg)
Alloy Models
exports.definition = { config: { "columns": { "title": "String", "author": "String" }, "adapter": { "type": "sql", "collection_name": "books"
}},extendModel: function(Model) {
_.extend(Model.prototype, {// extended override or implement Backbone.Model
});return Model;
},extendCollection: function(Collection) {
_.extend(Collection.prototype, {// extended override or implement Backbone.Collection
});return Collection;
}}
![Page 78: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/78.jpg)
var book = Alloy.createModel('book', {title:'A Game of Thrones', author:'George R.R. Martins'});
book.save();
Instanciando o Model
![Page 79: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/79.jpg)
var library = Alloy.createCollection('book'); library.fetch(); // Grab data from persistent storage
Instanciando a Collection
![Page 80: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/80.jpg)
Alloy Widgets
![Page 81: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/81.jpg)
Demo
![Page 82: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/82.jpg)
App Designer (beta)
![Page 83: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/83.jpg)
Quero saber mais?
![Page 85: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/85.jpg)
sample apps
![Page 90: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/90.jpg)
Community Questions & Answers
https://community.appcelerator.com/
![Page 91: Aplicações móveis multi-plataforma com Titanium - Geek Night](https://reader033.vdocuments.mx/reader033/viewer/2022042723/58e991261a28ab287d8b4eb7/html5/thumbnails/91.jpg)
Obrigado!
CODE STRONG!