[dctpe2010] drupal 遇上行動網路服務

22
關關 Jimmy Huang 關關 2003 2007 2008 2009 Drupal

Upload: drupal-taiwan

Post on 12-Nov-2014

2.746 views

Category:

Documents


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: [DCTPE2010] Drupal 遇上行動網路服務

關於 Jimmy Huang 黃雋

2003

2007

2008

2009Drupal

Page 2: [DCTPE2010] Drupal 遇上行動網路服務

大家都用手機上網!

Page 3: [DCTPE2010] Drupal 遇上行動網路服務

Drupal 的行動裝置解決方案1. 網頁型解決方案

– 版型 Theme 為主的解決方案2. 跨手機應用程式解決方案

– 以 Web Based 的方式,在手機上與第三方的架構平台整合

– 自行製作程式碼 Custom PHP code

3. Service Based 解決方案– Service – data provider– JSON for data attrive.– XML-RPC login / save

Page 4: [DCTPE2010] Drupal 遇上行動網路服務

1. Drupal 版型與 Mobile

• 手機的寬度是?– 320, 480, 800 … 無數種寬度!

• 你是用哪一種手機?– 手機偵測– 瀏覽器偵測

• 你的網站很好搜尋、網址很短?– 讓人可以打開手機瀏覽器後,快速找到你 – 用手機的喜歡打網址

• Flash 再見… ?– 有多少手機支援 Flash– 漂亮的官網首頁,還是正確的資訊

Page 5: [DCTPE2010] Drupal 遇上行動網路服務

1.1 Mobile (Theme)http://drupal.org/project/mobile

BeforeAfter

Page 6: [DCTPE2010] Drupal 遇上行動網路服務

1.2 IUIhttp://drupal.org/project/iui

Page 7: [DCTPE2010] Drupal 遇上行動網路服務

1.3 Mobile Plugin + Mobile Garlandhttp://drupal.org/project/mobileplugin

• 自動偵測瀏覽器– 可自訂規則處理瀏覽器– 可自動處理的瀏覽器資料庫

• http://drupal.org/project/wurfl• http://drupal.org/project/browscap

• 自動處理縮圖• 自訂篩選 css / js

• 自訂邊欄區塊處理方式

Page 8: [DCTPE2010] Drupal 遇上行動網路服務

續 ..

Before

Page 9: [DCTPE2010] Drupal 遇上行動網路服務

續 ..

After

Page 10: [DCTPE2010] Drupal 遇上行動網路服務

續 ..

Page 11: [DCTPE2010] Drupal 遇上行動網路服務

2. 跨手機應用程式解決方案• 開發 iPhone 還是 Android 版本?

– 都要!– Mac book + iPhone + Android phone– Object C + Java + javscripts + ...– Eclips(android) + Android SDK (free)– iPhone Developer Program ($99 / year)

Page 12: [DCTPE2010] Drupal 遇上行動網路服務

2.1 把 Drupal 當成 API

• 輕鬆簡單便用 PHP 載入 Drupal 函式庫<?phpinclude_once './includes/bootstrap.inc';drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

// Then start doing everything by Drupal API// ex: db_query for calling database// ex: filter_xss for filter HTML for output// ex: using imagecache to resize mobile image?>

Page 13: [DCTPE2010] Drupal 遇上行動網路服務

2.2 Front-end Based Framework

• jQTouch ( http://jqtouch.com/ )– JQuery Based – Support Webkit callbac

k event

• iWebkit ( http://iwebkit.net/ )– Build-in iPhone style UI

Page 14: [DCTPE2010] Drupal 遇上行動網路服務

2.3 Native Application Generator / Framework

• Titanium Mobile – (by Appcelerator)

– Apaceh Public License– Desktop development kit– iPhone / Android only

• PhoneGap– (by Nitobi)

– MIT License– Most supported

JS + PHP?

CrossPlatform!

Page 15: [DCTPE2010] Drupal 遇上行動網路服務

討論: Web Based Cool?

• Drupal 幾乎無痛• 開發快速、轉移快速• 跨手機的可及性• 不用重新熟悉語言• 內容型、媒體型最好選擇

• 慢– 很慢– 真的很慢

• 沒有網路等於磚塊• 無法完整與手機整合

– 羅盤? No way– GPS 定位? No way– G-Sensor ? No way– 相機? No way– 背景執行?

• Only Native App

Page 16: [DCTPE2010] Drupal 遇上行動網路服務

3. Service Based

• 想要提供一個旅遊景點資料搜尋器?• 想要商品比較資料庫?• 想要 … 一杯啤酒!?( BeerCloud )

Page 17: [DCTPE2010] Drupal 遇上行動網路服務

3.1 Service based structure

NativeMobile

Application

DrupalData Cloud

(Service API)

Page 18: [DCTPE2010] Drupal 遇上行動網路服務

3.2 Drupal as Data Server

• XML-RPC– Traditional– Cross platform– Great support for Authentication

• JSON (prefered)– Tiny– OO Data Structuer

Page 19: [DCTPE2010] Drupal 遇上行動網路服務

3.2 Drupal as Services

• Node– 取出、存取單篇內容

• Taxonomy– 取出、存取分類表、單則分類

• User– 登入、登出、取出使用者

• Views– 取出 Views 列表

Page 20: [DCTPE2010] Drupal 遇上行動網路服務

3.3 Demo with JSON Server

Page 21: [DCTPE2010] Drupal 遇上行動網路服務

3.4 Server based references

• Services• Default XML-RPC / REST services • http://drupal.org/project/services

• JSON Server• JSON data format• http://drupal.org/project/json_server

• JSON RPC Server• http://drupal.org/project/jsonrpc_server

• Google Analysis Service• Integrate your mobile service statistics by GA API• http://drupal.org/project/gaservice

• BeerCloud• http://drupal.org/node/659772

Page 22: [DCTPE2010] Drupal 遇上行動網路服務

討論:效能?• Cache everything

• Memcache

• Load balance / Cloud

• Multiple Database Backend