1 / 23

─代買系統

─代買系統. 網路程式設計期末專案 DEMO. 資工二 995002527 陳薏如 資工三 985002512 鄭達群. 設計動機. 解決平常不知道該吃什麼的問題 ! & 不想出門買飯的問題 ! !. 系統介面 ─ 登入 頁. 系統介面 ─ 查看好友動向. 系統介面 ─ 建立新事件. 系統介面 ─建立動向. 系統介面 ─晚餐吃什麼?. 登入. whatForDinner. LoginActivit y. BunbuyActivity. 傳送 所有代買事件. 向建立者 發送請求. Server. CreateTrend.

Télécharger la présentation

─代買系統

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ─代買系統 網路程式設計期末專案DEMO 資工二 995002527 陳薏如 資工三 985002512 鄭達群

  2. 設計動機 解決平常不知道該吃什麼的問題! & 不想出門買飯的問題!!

  3. 系統介面─登入頁

  4. 系統介面─查看好友動向

  5. 系統介面─建立新事件

  6. 系統介面─建立動向

  7. 系統介面─晚餐吃什麼?

  8. 登入 whatForDinner LoginActivity BunbuyActivity 傳送所有代買事件 向建立者 發送請求 Server CreateTrend SendRequest CreateEvent 傳送各種代買事件

  9. 程式架構─外觀元件 Customized action bar Customized menu Customized button List View Image Button Spinner

  10. 程式架構─外觀元件 Customized action bar --using other action bar library

  11. 程式架構─外觀元件 Customized menu

  12. 程式架構─外觀元件 Customized button

  13. System Architecture • BunBuy採用現今通訊軟體(skype、MSN)常見的server-client與p2p混合架構 • 每個client(手機)先經由facebookapi進行登入認證 • 認證成功通知server上線 • server記錄client的連線狀態以及ip位置

  14. System Architecture

  15. System Architecture • 與client端建立連線 • 儲存client資訊:userid username sourceip • 紀錄代買事件 • 紀錄使用者動向 • 紀錄發送請求事件

  16. Implements-Server • ServerPocess.java • ServerSocket • ClientThread.java • 自訂類別 • Socket、Thread、Stream,可提供多人連線,並與client傳輸資料 • ObjectOutputStream,傳送Event到client • BufferedReader,接收client資訊及使用者操作 • Event.java • 自訂類別,implementSeriablizable實現stream傳輸,implement Comparable實現Event排序 • 以此data structure儲存各種代買事件, • ConnectDB.java • 自訂類別,存取mysql資料庫,取得店家資訊(ex:菜單、電話…)

  17. Implement - Client • LoginActivity.java • BunbuyActivity.java • CreateEvent.java • CreateTrend.java • CheckRequest.java • SendRequest.java • WhatForDinner.java

  18. Implement - Client • Facebook、AsyncFacebook(Facebook api) • Client身分認證 • 分享代買事件到facebook塗鴉牆 • Event • ServerSocket • 接收另一個使用者發送代買請求 • Socket • 向Server傳送使用者資訊 • 發送代買請求到另一個使用者

  19. Implement - Client • Thread • 建立代買事件後,持續監聽是否有其他使用者發送請求 • Stream • ObjectInputStream,接收Server所有使用者建立的Events • PrintStream,傳送使用者操作到Server • ArrayAdapter • 呈現各種選單上的資訊

  20. Some Trouble…. • 使用多個Library內建package名稱不同,resource(R.java) 會建立在不同的package,AndroidManisfest卻只能讀取一個package下的resource • Solution:如果沒有額外的資源(圖檔、音樂等),將package包裝成jar在讀取,反之將package名稱改成相同

  21. Some Trouble…. • Client 和 Server之間傳遞訊息會亂碼 • Solution:統一使用utf-8做編碼 • 自訂物件傳遞,接收端物件須完全相同,否則會crash • Solution:兩邊source必須同時更新 • Server必須maintain所有client建立的代買事件 • Solution:自行建立資料結構(Event)來儲存事件

  22. Some Trouble…. • Client端要隨時可以接收其他Client的代買請求,socket必須在不同Activity之間持續使用 • Solution:使用static socket,並且建立各種Exception狀況來排除問題 • 開發android app會遇到各種靈異事件(原因不明的bug) • 重開eclipse、重開模擬器、重建專案、fix project property、compiler版本問題……使用各種旁門左道來解決……

  23. THE END

More Related