gps fx2 ext
TRANSCRIPT
![Page 1: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/1.jpg)
gps firefox extension step by step
2007.12.17ICL W200 SJH
![Page 2: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/2.jpg)
firefox extension
● 擴充
● 檔名 .xpi , ( XPInstall )● 與 UI相關如 : Web Developer, Flash plugin● 與 UI無關如: google gear● XPCOM (Cross Platform Component
Object Model)
![Page 3: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/3.jpg)
與 UI相關
● 使用 XUL建構 UI● 使用 java script 來操作互動
![Page 4: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/4.jpg)
與 UI無關
● 使用 XPCOM技術● 使用本機端資源
● 與本機端其他 library連結● 可以使用 C++, javascript, python實作出
XPCOM
![Page 5: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/5.jpg)
gps firefox extensionstep 1
● 了解需求:
– Linux環境之 firefox使用者可以使用一般網頁技術,如 java script,來取得本機 gps裝置傳回的經緯度,並且顯示於 google map上。
![Page 6: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/6.jpg)
gps firefox extensionstep 2
● 需求分析:
● firefox使用者可以使用一般網頁技術,如 java script:提供一個 firefox extension,讓javascript可以呼叫以下之擴充功能。
● 來取得本機 gps裝置傳回的經緯度:使用 linux上的 gpsd。
● 並且顯示於 google map 上: 使用 google map API
![Page 7: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/7.jpg)
gps firefox extensionstep 3
● 實作 firefox extension:● 功能:讓 javascript取得 gps經緯度,不需要處理畫面。
● firefox extension安裝檔案為 .xpi。● 架構為:
● 實作看看
● 測試
![Page 8: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/8.jpg)
MyExt.xpi
HelloWorld.xpi
googlegear.xpi
XPCOM Type Library
share libs
![Page 9: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/9.jpg)
gps firefox extensionstep 4
● 實作 xpcom● 以 C++實作● 架構為:
● 實作看看
● 包裝成 xpi● 測試
![Page 10: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/10.jpg)
xpcom目錄結構
interface description language
share libs
xpcom實作
XPCOM Type Library
![Page 11: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/11.jpg)
gps firefox extensionstep 5
● 實作 gps xpcom ● 使用 libgps 與 gpsd 溝通● 架構為:
● 實作看看
● 包裝成 xpi● 測試
![Page 12: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/12.jpg)
gps firefox extensionstep 6 -google map略
● 實作 google api● 使用 javascript取得經緯度● 畫在 google map上● 實作
![Page 13: Gps Fx2 Ext](https://reader033.vdocuments.pub/reader033/viewer/2022052623/559e932d1a28ab243d8b4665/html5/thumbnails/13.jpg)