From 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:43:23 -0500 Subject: initial commit --- files/zh-tw/webapi/index.html | 126 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 files/zh-tw/webapi/index.html (limited to 'files/zh-tw/webapi/index.html') diff --git a/files/zh-tw/webapi/index.html b/files/zh-tw/webapi/index.html new file mode 100644 index 0000000000..70683109e6 --- /dev/null +++ b/files/zh-tw/webapi/index.html @@ -0,0 +1,126 @@ +--- +title: WebAPI +slug: WebAPI +translation_of: Web/API +--- +

WebAPI 是指一系列的存取與裝置相容性 API,讓 Web App 及其內容能夠存取裝置的硬體 (例如電池狀態或裝置的振動硬體),亦可存取裝置所儲存的資料 (例如行事曆或聯絡人清單)。在添加這些 API 之後,我們希望 Web 能跳脫目前的功能,並打破專利平台的限制。

+ +
+

注意:我們實際撰寫的內容,其實比本頁所列出的 API 還多,而且仍有許多連結尚未補齊。我們將持續補完相關內容,以提供更完整的資訊。可參閱 WebAPI 文件狀態頁面,隨時追蹤目前的 WebAPI 說明文件。

+
+ +
+

注意:若要了解小標圖的意義,可先參閱《封裝式 (Packaged) App》一文。

+
+ +
+
+

通訊 API

+ +
+
Network Information API
+
提供目前網路連線的基本資訊,如連線速度。
+
Bluetooth
+
The WebBluetooth API provides low-level access to the device's Bluetooth hardware.
+
Mobile Connection API {{NonStandardBadge}}
+
Exposes information about the device's cellular connectivity, such as signal strength, operator information, and so forth.
+
Network Stats API {{NonStandardBadge}}
+
監控資料使用情形,並將此資料提供給 Privileged App。
+
TCP Socket API {{NonStandardBadge}}
+
提供初階的 Socket 與 SSL 支援功能。
+
Telephony {{NonStandardBadge}}
+
讓 App 可撥/接電話,並使用內建電話的使用者介面。
+
WebSMS {{NonStandardBadge}}
+
讓 App 能收/發 SMS 文字簡訊,並能存取/管理裝置所儲存的訊息。
+
WiFi Information API {{NonStandardBadge}}
+
A privileged API which provides information about signal strength, the name of the current network, available WiFi networks, and so forth.
+
+ +

硬體存取 API

+ +
+
Ambient Light Sensor API
+
可存取環境光線感測器,讓 App 可偵測裝置四周的環境光線強度。
+
Battery Status API
+
不論是否插電進行充電,均將提供電池充電容量的相關資訊。
+
Geolocation API
+
提供裝置實際位置的相關資訊。
+
Pointer Lock API
+
讓 App 能鎖定存取滑鼠,並取得「隨著時間推移的滑鼠位移 (即 deltas)」,而不只是絕對座標而已。特別適用遊戲類 App。
+
Proximity API
+
測得裝置與物體 (如使用者的臉部) 之間的距離。
+
Device Orientation API
+
當裝置的方向改變時,送出通知。
+
Screen Orientation API
+
在畫面方向改變時發出通知。另透過此 API,可讓 App 呈現其所偏好的方向。
+
Vibration API
+
可讓 App 控制裝置上的振動硬體,用於如遊戲中的觸控回饋。此 API 並非用於如「通知」的振動事件。若需要通知的振動事件,請參閱 Alarm API
+
Camera API {{NonStandardBadge}}
+
讓 App 透過裝置內建的相機,即可拍照或錄製影片。
+
Power Management API {{NonStandardBadge}}
+
讓 App 能開/關 CPU、螢幕、裝置電力,與類似資源。另可進一步監聽或檢視資源鎖定事件。
+
+ +

View All...

+
+ +
+

資料管理 API

+ +
+
FileHandle API
+
支援可寫入的檔案,並搭配鎖存功能。
+
IndexedDB
+
於用戶端儲存結構性的資料,並支援高效率的搜尋功能。
+
Settings API {{NonStandardBadge}}
+
App 可檢查並更改系統的相關設定;而這些設定選項均屬於永久儲存性質。
+
+ +

其他 API

+ +
+
Alarm API
+
App 可排定通知,亦可於特定時間自行啟動 App。
+
Simple Push API
+
讓平台傳送通知訊息至特定 App。
+
Web Notifications
+
讓 App 傳送通知並於系統層級顯示。
+
Apps API {{NonStandardBadge}}
+
Open WebApps API 可安裝並管理 Web App。此外,亦可讓 App 決定付款資訊。
+
Web Activities {{NonStandardBadge}}
+
讓 App 可委派某個 Activity 給其他 App。舉例來說,XX App 可能要求 YY App 選擇並回傳相片。使用者一般均可設定 Activity 所應搭配使用的  App。
+
Browser API {{NonStandardBadge}}
+
完全透過 Web 技術,支援建構 Web 瀏覽器 (可說是瀏覽器中再建構出瀏覽器)。
+
+ +
+
Idle API
+
使用者並未使用裝置時,讓 App 接收通知。
+
Permissions API {{NonStandardBadge}}
+
集中管理 App 的權限 (Permission)。由設定類 (Settings) 的 App 所使用。
+
Time/Clock API {{NonStandardBadge}}
+
可設定目前時間。另透過 Settings API 設定時區。
+
+ +

WebAPI 社群

+ +

如果需要這些 API 的相關協助,則有許多方法可諮詢其他開發人員。

+ +
    +
  • 在 WebAPI 討論區中提出問題: {{DiscussionList("dev-webapi", "mozilla.dev.webapi")}}
  • +
  • 到 WebAPI IRC channel 逛逛:#webapi
  • +
+ +

Don't forget about the netiquette...

+ + + + +
+
+ +

 

-- cgit v1.2.3-54-g00ecf