2013/05/19 - Titanium 入門實戰 30 分鐘教你寫出 youtube App + 會員系統 @jsdc2013
-
Upload
kevin-huang -
Category
Technology
-
view
2.195 -
download
1
description
Transcript of 2013/05/19 - Titanium 入門實戰 30 分鐘教你寫出 youtube App + 會員系統 @jsdc2013
黃崇傑 Kevin Huang2013/5/19
Titanium 入門實戰 30 分鐘教你寫出 Youtube App + 會員系
統
自我介紹Kevin Huang
VideOhya
Titanium 2 年開發經驗
開發近 40 支 iOS/Android App
累計近 190 萬下載
https://github.com/kevinbubu
在開始之前
你必須要知道 你會看到很多很多的 Code
但是都是基本的 JavaScript
你不會看到任何跟架構有關的東西
(因為只有 30 分鐘阿!)
Agenda
YouTube API + TableView
Titanium 簡介
基本 UI 建置 及 Event 控制
使用 ACS 快速建立會員系統
Titanium
Titanium 簡介
Titanium 簡介 Open Source
支援平台 : iOS, Android, BlackBerry, Mobile Web
可在 Mac OSX, Windows, Linux 進行開發
開發工具 Titanium Studio (Eclipse-based)
SDK Titanium Mobile SDK 3.1
Titanium 優點
真正的 Native App
社交網路 &LBS 應用
硬體高度整合
最重要的是…使用的語言是…
開發速度極快
JavaScript!!
Titanium 缺點 沒有真正的跨平台
無法精準控制記憶體使用量
整合第三方 SDK 較為困難
Bug 更新速度慢
官方 Q&A 論壇很難使用
專案架構
建立你的第一支專案
Tab Group
Tab Group
Window
Window
https://gist.github.com/kevinbubu/5603035
基本 UI 建置 及 Event 控制
API Docu
mention
http://docs.appcelerator.com/titanium/2.1/#!/api
Hello W
orld!
https://gist.github.com/kevinbubu/5599643
Event & Contro
ll
https://gist.github.com/kevinbubu/5603065
打包網頁
https://gist.github.com/kevinbubu/5603190
使用 HTML+CSS
https://gist.github.com/kevinbubu/5603208
基本 Table V
iew
https://gist.github.com/kevinbubu/5603757
進階 Table V
iew
https://gist.github.com/kevinbubu/5603768
Table View
Table View Row
View
Label 1
Label 2
YouTube API + TableView
Youtube Search
API
http://gdata.youtube.com/feeds/api/videos?q= << KEYWORD>> &alt=json&max-results=20
API & HTTP Request
var xhr = Ti.Network.createHTTPClient({timeout : 10000
});xhr.onload = function(e) {
var parsedData = JSON.parse(this.responseText);
Ti.API.info(parsedData);}xhr.onerror = function(e) {
Ti.API.info('Error: ' + e.message);}xhr.open('GET', url);xhr.send();
App 實作
https://gist.github.com/kevinbubu/5604886
Search Bar
Table ViewClick Event
使用 ACS 建立會員系統
ACS 簡介Appcelerator Cloud Services
ACS 官方文件http://docs.appcelerator.com/titanium/2.0/#!/api/Titanium.Cloud
ACS 後台
直接使用 ACS 後台建會員
登入頁面
https://gist.github.com/kevinbubu/5605170
註冊會員
https://gist.github.com/kevinbubu/5605209
登出會員
https://gist.github.com/kevinbubu/5605228
登入會員及秀出資訊
https://gist.github.com/kevinbubu/5605228
The End ?
簡單也可以很浪漫
讓我們一起帶著 Titanium 浪漫的逃亡
寫 App 可以很簡單
請上 App Store 搜尋
One More
Thing…
Q & A
Thanks