Skip to content

Commit

Permalink
Add step by step instructions on finding your device's info to add to…
Browse files Browse the repository at this point in the history
… dpdb.
  • Loading branch information
jsantell committed May 22, 2017
1 parent 924a848 commit e7b3d7c
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,45 @@
# webvr-polyfill-dpdb

This is a fork of the [online cache](https://storage.googleapis.com/cardboard-dpdb/dpdb.json) of the Device Parameter Database (DPDB) for the [WebVR Polyfill](https://github.com/googlevr/webvr-polyfill).
This is a fork of the [online cache](https://storage.googleapis.com/cardboard-dpdb/dpdb.json) of the Device Parameter Database (DPDB) for the [webvr-polyfill].

## Adding A Device

You'll need to update `dpdb-formatted.json` with your device's information in the following format:

```json
{
"type":"android",
"rules":[
{
"mdmh":"asus/*/ASUS_Z00AD/*"
},
{
"ua":"ASUS_Z00AD"
}
],
"dpi":[
403,
404.6
],
"bw":3,
"ac":1000
}
```

* `type`: Either `"android"` or `"ios"`.
* `rules`: An array of various rules that must be satisfied in order to use the configuration. Each rule is an object with one property and can be one of the following:
* `ua`: The user agent string to match. Go to [useragentstring.com] and find something unique that looks like the device's name. Use this if type is `"android"`.
* `res`: An array of resolution values as width and height. Use this if type is `"ios"`.
* `mdmh`: The make and model of the device. Currently unused in [webvr-polyfill], and used for native devices(?) -- see other entries.
* `dpi`: An array of the DPI values of the screen as `[x, y]` values. Get this information via [Device Info App] and look for `Actual DPI X` and `Actual DPI Y` values.
* `ac`: Currently unused in [webvr-polyfill]?
* `bw`: The bezel width in millimeters. 3 and 4 are common bezel widths, but you can calculate the exact width using this formula, where `deviceWidth` is in millimeters, `screen` is the screen's diagonal length in millimeters, and `ratio` is the screen resolution's `width / height`:

```
(deviceWidth - Math.sqrt((screen * screen) / (1 + (1 / (ratio * ratio))))) / 2;
```

## Change Log

The following devices were added (and/or corrections made):

Expand All @@ -17,3 +56,7 @@ The following devices were added (and/or corrections made):
- [Samsung Galaxy S7 Edge](https://github.com/googlevr/webvr-polyfill/issues/164#issuecomment-266108204)
- [iPhone 6S+](https://github.com/borismus/webvr-boilerplate/issues/146#issuecomment-253711181)
- Removed double entries for several iOS settings

[webvr-polyfill]: https://github.com/googlevr/webvr-polyfill
[useragentstring.com]: http://useragentstring.com/
[Device Info App]: https://play.google.com/store/apps/details?id=com.jphilli85.deviceinfo

0 comments on commit e7b3d7c

Please sign in to comment.