immersive-web / webvr-polyfill-dpdb

An up-to-date Device Parameter Database for the WebVR Polyfill
https://dpdb.webvr.rocks/dpdb.json
Apache License 2.0
31 stars 32 forks source link

Create a helper script/web page for generating values for a new device #34

Open cvan opened 6 years ago

cvan commented 6 years ago

It'd be nice to eventually have users load a page from any mobile device, information is gathered from client-side JS, and parameters get calculated and added to the JSON file. That'd obviously involve some backend service, or generate some fancy new GitHub issue URL with query-string parameter for the user's device (à la https://github.com/immersive-web/webvr-polyfill-dpdb/issues/new?body=Example).

As a simpler start, it'd be nice to have a basic index.html at https://dpdb.webvr.rocks/ that could automate the process of adding a new device to the database.

A basic JS snippet would suffice. I don't want to commit to anything too grand, but helping folks crowdsource this data better really would be fantastic.

Basically, I'd like to recreate the workflow of SDL2's crowdsourced gamepad controller mappings:

jsantell commented 6 years ago

My understanding is that most of this data isn't available to web content, so we'd need to manually get the information, which is the reason that this crowd-sourced DB exists -- if web content had access to this already, it wouldn't need to look up via UA!

I wonder if there could be a script provided, that, with a connected Android device via adb, could get the relevant information from the connected device, and output a JSON chunk to be contributed.

cwervo commented 4 years ago

@jsantell & @cvan I know it's been over a year but I'm curious to know if either of you have any more ideas/requirements/thoughts on this issue? I'm thinking about creating a script like this but don't think I have enough context on the problem yet & would love some help!

cvan commented 4 years ago

@cwervo np, thanks for asking. what are your use cases? I have thoughts on this, but the more clearly I understand the context, I can probably help better.

jsantell commented 4 years ago

I think something like this can be automated by installing a mobile app; the physical size of the screen is needed to calculate the lens distortion, which isn't available to the web, but the DPI is available to native applications, from which the screen size can be deduced.

I think the most straight forward way to make this easy to contribute new device info to is via native app that queries whatever platform API to get the DPI (a la DeviceInfo App), and calculates a result using the formulas and processes from Adding A Device and display a JSON chunk to copy/paste somewhere. I believe there used to be a cardboard app that did something like this, but a lot of cardboard info is hard to find now: and the calculations and the data's origin for the DPDB in the README are locked behind corp walls, leaving these instructions the most detailed AFAIK on the DPDB.

On a wider topic of easy to contribute, an app that submits the result to be added (via bot or maintainer) would remove the need to know how git works, although that seems more of a part 2 :smile: (edit: OP already mentions this, woops)

jsantell commented 4 years ago

app that queries whatever platform API to get the DPI (a la DeviceInfo App)

This could also be a script maybe running via adb