A user reported that the Viewport meta tag is being ignored on his phone, but it works everywhere I've tested. Why would viewport work on one Android device and fail on another with the same OS version?

This is on a Phonegap 3.5 Android app that lays out everything to a set size (1800x1200) and then scales it to the device's size using viewport, like so:

var scale = windowHeight/appHeight;
var vport = "width=device-width, user-scalable=0, initial-scale="+scale+", 
    minimum-scale="+scale+", maximum-scale="+scale;
document.getElementById("viewport").setAttribute("content", vport);

This works fine everywhere I've tried it. Works in the latest Firefox and Chrome, works when compiled to Android and run on a Nexus 5 or a Nexus 10 or Galaxy 3, and also when run on the emulator for SDK 19, 20 or 21. The only place I've seen it fail is on SDK 17 (Android 4.2.2) or lower, but that should not be an issue, as I have android-minSdkVersion set to 19 (Android 4.4.2).

My problem is that a user reported that the Viewport setting is being ignored (the text is huge) on his Sony Xperia Z. So my question is, how is it possible for Viewport support to vary on phones with the same OS? For example, is it possible for two 4.4.2 phones to have different webkits?

Edit - is it possible that android-minSdkVersion is being ignored? I haven't been able to confirm the user's SDK version, but when I try to install the production apk to a 4.2.2 emulator, it lets me. I expected an "unsupported sdk" error or something...

Related posts

Recent Viewed