Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Scaling Titanium Mobile (in Japanese)
Search
Junya Ogura
March 24, 2012
Programming
9
6.8k
Scaling Titanium Mobile (in Japanese)
at Android Bazaar and Conference 2012 Spring.
http://about.qnyp.com/
Junya Ogura
March 24, 2012
Tweet
Share
Other Decks in Programming
See All in Programming
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
400
shadcn/uiを使ってReactでの開発を加速させよう!
lef237
0
350
Immutable ActiveRecord
megane42
0
110
Vue.jsでiOSアプリを作る方法
hal_spidernight
0
110
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
1
450
『改訂新版 良いコード/悪いコードで学ぶ設計入門』活用方法−爆速でスキルアップする!効果的な学習アプローチ / effective-learning-of-good-code
minodriven
29
4.6k
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
800
令和7年版 あなたが使ってよいフロントエンド機能とは
mugi_uno
12
5.9k
2025.01.17_Sansan × DMM.swift
riofujimon
2
630
Linux && Docker 研修/Linux && Docker training
forrep
16
3k
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
0
120
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
410
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Fireside Chat
paigeccino
34
3.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
6
210
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
A Tale of Four Properties
chriscoyier
157
23k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Docker and Python
trallard
43
3.2k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
11
890
What's in a price? How to price your products and services
michaelherold
244
12k
Embracing the Ebb and Flow
colly
84
4.5k
Transcript
Scaling Titanium Mobile at Android Bazaar and Conference 2012 Spring
http://bit.ly/scale-ti Saturday, March 24, 12
͓͙Β͡ΎΜ @junya Saturday, March 24, 12
߹ಉձࣾΩϡχοϓ about.qnyp.com Saturday, March 24, 12
Scaling Saturday, March 24, 12
Scaling νʔϜ։ൃ ػೳͷՃɾআ ରԠσόΠεͷՃ Saturday, March 24, 12
Scaling νʔϜ։ൃ ػೳͷՃɾআ ରԠσόΠεͷՃ ^ Saturday, March 24, 12
Scaling Λ༰қʹ͢Δ ίʔυͷॻ͖ํ νʔϜ։ൃ ػೳͷՃɾআ ରԠσόΠεͷՃ ^ Saturday, March 24,
12
What’s Titanium Mobile ࠷ۙͷ5JUBOJVN.PCJMF ίʔυͷׂ underscore.js CoffeeScript ϓϥοτϑΥʔϜґଘίʔυͷӅณ ΧελϜΠϕϯτ Agenda
Saturday, March 24, 12
What’s Titanium Mobile? Saturday, March 24, 12
Titanium Mobile λΠλχϜɾϞόΠϧ Saturday, March 24, 12
by Appcelerator, Inc. Saturday, March 24, 12
from JavaScript Saturday, March 24, 12
from JavaScript to iOS Saturday, March 24, 12
from JavaScript to iOS to Android Saturday, March 24, 12
from JavaScript to iOS to Android It’s OpenSource! Saturday, March
24, 12
from JavaScript to iOS to Android It’s OpenSource! Community License
=> Free Saturday, March 24, 12
from JavaScript to iOS to Android It’s OpenSource! Community License
=> Free Indie License => $49/month Saturday, March 24, 12
։ൃڥ Mac OS X Windows Ubuntu Linux Saturday, March 24,
12
iOS 4.0.X - Android 2.2 (API 7) - Titanium Compatibility
Matrix - Documentation & Guides - Appcelerator Wiki https://wiki.appcelerator.org/display/guides/Titanium+Compatibility+Matrix ࠷৽൛ͷλʔήοτڥ Saturday, March 24, 12
Only Mac OS X iOS Saturday, March 24, 12
Code Example Saturday, March 24, 12
Saturday, March 24, 12
var win = Ti.UI.createWindow({ title: 'github/appcelerator' }); var tableView =
Ti.UI.createTableView(); win.add(tableView); var tabGroup = Ti.UI.createTabGroup(); var tab = Ti.UI.createTab({ icon: 'KS_nav_ui.png', title: 'Repos', window: win }); tabGroup.addTab(tab); tabGroup.setActiveTab(tab); tabGroup.open(); var xhr = Ti.Network.createHTTPClient(); var url = 'https://api.github.com/orgs/appcelerator/repos?type=public'; xhr.open('GET', url); xhr.onload = function() { var res = JSON.parse(this.responseText); tableView.setData(res.map(function(repo) { return Ti.UI.createTableViewRow({ title: repo.name }); }));; }; xhr.send(); Saturday, March 24, 12
var win = Ti.UI.createWindow({ title: 'github/appcelerator' }); var tableView =
Ti.UI.createTableView(); win.add(tableView); var tabGroup = Ti.UI.createTabGroup(); var tab = Ti.UI.createTab({ icon: 'KS_nav_ui.png', title: 'Repos', window: win }); tabGroup.addTab(tab); tabGroup.setActiveTab(tab); tabGroup.open(); var xhr = Ti.Network.createHTTPClient(); var url = 'https://api.github.com/orgs/appcelerator/repos?type=public'; xhr.open('GET', url); xhr.onload = function() { var res = JSON.parse(this.responseText); tableView.setData(res.map(function(repo) { return Ti.UI.createTableViewRow({ title: repo.name }); }));; }; xhr.send(); ߦ Saturday, March 24, 12
var win = Ti.UI.createWindow({ title: 'github/appcelerator' }); var tableView =
Ti.UI.createTableView(); win.add(tableView); var tabGroup = Ti.UI.createTabGroup(); var tab = Ti.UI.createTab({ icon: 'KS_nav_ui.png', title: 'Repos', window: win }); tabGroup.addTab(tab); tabGroup.setActiveTab(tab); tabGroup.open(); var xhr = Ti.Network.createHTTPClient(); var url = 'https://api.github.com/orgs/appcelerator/repos?type=public'; xhr.open('GET', url); xhr.onload = function() { var res = JSON.parse(this.responseText); tableView.setData(res.map(function(repo) { return Ti.UI.createTableViewRow({ title: repo.name }); }));; }; xhr.send(); ߦ Saturday, March 24, 12
var win = Ti.UI.createWindow({ title: 'github/appcelerator' }); var tableView =
Ti.UI.createTableView(); win.add(tableView); var tabGroup = Ti.UI.createTabGroup(); var tab = Ti.UI.createTab({ icon: 'KS_nav_ui.png', title: 'Repos', window: win }); tabGroup.addTab(tab); tabGroup.setActiveTab(tab); tabGroup.open(); var xhr = Ti.Network.createHTTPClient(); var url = 'https://api.github.com/orgs/appcelerator/repos?type=public'; xhr.open('GET', url); xhr.onload = function() { var res = JSON.parse(this.responseText); tableView.setData(res.map(function(repo) { return Ti.UI.createTableViewRow({ title: repo.name }); }));; }; xhr.send(); ߦ Saturday, March 24, 12
5JUBOJVN.PCJMFΞϓϦ Saturday, March 24, 12
MogSnap Zaim GetGlue Welcome to NIFTY-Serve Built with Appcelerator Titanium
/ http://www.builtwithtitanium.com/ Saturday, March 24, 12
Titanium Mobile ࠷ۙͷ Saturday, March 24, 12
Titanium Mobile SDK 1.8.2 Feb 29, 2012 Saturday, March 24,
12
ܥͷαʔϏεύοΫ ϝϞϦϦʔΫमਖ਼ Ϋϥογϡόάमਖ਼ ͳͲ http://developer.appcelerator.com/apidoc/mobile/1.8.2/changelog.html Saturday, March 24, 12
݄ʹ͕ϦϦʔε༧ఆ $PDPBpTIαʔϏεͱͷ౷߹ δΦϩέʔγϣϯػೳͷڧԽ 5BCMF7JFXͷύϑΥʔϚϯεվળ Ϟδϡʔϧ"1*ͷվྑ Saturday, March 24, 12
Scaling Λ༰қʹ͢Δ ίʔυͷॻ͖ํ νʔϜ։ൃ ػೳͷՃɾআ ରԠσόΠεͷՃ ^ Saturday, March 24,
12
Code Structure ίʔυͷׂ Saturday, March 24, 12
// app.js var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var
button = Ti.UI.createButton(); button.addEventListener(‘click’, function(e) { alert(‘Button Clicked’); }); win.add(button); win.open(); ؆୯ͳΞϓϦɻ Saturday, March 24, 12
// app.js var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var
button = Ti.UI.createButton(); button.addEventListener(‘click’, function(e) { alert(‘Button Clicked’); }); win.add(button); win.open(); Οϯυͷੜɻ Saturday, March 24, 12
// app.js var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var
button = Ti.UI.createButton(); button.addEventListener(‘click’, function(e) { alert(‘Button Clicked’); }); win.add(button); win.open(); ϘλϯͷੜͱΫϦοΫ࣌ͷॲཧઃఆɻ Saturday, March 24, 12
// app.js var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var
button = Ti.UI.createButton(); button.addEventListener(‘click’, function(e) { alert(‘Button Clicked’); }); win.add(button); win.open(); ΟϯυͷΦʔϓϯɻ Saturday, March 24, 12
ͭͷBQQKTͰɺ ͙͢ʹݟ௨͕͠ѱ͘ͳΔɻ Saturday, March 24, 12
νʔϜ։ൃͰۀࠔɻ Saturday, March 24, 12
ίʔυΛׂ͢Δख๏ɻ Saturday, March 24, 12
window.url Ti.include() CommonJS Saturday, March 24, 12
ख๏ʹΑͬͯɺ "OESPJEରԠ ςετͷ͢͠͞ อकੑ ͳͲʹେ͖͘Өڹ͢Δɻ Saturday, March 24, 12
window.url Saturday, March 24, 12
Οϯυੜ࣌ͷ VSMύϥϝʔλΛར༻ɻ Saturday, March 24, 12
// app.js var win = Ti.UI.createWindow({ backgroundColor: '#fff', url: 'window.js'
}); win.open(); // window.js var win = Ti.UI.currentWindow; var button = Ti.UI.createButton(); button.addEventListener(‘click’, function(e) { alert(‘Button Clicked’); }); win.add(button); Saturday, March 24, 12
XJOEPXVSMελΠϧɺ ݹ͍αϯϓϧίʔυɺϒϩάɺهࣄ ͳͲͰΘΕ͍ͯΔɻ Saturday, March 24, 12
ύϑΥʔϚϯεͷ͋Γɺ ݱࡏਪ͞Ε͍ͯͳ͍ͷͰ Θͳ͍͜ͱɻ Saturday, March 24, 12
window.url Ti.include() CommonJS Saturday, March 24, 12
Ti.include Saturday, March 24, 12
5JJODMVEFؔΛར༻ɻ Saturday, March 24, 12
// app.js var name = 'Foo'; var win = Ti.UI.createWindow({
backgroundColor: '#fff', name: name }); Ti.include('window.js'); win.open(); // window.js var label = Ti.UI.createLabel({text: win.name}); label.addEventListener('click', function(e) { alert(name + ' Clicked'); }); win.add(label); Saturday, March 24, 12
var name = 'Foo'; var win = Ti.UI.createWindow({ backgroundColor: '#fff',
name: name }); var label = Ti.UI.createLabel({text: win.name}); label.addEventListener('click', function(e) { alert(name + ' Clicked'); }); win.add(label); win.open(); ࣮ࡍʹͭͷϑΝΠϧʹ݁߹͞Ε࣮ͯߦ͞ΕΔɻ Saturday, March 24, 12
໊લͷিಥ͕ى͜Γ͍͢ɻ Saturday, March 24, 12
ݱࡏ5JJODMVEFඇਪͳͷͰ Θͳ͍͜ͱɻ Saturday, March 24, 12
window.url Ti.include() CommonJS Saturday, March 24, 12
CommonJS Saturday, March 24, 12
αʔόʔαΠυ+BWB4DSJQUʹ͓͚Δ ڞ௨༷$PNNPO+4ͷɺ Ϟδϡʔϧ༷Λ࠾༻ɻ Saturday, March 24, 12
ίʔυͷׂɾ࠶ར༻ͷख๏ͱͯ͠ ݱࡏɺ"QQDFMFSBUPS͕ਪɻ Saturday, March 24, 12
// app.js var name = 'Foo'; var window = require('window');
var win = window.myWindow(name); win.open(); alert('label = ' + label); // labelݟ͑ͳ͍ // window.js exports.myWindow = function(name) { var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var label = Ti.UI.createLabel({text: name}); label.addEventListener('click', function(e) { alert(name + ' Clicked'); }); win.add(label); return win; }; Saturday, March 24, 12
5JUBOJVN4UVEJPͰੜ͞ΕΔ ςϯϓϨʔτ$PNNPO+4ܗࣜɻ Saturday, March 24, 12
Saturday, March 24, 12
Saturday, March 24, 12
app.js ui/ApplicationWindow.js ui/FirstView.js Saturday, March 24, 12
function FirstView() { var self = Ti.UI.createView(); var label =
Ti.UI.createLabel({ color:'#000000', text:String.format(L('welcome'),'Titanium'), height:'auto', width:'auto' }); self.add(label); label.addEventListener('click', function(e) { alert(e.source.text); }); return self; } module.exports = FirstView; ui/FirstView.js Saturday, March 24, 12
function ApplicationWindow() { var FirstView = require('ui/FirstView'); var self =
Ti.UI.createWindow({ backgroundColor:'#ffffff', navBarHidden:true, exitOnClose:true }); var firstView = new FirstView(); self.add(firstView); return self; } module.exports = ApplicationWindow; ui/ApplicationWindow.js Saturday, March 24, 12
var ApplicationWindow = require('ui/ApplicationWindow'); new ApplicationWindow().open(); app.js Saturday, March 24,
12
ҙ ૬ରύεΛࢦఆͨ͠ࡍͷڍಈ͕ $PNNPO+4ͱҟͳΓɺ3FTPVSDFT ͔Βͷ૬ରࢦఆͱͯ͠ೝࣝ͞ΕΔɻ Saturday, March 24, 12
ύϑΥʔϚϯεͷ͕ͳ͍ɻ ϝϯςφϯεੑ͕ߴ͍ɻ ࠶ར༻͍͢͠ɻ ୯ମςετ͕ߦ͍͍͢ɻ Saturday, March 24, 12
var Window; if (globals.osname === 'ipad') { Window = require('ui/ipad/iPadWindow');
} else if (globals.osname === 'iphone') { Window = require('ui/iphone/iPhoneWindow'); } else { Window = require('ui/android/AndroidWindow'); } new Window().open(); σόΠεʹԠͨ͡6*ͷಡΈࠐΈɻ Saturday, March 24, 12
window.url Ti.include() CommonJS Saturday, March 24, 12
underscore.js Saturday, March 24, 12
ྻؔʹର͢Δૢ࡞Λ ༰қʹ͢ΔϥΠϒϥϦɻ Saturday, March 24, 12
+BWB4DSJQUͷ ϏϧτΠϯΦϒδΣΫτΛ ֦ு͠ͳ͍ɻ Saturday, March 24, 12
ؔϓϩάϥϛϯά༝དྷͷ ͷΛத৺ͱͨ͠΄Ͳͷؔɻ each, map, reduce, filter, reject, any, max, min,
shuffle, union, uniq, ... Saturday, March 24, 12
It’s CommonJS var _ = require('underscore')._; Saturday, March 24, 12
+40/Λ6*༻ͷσʔλʹܗɾมɻ var items = JSON.parse(responseText); var itemNames = _(items).chain() .uniq(false,
function(item) { return item.id; }) .select(function(item) { return item.available; }) .sortBy(function(item) { return item.name; }) .name(); Saturday, March 24, 12
+40/Λ6*༻ͷσʔλʹܗɾมɻ var items = JSON.parse(responseText); var itemNames = _(items).chain() .uniq(false,
function(item) { return item.id; }) .select(function(item) { return item.available; }) .sortBy(function(item) { return item.name; }) .name(); Saturday, March 24, 12
+40/Λ6*༻ͷσʔλʹܗɾมɻ var items = JSON.parse(responseText); var itemNames = _(items).chain() .uniq(false,
function(item) { return item.id; }) .select(function(item) { return item.available; }) .sortBy(function(item) { return item.name; }) .name(); Saturday, March 24, 12
+40/Λ6*༻ͷσʔλʹܗɾมɻ var items = JSON.parse(responseText); var itemNames = _(items).chain() .uniq(false,
function(item) { return item.id; }) .select(function(item) { return item.available; }) .sortBy(function(item) { return item.name; }) .name(); Saturday, March 24, 12
+40/Λ6*༻ͷσʔλʹܗɾมɻ var items = JSON.parse(responseText); var itemNames = _(items).chain() .uniq(false,
function(item) { return item.id; }) .select(function(item) { return item.available; }) .sortBy(function(item) { return item.name; }) .name(); Saturday, March 24, 12
+40/Λ6*༻ͷσʔλʹܗɾมɻ var items = JSON.parse(responseText); var itemNames = _(items).chain() .uniq(false,
function(item) { return item.id; }) .select(function(item) { return item.available; }) .sortBy(function(item) { return item.name; }) .name(); Saturday, March 24, 12
CoffeeScript Saturday, March 24, 12
+BWB4DSJQUʹൺͯ ίʔυͷهड़ྔΛݮͰ͖Δɻ Saturday, March 24, 12
όάɺέΞϨεϛεͷݮɻ Saturday, March 24, 12
ύϥϝʔλهड़͕؆ܿʹɻ // JavaScript var win = Ti.UI.createWindow({ title: 'github' });
var tab = Ti.UI.createTab({ icon: 'KS_nav_ui.png', title: 'Repos', window: win }); # CoffeeScript win = Ti.UI.createWindow(title: 'github') tab = Ti.UI.createTab icon: 'KS_nav_ui.png' title: 'Repos' window: win Saturday, March 24, 12
ίʔϧόοΫهड़͕؆ܿʹɻ // JavaScript button.addEventListener('click', function(e) { Ti.API.debug('button clicked'); }); #
CoffeeScript button.addEventListener 'click', (e) -> Ti.API.debug('button clicked') Saturday, March 24, 12
ϧʔϓ͕γϯϓϧʹɻ // JavaScript var rows = []; for (var i
= 0; i < items.length; i++) { var item = items[i]; if (item.isPublic()) rows.push(createTableRow(items[i])); } var tableView = Ti.UI.createTableView({ data: rows }); # CoffeeScript rows = [] for item in items when item.public() rows.push(createTableRow(item)) tableView = Ti.UI.createTableView(data: rows) Saturday, March 24, 12
ޙஔJGͰϓϥοτϑΥʔϜຖͷ ߹͚Λγϯϓϧʹɻ # CoffeeScript Ti.UI.iPhone.appBadge = 10 if Ti.Platform.osname is
“iphone” # JavaScript if (Ti.Platform.osname === “iphone”) { Ti.UI.iPhone.appBadge = 10; } Saturday, March 24, 12
Ϋϥεϕʔεʹઃܭ͍͢͠ɻ # CustomView.coffee class CustomView view: null constructor: -> @initView()
@initEvents() initView: -> @view = Ti.UI.createView() initEvents: -> @view.addEventListener 'click', (e) -> alert('clicked') module.exports = CustomView # app.coffee CustomView = require('CustomView') view = new CustomView() Saturday, March 24, 12
จࣈྻͰมల։͕Ͱ͖Δɻ name = "Titanium" alert("Hello, #{name}") Saturday, March 24, 12
Auto Compile with Guard $ brew install nodejs $ curl
http://npmjs.org/install.sh | sh $ npm install -g coffee-script $ gem install guard-coffeescript $ gem install rb-fsevent # Guardfile guard 'coffeescript', :input => 'coffee', :output => 'Resources', :bare => true $ guard Saturday, March 24, 12
Facade ϓϥοτϑΥʔϜ ґଘίʔυͷӅณ Saturday, March 24, 12
J04ͱ"OESPJEͰ߹͚͢Δίʔυɻ if (Ti.Platform.osname === "android") { var picker1 = Ti.UI.createPicker({type:Ti.UI.PICKER_TYPE_DATE});
var picker2 = Ti.UI.createPicker({type:Ti.UI.PICKER_TYPE_TIME}); picker1.addEventListener('change', callback); picker2.addEventListener('change', callback); win.add(picker); win.add(picker2); } else { var picker = Ti.UI.createPicker({ type:Ti.UI.PICKER_TYPE_DATE_AND_TIME }); picker.addEventListener('change', callback); win.add(picker); } Saturday, March 24, 12
ذॲཧΛϥοϓͯ͠Ӆณɻ var calendarWindow = function(callback) { var win = Ti.UI.createWindow();
if (Ti.Platform.osname === "android") { var picker1 = Ti.UI.createPicker({type:Ti.UI.PICKER_TYPE_DATE}); var picker2 = Ti.UI.createPicker({type:Ti.UI.PICKER_TYPE_TIME}); picker1.addEventListener('change', callback); picker2.addEventListener('change', callback); win.add(picker1); win.add(picker2); } else { var picker = Ti.UI.createPicker({ type:Ti.UI.PICKER_TYPE_DATE_AND_TIME }); picker.addEventListener('change', callback); win.add(picker); } return win; }; Saturday, March 24, 12
ذॲཧΛϥοϓͯ͠Ӆณɻ var win = calendarWindow(function(e) { ... }); Saturday, March
24, 12
ϞδϡʔϧԽͯ͠࠶ར༻ɻ // utils.js exports.createCalendarWindow = function(callback) { ... }; //
app.js var utils = require('/utils'); var win = utils.createCalendarWindow(function(e) { ... }); Saturday, March 24, 12
Custom Event ΧελϜΠϕϯτ Saturday, March 24, 12
Πϕϯτ Saturday, March 24, 12
button.addEventListener(‘click’, function (e) {...}); window.addEventListener(‘focus’, function (e) {...}); 6*ΟδΣοτͷૢ࡞ʹͬͯൃੜ͢Δͷɺ Saturday,
March 24, 12
ͱݶΒͳ͍ɻ Saturday, March 24, 12
ΞϓϦίϯϙʔωϯτͷ ࿈ܞʹΠϕϯτΛ׆༻͢Δɻ Saturday, March 24, 12
Application Level Events Saturday, March 24, 12
ΞϓϦέʔγϣϯϨϕϧΠϕϯτ ΞϓϦέʔγϣϯͰάϩʔόϧʹ༗ޮɻ ར༻ʹ5J"QQϞδϡʔϧΛ͏ɻ ͯ͢ͷίϯςΩετɺؔείʔϓɺ $PNNPO+4Ϟδϡʔϧ͔ΒࢀরͰ͖Δɻ Saturday, March 24, 12
Ti.App.addEventListener('settingsUpdated', function(params) { alert('New value: ' + params.newValue); }); Ti.App.fireEvent('settingsUpdated',
{ newValue: '...' }); ϋϯυϥͷઃఆͱΠϕϯτͷൃੜ Saturday, March 24, 12
ίϯϙʔωϯτಉ͕࢜ϝιουΛݺͼ߹͏ͱɺ Τϥʔॲཧ͕ࢄ͢Δɻ // ϝϞ࡞ addButton.addEventListener('click', function(e) { if (dataManager.insertMemo(newMemo)) {
memoList.append(newMemo); } else { alert('error!'); } }); Saturday, March 24, 12
ΠϕϯτͷΓऔΓͰૄ݁߹ʹɻ ϝϞ࡞ Ti.App dataManager memoList Saturday, March 24, 12
ΠϕϯτͷΓऔΓͰૄ݁߹ʹɻ ϝϞ࡞ fire memoWillCreate Ti.App dataManager memoList Saturday, March 24,
12
ΠϕϯτͷΓऔΓͰૄ݁߹ʹɻ ϝϞ࡞ fire memoWillCreate Ti.App dataManager memoList memoWillCreate Saturday, March
24, 12
ΠϕϯτͷΓऔΓͰૄ݁߹ʹɻ ϝϞ࡞ fire memoWillCreate Ti.App dataManager memoList memoWillCreate fire memoDidCreated
Saturday, March 24, 12
ΠϕϯτͷΓऔΓͰૄ݁߹ʹɻ ϝϞ࡞ fire memoWillCreate Ti.App dataManager memoList memoWillCreate fire memoDidCreated
memoDidCreated Saturday, March 24, 12
Τϥʔ࣌ΠϕϯτΛൃੜͤ͞ͳ͍ɻ ϝϞ࡞ fire memoWillCreate Ti.App dataManager memoList memoWillCreate fire memoDidCreated
ʷ Saturday, March 24, 12
// ϝϞ࡞ addButton.addEventListener('click', function(e) { Ti.App.fireEvent('memoWillCreate', { id: memo.id, title:
memo.id, body: memo.body }); }); ϝϞ࡞ͷࡍʹɺσʔλอଘϝϞҰཡͷߋ৽ʹؔ༩͠ͳ͍ɻ Saturday, March 24, 12
// dataManager Ti.App.addEventListener('memoWillCreate', function(memo) { if (insertMemo(memo)) { Ti.App.fireEvent('memoDidCreated', memo);
} else { // Τϥʔॲཧ } }); σʔλอଘࣦഊ࣌ʹ࣍ͷΠϕϯτΛൃੜͤ͞ͳ͍ɻ Saturday, March 24, 12
// memoList Ti.App.addEventListener('memoDidCreated', function(memo) { updateMemoList(memo); }); ϝϞҰཡͷߋ৽ॲཧΠϕϯτͷൃੜ͚ͩΛ͍ͬͯΕΑ͍ɻ Saturday, March
24, 12
ҙ ΞϓϦέʔγϣϯϨϕϧͷΠϕϯτϋϯυϥ Ͱੜͨ͠ΦϒδΣΫτɺϋϯυϥΛ໌ࣔత ʹআ͢Δ·ͰϝϞϦʹΔɻ Managing Memory and Finding Leaks -
Documentation & Guides https://wiki.appcelerator.org/display/guides/Managing+Memory+and+Finding+Leaks Saturday, March 24, 12
var doSomething = function() { var foo = new Foo();
// ϋϯυϥΛআ͢Δ·ͰΓଓ͚Δ }; Ti.App.addEventListener(‘doSomething’, doSomething); // ෆཁʹͳͬͨλΠϛϯάͰϋϯυϥΛআ͢Δ Ti.App.removeEventListener(‘doSomething’, doSomething); Saturday, March 24, 12
var win = Ti.UI.createWindow(); win.addEventListener('userLoggedIn', function(user) { updateAvatar(user.avatar); }); win.open();
var button = Ti.UI.createButton(); button.addEventListener(‘click’, function(e) { win.fireEvent(‘userLoggedIn’, { avatar: ‘...’ }); }); άϩʔόϧͳείʔϓ͕ෆཁͳΒɺ ϏϡʔΦϒδΣΫτʹΧελϜΠϕϯτΛઃఆ͢Δ͜ͱՄೳɻ Saturday, March 24, 12
Summary ·ͱΊ Saturday, March 24, 12
Scaling Λ༰қʹ͢Δ ίʔυͷॻ͖ํ νʔϜ։ൃ ػೳͷՃɾআ ରԠσόΠεͷՃ ^ Saturday, March 24,
12
What’s Titanium Mobile ࠷ۙͷ5JUBOJVN.PCJMF ίʔυͷׂ underscore.js CoffeeScript ϓϥοτϑΥʔϜґଘίʔυͷӅณ ΧελϜΠϕϯτ Agenda
Saturday, March 24, 12
ίʔυͷׂৗʹ$PNNPO+4ελΠϧɻ ϞδϡʔϧԽͰۀ͕༰қʹɻ ϓϩδΣΫτؒͰͷίʔυ࠶ར༻Λଅਐɻ CommonJS Saturday, March 24, 12
underscore.js ྻؔʹର͢Δૢ࡞Λ؆ܿʹهड़ɻ νʔϜͰͷྻૢ࡞ελΠϧΛ౷Ұɻ Saturday, March 24, 12
ͳίʔυͷݮɻ +BWB4DSJQUͷྑ͍෦͚ͩΛར༻ɻ νʔϜͰ+BWB4DSJQUͷίʔυ࣭Λ౷Ұɻ CoffeeScript Saturday, March 24, 12
J04"OESPJEఆͷίʔυͰ͖Δ͚ͩӅณɻ ؔϞδϡʔϧʹӅ͢ɻ ࠶ར༻Ͱ͖ΔϊϋΛੵɻ ঢ়گ͕มΘͬͨࡍͷରԠΛ༰қʹɻ ϓϥοτϑΥʔϜґଘίʔυͷӅณ Saturday, March 24, 12
ίϯϙʔωϯτؒͷ௨৴Ͱ͖Δ͚ͩΠϕϯτͰɻ ΤϥʔॲཧΛूɻ γϯϓϧͳॲཧϑϩʔɻ ΧελϜΠϕϯτ Saturday, March 24, 12
Thanks. @junya http://bit.ly/scale-ti Saturday, March 24, 12