I created a web-app, with a target of a Nexus 4 phone in mind, intended to be used in landscape orientation. It looks fine using chrome. But when I then used that HTML/CSS to create a Cordova App, the display is way too big for the phone. I have tried many things suggested by many people to no avail. As an example, if I have the following div defined:
#content {
border: thin ;
border-style: solid ;
width: 960px ;
height: 475px ;
}
and as a web-app, the border fits nicely in the display of the Nexus 4 using chrome. But I have to reduce that 960px down to around 570px to get it to fit when it is a App installed via cordova. I am doing a 'fixed' position for all my divs inside that #content div. There is only 1 target device that this App will get used on - I don't care about any other devices. (Yes, I really want to do that). I don't want scrolling.
I tried setting the target-densitydpi=medium-dpi" as suggested in Phonegap/Cordova App Shrink too small on high resolution device like Samsung Galaxy S4 and Phonegap Application text and layout too small
I've tried setting initial-scale=1.0 like many people suggest. I've tried 1.5 and 2.0 which makes it even bigger, but 0.5 does not make it smaller. I tried adding preference name="EnableViewportScale" value="true" to my config.xml as suggested by PhoneGap: Scaling down a webpage with viewport
While I have tried many combinations, my basic viewport definition is:
<meta name="viewport" content="user-scalable=no,
initial-scale=1, maximum-scale=1, minimum-scale=1,
width=device-width, height=device-height,
target-densitydpi=medium-dpi" />
Nothing has worked for me.
I have no idea how this stuff works and I have very little experience with front-end and mobile App technologies. I see no relationship between the advertised hardware devices resolution and what I see on a web-app, and what I see on a native App. I don't know why they would behave differently on the same device with the same CSS.
Any suggestions and/or pointers would be greatly appreciated.