<commit_before># 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).

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

2017-01-19
- Added format key to avoid 'unexpected format version' error (thanks to [AdrienPoupa](https://github.com/AdrienPoupa) for spotting this oversight)

2017-01-12
- [Google Pixel XL](https://github.com/aframevr/aframe/issues/2117#issuecomment-263336591)
- [Motorola G4](https://github.com/aframevr/aframe/issues/2117#issuecomment-265275683)
- [Samsung Galaxy S7](https://github.com/googlevr/webvr-polyfill/issues/164#issuecomment-266108204)
- [Samsung Note 5 (UA variant)](https://github.com/googlevr/webvr-polyfill/pull/185)

2017-01-06
- [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<commit_msg>Add step by step instructions on finding your device's info to add to dpdb.<commit_after># 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].

## 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 the [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`:

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

## Change Log

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

2017-01-19
- Added format key to avoid 'unexpected format version' error (thanks to [AdrienPoupa](https://github.com/AdrienPoupa) for spotting this oversight)

2017-01-12
- [Google Pixel XL](https://github.com/aframevr/aframe/issues/2117#issuecomment-263336591)
- [Motorola G4](https://github.com/aframevr/aframe/issues/2117#issuecomment-265275683)
- [Samsung Galaxy S7](https://github.com/googlevr/webvr-polyfill/issues/164#issuecomment-266108204)
- [Samsung Note 5 (UA variant)](https://github.com/googlevr/webvr-polyfill/pull/185)

2017-01-06
- [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
{'fraction_non_alphanumeric': 0.13396889111891622, 'fraction_numerical': 0.05293527345709985, 'mean_word_length': 4.424489795918367, 'pattern_counts': {'":': 7, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 19, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '844771', 'n_tokens_mistral': 1491, 'n_tokens_neox': 1299, 'n_words': 386}