WebAPI 是指一套设备兼容性和存储API. 它可以让Web Apps和其内容获取设备硬件(比如电池状态, 或者设备的振动器), 同时也可以获取设备上的数据(比如日历, 或者联系人等信息).
通过添加这些 APIs, 我们希望超越Web在今天能做的和在过去只有专有平台能做的.
注意: 比这份文档看起来更多的内容已经被写成, 但并不是所有的链接都被添加进来了. 我们一直在提升这点,并且希望在未来有更多更好的内容. 参看 WebAPI doc status page, 追踪当前 WebAPI文档的进展.
注意: 获取每一个徽章的简要说明,, 请看 packaged apps 文档.
- Bluetooth Certification required
- The WebBluetooth API 提供了对设备的蓝牙的底层访问.
- Mobile Connection API Certification required 非标准
- 提供设备的无线连接信息, 比如信号强度, 操作者信息, 等等.
- Network Information API
- 提供当前网络连接的基本信息, 比如网速.
- Network Stats API Certification required 非标准
- TCP Socket API Privileged 非标准
- 提供底层的sockets 和SSL 支持.
- Telephony Certification required 非标准
- 让app处理和回应电话和使用内建的电话用户界面 .
- WebSMS Certification required 非标准
- 让app发送和接受短信, 也能访问和管理存储在设备上的短信.
- WiFi Information API Certification required 非标准
- 一个特权 API 能提供信号强度,当前连接网络的名字,可用的WIFI网络等信息.
Hardware access APIs
- Ambient Light Sensor API
- Provides access to the ambient light sensor, which lets your app detect the ambient light level in the vicinity of the device.
- Battery Status API
- Provides information about the battery's charge level and whether or not the device is currently plugged in and charging.
- Camera API Certification required 非标准
- Allows apps to take photographs and/or record video using the device's built-in camera.
- Geolocation API
- Provides information about the device's physical location.
- Pointer Lock API
- Lets apps lock access to the mouse and gain access to movement deltas rather than absolute coordinates; this is great for gaming.
- Power Management API Certification required 非标准
- Lets apps turn on and off the screen, CPU, device power, and so forth. Also provides support for listening for and inspecting resource lock events.
- Proximity API
- Lets you detect proximity of the device to a nearby object, such as the user's face.
- Device Orientation API
- Provides notifications when the device's orientation changes.
- Screen Orientation API
- Provides notifications when the screen's orientation changes. You can also use this API to let your app indicate what orientation it prefers.
- Vibration API
- Lets apps control the device's vibration hardware for things such as haptic feedback in games. This is not intended for things such as notification vibrations. See the Alarm API for that.
- WebFM API installed 非标准
- Provides support for a device's FM radio functionality, if available.
Data management APIs
- Contacts API Privileged
- Provides access to the user's contacts database, with support for adding, reading, and modifying contact information.
- Device Storage API Privileged 非标准
- Allows apps to create, read, and change files stored in a central location on the device, such as the "pictures" folder on modern desktop platforms or the photo storage on mobile devices.
- FileHandle API
- Provides support for writable files with locking support.
- Client-side storage of structured data with support for high-performance searches. Docs need moving.
- Settings API Certification required 非标准
- Lets apps examine and change system-wide configuration options that are permanently stored on the device.
- Alarm API
- Lets apps schedule notifications. Also provides support for automatically launching an app at a specific time.
- Apps API 非标准
- The Open WebApps API provides support for installing and managing Web apps. In addition, support is provided to let apps determine payment information.
- Browser API Privileged 非标准
- Provides support for building a Web browser completely using Web technologies (in essence, a browser within a browser).
- Idle API Certification required
- Lets apps receive notifications when the user is not actively using the device.
- Permissions API Certification required 非标准
- Manages app permissions in a centralized location. Used by the Settings app.
- Simple Push API
- Lets the platform send notification messages to specific applications.
- Time/Clock API Certification required 非标准
- Provides support for setting the current time. The time zone is set using the Settings API.
- Web Activities 非标准
- Lets an app delegate an activity to another app; for example, an app might ask another app to select (or create) and return a photo. Typically the user is able to configure what apps are used for which activities.
- WebPayment API installed 非标准
- Lets Web content initiate payments and refunds for virtual goods.
If you need help with these APIs, there are several ways you can talk to other developers making use of them.