Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPDB JSON Entry for new devices. #162

Open
devasur opened this issue Oct 14, 2016 · 5 comments
Open

DPDB JSON Entry for new devices. #162

devasur opened this issue Oct 14, 2016 · 5 comments

Comments

@devasur
Copy link

devasur commented Oct 14, 2016

Can someone please explain how to create a DPDB entry for a new phone? Galaxy S7, iPhone 7
@borismus

Roughly:
http://btco-code.appspot.com/debug/screen_test.html gives results
Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13F69 Safari/601.1
computed resolution: 2208 x 1242
screen.width: 414
screen.height: 736
screen.availWidth: 414
screen.availHeight: 736
window.devicePixelRatio: 3

which can be translated (some how) to dbdb entry

{
"type": "ios",
"rules": [ { "res": [ 1242, 2208 ] } ],
"dpi": [ 453.6, 458.4 ],
"bw": 4,
"ac": 1000
}

@yonglwei
Copy link

yonglwei commented Nov 17, 2016

@devasur did u find the method of calculation? It also bothers me
Add more details:
UA: Mozilla/5.0 (Linux; Android 6.0.1; MI NOTE LTE Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.81 Mobile Safari/537.36
computed resolution: 5285.5 x 2972.75
screen.width: 1081
screen.height: 1922
screen.availWidth: 1081
screen.availHeight: 1922
window.devicePixelRatio: 2.75

@borismus
Copy link
Owner

cc @btco

On Thu, Nov 17, 2016 at 12:17 AM Yonglin Wei [email protected]
wrote:

@devasur https://github.com/devasur did u find the method of
calculation? It also bothers me


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#162 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAQ8gJ2rCMYuBDPLShxyiwL1QCxPClE0ks5q_A2KgaJpZM4KWp3m
.

@garethwilliams
Copy link

I've been looking into this and think I've found the method. The 2 numbers after "dpi" are xdpi and ydpi. These are the actual precise dots per inch on the x and y axis on a devices display. You can find them for any device you have from https://play.google.com/store/apps/details?id=com.jphilli85.deviceinfo

bw is bezel width. Looks like it's 3 for most latest android devices.

I used this to hack a fix for the Pixel XL while waiting for the official Google dpdb to be updated. Hope it helps

@yonglwei
Copy link

yonglwei commented Nov 20, 2016

Same device to different web container, show different device parameters:
in android webview
UA: Mozilla/5.0 (Linux; Android 6.0.1; MI NOTE LTE Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.81 Mobile Safari/537.36
computed resolution: 5285.5 x 2972.75
screen.width: 1081
screen.height: 1922
screen.availWidth: 1081
screen.availHeight: 1922
window.devicePixelRatio: 2.75

in firefox for android
UA: Mozilla/5.0 (Linux; Android 6.0.1; Mobile; rv:47.0) Gecko/47.0 Firefox/47.0
computed resolution: 1920.000015258789 x 1080.0000085830688
screen.width: 396
screen.height: 704
screen.availWidth: 396
screen.availHeight: 704
window.devicePixelRatio: 2.7272727489471436

in firefox, it's ok to enter VR mode. but fail in webview
figure1: device params in webview
com example webview
figure 2: device params in firefox
org mozilla firefox_beta
figure 3: vr mode in webview
vr_com example webview
figure 4: vr mode in firefox
vr_org mozilla firefox_beta

Why has different params?

@Ariel-zhangyue
Copy link

@garethwilliams
Hey~ Do you know how to find "device" ["rules"] and ["ac"] ?
I have try many versions and seems still cannot get correct device parameters..
Here is my device information...Thanks in advance!
device_info1
device_info2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants