Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scaling Titanium Mobile (in Japanese)

Scaling Titanium Mobile (in Japanese)

at Android Bazaar and Conference 2012 Spring.
http://about.qnyp.com/

17e5fbc8b55218df51701c73e37103dd?s=128

Junya Ogura

March 24, 2012
Tweet

Transcript

  1. Scaling Titanium Mobile at Android Bazaar and Conference 2012 Spring

    http://bit.ly/scale-ti Saturday, March 24, 12
  2. ͓͙Β͡ΎΜ΍ @junya Saturday, March 24, 12

  3. ߹ಉձࣾΩϡχοϓ about.qnyp.com Saturday, March 24, 12

  4. Scaling Saturday, March 24, 12

  5. Scaling νʔϜ։ൃ ػೳͷ௥Ճɾ࡟আ ରԠσόΠεͷ௥Ճ Saturday, March 24, 12

  6. Scaling νʔϜ։ൃ ػೳͷ௥Ճɾ࡟আ ରԠσόΠεͷ௥Ճ ^ Saturday, March 24, 12

  7. Scaling Λ༰қʹ͢Δ ίʔυͷॻ͖ํ νʔϜ։ൃ ػೳͷ௥Ճɾ࡟আ ରԠσόΠεͷ௥Ճ ^ Saturday, March 24,

    12
  8. What’s Titanium Mobile ࠷ۙͷ5JUBOJVN.PCJMF ίʔυͷ෼ׂ underscore.js CoffeeScript ϓϥοτϑΥʔϜґଘίʔυͷӅณ ΧελϜΠϕϯτ Agenda

    Saturday, March 24, 12
  9. What’s Titanium Mobile? Saturday, March 24, 12

  10. Titanium Mobile λΠλχ΢ϜɾϞόΠϧ Saturday, March 24, 12

  11. by Appcelerator, Inc. Saturday, March 24, 12

  12. from JavaScript Saturday, March 24, 12

  13. from JavaScript to iOS Saturday, March 24, 12

  14. from JavaScript to iOS to Android Saturday, March 24, 12

  15. from JavaScript to iOS to Android It’s OpenSource! Saturday, March

    24, 12
  16. from JavaScript to iOS to Android It’s OpenSource! Community License

    => Free Saturday, March 24, 12
  17. from JavaScript to iOS to Android It’s OpenSource! Community License

    => Free Indie License => $49/month Saturday, March 24, 12
  18. ։ൃ؀ڥ Mac OS X Windows Ubuntu Linux Saturday, March 24,

    12
  19. 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
  20. Only Mac OS X iOS Saturday, March 24, 12

  21. Code Example Saturday, March 24, 12

  22. Saturday, March 24, 12

  23. 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
  24. 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
  25. 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
  26. 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
  27. 5JUBOJVN.PCJMF੡ΞϓϦ Saturday, March 24, 12

  28. MogSnap Zaim GetGlue Welcome to NIFTY-Serve Built with Appcelerator Titanium

    / http://www.builtwithtitanium.com/ Saturday, March 24, 12
  29. Titanium Mobile ࠷ۙͷ Saturday, March 24, 12

  30. Titanium Mobile SDK 1.8.2 Feb 29, 2012 Saturday, March 24,

    12
  31. ܥͷαʔϏεύοΫ ϝϞϦϦʔΫमਖ਼ Ϋϥογϡόάमਖ਼ ͳͲ http://developer.appcelerator.com/apidoc/mobile/1.8.2/changelog.html Saturday, March 24, 12

  32. ݄ʹ͕ϦϦʔε༧ఆ $PDPBpTIαʔϏεͱͷ౷߹ δΦϩέʔγϣϯػೳͷڧԽ 5BCMF7JFXͷύϑΥʔϚϯεվળ Ϟδϡʔϧ"1*ͷվྑ Saturday, March 24, 12

  33. Scaling Λ༰қʹ͢Δ ίʔυͷॻ͖ํ νʔϜ։ൃ ػೳͷ௥Ճɾ࡟আ ରԠσόΠεͷ௥Ճ ^ Saturday, March 24,

    12
  34. Code Structure ίʔυͷ෼ׂ Saturday, March 24, 12

  35. // 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
  36. // 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
  37. // 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
  38. // 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
  39. ͭͷBQQKTͰ͸ɺ ͙͢ʹݟ௨͕͠ѱ͘ͳΔɻ Saturday, March 24, 12

  40. νʔϜ։ൃͰ͸෼ۀ΋ࠔ೉ɻ Saturday, March 24, 12

  41. ίʔυΛ෼ׂ͢Δख๏ɻ Saturday, March 24, 12

  42. window.url Ti.include() CommonJS Saturday, March 24, 12

  43. ख๏ʹΑͬͯɺ "OESPJEରԠ ςετͷ͠΍͢͞ อकੑ ͳͲʹେ͖͘Өڹ͢Δɻ Saturday, March 24, 12

  44. window.url Saturday, March 24, 12

  45. ΢Οϯυ΢ੜ੒࣌ͷ VSMύϥϝʔλΛར༻ɻ Saturday, March 24, 12

  46. // 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
  47. XJOEPXVSMελΠϧ͸ɺ ݹ͍αϯϓϧίʔυɺϒϩάɺهࣄ ͳͲͰ࢖ΘΕ͍ͯΔɻ Saturday, March 24, 12

  48. ύϑΥʔϚϯεͷ໰୊΋͋Γɺ ݱࡏ͸ਪ঑͞Ε͍ͯͳ͍ͷͰ ࢖Θͳ͍͜ͱɻ Saturday, March 24, 12

  49. window.url Ti.include() CommonJS Saturday, March 24, 12

  50. Ti.include Saturday, March 24, 12

  51. 5JJODMVEFؔ਺Λར༻ɻ Saturday, March 24, 12

  52. // 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
  53. 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
  54. ໊લͷিಥ͕ى͜Γ΍͍͢ɻ Saturday, March 24, 12

  55. ݱࡏ͸5JJODMVEF΋ඇਪ঑ͳͷͰ ࢖Θͳ͍͜ͱɻ Saturday, March 24, 12

  56. window.url Ti.include() CommonJS Saturday, March 24, 12

  57. CommonJS Saturday, March 24, 12

  58. αʔόʔαΠυ+BWB4DSJQUʹ͓͚Δ ڞ௨࢓༷$PNNPO+4ͷɺ Ϟδϡʔϧ࢓༷Λ࠾༻ɻ Saturday, March 24, 12

  59. ίʔυͷ෼ׂɾ࠶ར༻ͷख๏ͱͯ͠ ݱࡏɺ"QQDFMFSBUPS͕ਪ঑ɻ Saturday, March 24, 12

  60. // 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
  61. 5JUBOJVN4UVEJPͰੜ੒͞ΕΔ ςϯϓϨʔτ΋$PNNPO+4ܗࣜɻ Saturday, March 24, 12

  62. Saturday, March 24, 12

  63. Saturday, March 24, 12

  64. app.js ui/ApplicationWindow.js ui/FirstView.js Saturday, March 24, 12

  65. 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
  66. 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
  67. var ApplicationWindow = require('ui/ApplicationWindow'); new ApplicationWindow().open(); app.js Saturday, March 24,

    12
  68. ஫ҙ ૬ରύεΛࢦఆͨ͠ࡍͷڍಈ͕ $PNNPO+4ͱҟͳΓɺ3FTPVSDFT ͔Βͷ૬ରࢦఆͱͯ͠ೝࣝ͞ΕΔɻ Saturday, March 24, 12

  69. ύϑΥʔϚϯεͷ໰୊͕ͳ͍ɻ ϝϯςφϯεੑ͕ߴ͍ɻ ࠶ར༻͠΍͍͢ɻ ୯ମςετ͕ߦ͍΍͍͢ɻ Saturday, March 24, 12

  70. 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
  71. window.url Ti.include() CommonJS Saturday, March 24, 12

  72. underscore.js Saturday, March 24, 12

  73. ഑ྻ΍ؔ਺ʹର͢Δૢ࡞Λ ༰қʹ͢ΔϥΠϒϥϦɻ Saturday, March 24, 12

  74. +BWB4DSJQUͷ ϏϧτΠϯΦϒδΣΫτΛ ֦ு͠ͳ͍ɻ Saturday, March 24, 12

  75. ؔ਺ϓϩάϥϛϯά༝དྷͷ ΋ͷΛத৺ͱͨ͠΄Ͳͷؔ਺ɻ each, map, reduce, filter, reject, any, max, min,

    shuffle, union, uniq, ... Saturday, March 24, 12
  76. It’s CommonJS var _ = require('underscore')._; Saturday, March 24, 12

  77. +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
  78. +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
  79. +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
  80. +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
  81. +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
  82. +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
  83. CoffeeScript Saturday, March 24, 12

  84. +BWB4DSJQUʹൺ΂ͯ ίʔυͷهड़ྔΛ࡟ݮͰ͖Δɻ Saturday, March 24, 12

  85. όάɺέΞϨεϛεͷ࡟ݮɻ Saturday, March 24, 12

  86. ύϥϝʔλهड़͕؆ܿʹɻ // 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
  87. ίʔϧόοΫهड़͕؆ܿʹɻ // 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
  88. ϧʔϓ͕γϯϓϧʹɻ // 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
  89. ޙஔ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
  90. Ϋϥεϕʔεʹઃܭ͠΍͍͢ɻ # 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
  91. จࣈྻ಺Ͱม਺ల։͕Ͱ͖Δɻ name = "Titanium" alert("Hello, #{name}") Saturday, March 24, 12

  92. 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
  93. Facade ϓϥοτϑΥʔϜ ґଘίʔυͷӅณ Saturday, March 24, 12

  94. 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
  95. ෼ذॲཧΛϥοϓͯ͠Ӆณɻ 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
  96. ෼ذॲཧΛϥοϓͯ͠Ӆณɻ var win = calendarWindow(function(e) { ... }); Saturday, March

    24, 12
  97. ϞδϡʔϧԽͯ͠࠶ར༻ɻ // utils.js exports.createCalendarWindow = function(callback) { ... }; //

    app.js var utils = require('/utils'); var win = utils.createCalendarWindow(function(e) { ... }); Saturday, March 24, 12
  98. Custom Event ΧελϜΠϕϯτ Saturday, March 24, 12

  99. Πϕϯτ Saturday, March 24, 12

  100. button.addEventListener(‘click’, function (e) {...}); window.addEventListener(‘focus’, function (e) {...}); 6*΢ΟδΣοτͷૢ࡞ʹ൐ͬͯൃੜ͢Δ΋ͷɺ Saturday,

    March 24, 12
  101. ͱ͸ݶΒͳ͍ɻ Saturday, March 24, 12

  102. ΞϓϦ಺ίϯϙʔωϯτͷ ࿈ܞʹ΋ΠϕϯτΛ׆༻͢Δɻ Saturday, March 24, 12

  103. Application Level Events Saturday, March 24, 12

  104. ΞϓϦέʔγϣϯϨϕϧΠϕϯτ ΞϓϦέʔγϣϯ಺Ͱάϩʔόϧʹ༗ޮɻ ར༻ʹ͸5J"QQϞδϡʔϧΛ࢖͏ɻ ͢΂ͯͷίϯςΩετɺؔ਺είʔϓɺ $PNNPO+4Ϟδϡʔϧ͔ΒࢀরͰ͖Δɻ Saturday, March 24, 12

  105. Ti.App.addEventListener('settingsUpdated', function(params) { alert('New value: ' + params.newValue); }); Ti.App.fireEvent('settingsUpdated',

    { newValue: '...' }); ϋϯυϥͷઃఆͱΠϕϯτͷൃੜ Saturday, March 24, 12
  106. ίϯϙʔωϯτಉ͕࢜ϝιουΛݺͼ߹͏ͱɺ Τϥʔॲཧ͕෼ࢄ͢Δɻ // ϝϞ࡞੒ addButton.addEventListener('click', function(e) { if (dataManager.insertMemo(newMemo)) {

    memoList.append(newMemo); } else { alert('error!'); } }); Saturday, March 24, 12
  107. Πϕϯτͷ΍ΓऔΓͰૄ݁߹ʹɻ ϝϞ࡞੒ Ti.App dataManager memoList Saturday, March 24, 12

  108. Πϕϯτͷ΍ΓऔΓͰૄ݁߹ʹɻ ϝϞ࡞੒ fire memoWillCreate Ti.App dataManager memoList Saturday, March 24,

    12
  109. Πϕϯτͷ΍ΓऔΓͰૄ݁߹ʹɻ ϝϞ࡞੒ fire memoWillCreate Ti.App dataManager memoList memoWillCreate Saturday, March

    24, 12
  110. Πϕϯτͷ΍ΓऔΓͰૄ݁߹ʹɻ ϝϞ࡞੒ fire memoWillCreate Ti.App dataManager memoList memoWillCreate fire memoDidCreated

    Saturday, March 24, 12
  111. Πϕϯτͷ΍ΓऔΓͰૄ݁߹ʹɻ ϝϞ࡞੒ fire memoWillCreate Ti.App dataManager memoList memoWillCreate fire memoDidCreated

    memoDidCreated Saturday, March 24, 12
  112. Τϥʔ࣌͸ΠϕϯτΛൃੜͤ͞ͳ͍ɻ ϝϞ࡞੒ fire memoWillCreate Ti.App dataManager memoList memoWillCreate fire memoDidCreated

    ʷ Saturday, March 24, 12
  113. // ϝϞ࡞੒ addButton.addEventListener('click', function(e) { Ti.App.fireEvent('memoWillCreate', { id: memo.id, title:

    memo.id, body: memo.body }); }); ϝϞ࡞੒ͷࡍʹ͸ɺσʔλอଘ΍ϝϞҰཡͷߋ৽ʹ͸ؔ༩͠ͳ͍ɻ Saturday, March 24, 12
  114. // dataManager Ti.App.addEventListener('memoWillCreate', function(memo) { if (insertMemo(memo)) { Ti.App.fireEvent('memoDidCreated', memo);

    } else { // Τϥʔॲཧ } }); σʔλอଘࣦഊ࣌ʹ͸࣍ͷΠϕϯτΛൃੜͤ͞ͳ͍ɻ Saturday, March 24, 12
  115. // memoList Ti.App.addEventListener('memoDidCreated', function(memo) { updateMemoList(memo); }); ϝϞҰཡͷߋ৽ॲཧ͸Πϕϯτͷൃੜ͚ͩΛ଴͍ͬͯΕ͹Α͍ɻ Saturday, March

    24, 12
  116. ஫ҙ ΞϓϦέʔγϣϯϨϕϧͷΠϕϯτϋϯυϥ಺ Ͱੜ੒ͨ͠ΦϒδΣΫτ͸ɺϋϯυϥΛ໌ࣔత ʹ࡟আ͢Δ·ͰϝϞϦʹ࢒Δɻ Managing Memory and Finding Leaks -

    Documentation & Guides https://wiki.appcelerator.org/display/guides/Managing+Memory+and+Finding+Leaks Saturday, March 24, 12
  117. var doSomething = function() { var foo = new Foo();

    // ϋϯυϥΛ࡟আ͢Δ·Ͱ࢒Γଓ͚Δ }; Ti.App.addEventListener(‘doSomething’, doSomething); // ෆཁʹͳͬͨλΠϛϯάͰϋϯυϥΛ࡟আ͢Δ Ti.App.removeEventListener(‘doSomething’, doSomething); Saturday, March 24, 12
  118. 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
  119. Summary ·ͱΊ Saturday, March 24, 12

  120. Scaling Λ༰қʹ͢Δ ίʔυͷॻ͖ํ νʔϜ։ൃ ػೳͷ௥Ճɾ࡟আ ରԠσόΠεͷ௥Ճ ^ Saturday, March 24,

    12
  121. What’s Titanium Mobile ࠷ۙͷ5JUBOJVN.PCJMF ίʔυͷ෼ׂ underscore.js CoffeeScript ϓϥοτϑΥʔϜґଘίʔυͷӅณ ΧελϜΠϕϯτ Agenda

    Saturday, March 24, 12
  122. ίʔυͷ෼ׂ͸ৗʹ$PNNPO+4ελΠϧɻ ϞδϡʔϧԽͰ෼ۀ͕༰қʹɻ ϓϩδΣΫτؒͰͷίʔυ࠶ར༻Λଅਐɻ CommonJS Saturday, March 24, 12

  123. underscore.js ഑ྻ΍ؔ਺ʹର͢Δૢ࡞Λ؆ܿʹهड़ɻ νʔϜ಺Ͱͷ഑ྻૢ࡞ελΠϧΛ౷Ұɻ Saturday, March 24, 12

  124. ৑௕ͳίʔυͷ࡟ݮɻ +BWB4DSJQUͷྑ͍෦෼͚ͩΛར༻ɻ νʔϜ಺Ͱ+BWB4DSJQUͷίʔυ඼࣭Λ౷Ұɻ CoffeeScript Saturday, March 24, 12

  125. J04"OESPJE൑ఆͷίʔυ͸Ͱ͖Δ͚ͩӅณɻ ؔ਺΍ϞδϡʔϧʹӅ͢ɻ ࠶ར༻Ͱ͖Δϊ΢ϋ΢Λ஝ੵɻ ঢ়گ͕มΘͬͨࡍͷରԠΛ༰қʹɻ ϓϥοτϑΥʔϜґଘίʔυͷӅณ Saturday, March 24, 12

  126. ίϯϙʔωϯτؒͷ௨৴͸Ͱ͖Δ͚ͩΠϕϯτͰɻ ΤϥʔॲཧΛू໿ɻ γϯϓϧͳॲཧϑϩʔɻ ΧελϜΠϕϯτ Saturday, March 24, 12

  127. Thanks. @junya http://bit.ly/scale-ti Saturday, March 24, 12