Open cvan opened 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.
@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!
@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.
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)
app that queries whatever platform API to get the DPI (a la DeviceInfo App)
This could also be a script maybe running via adb
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: