Reputation: 692
I am building an universal iOS app with JS/HTML5/CSS3 and Phonegap. I am targeting the iPad, iPhone (old) and iPhone5, both orientations (portrait/landscape each).
Since I can't accomplish just ONE markup for all versions, I am wondering how I deal with that. I want to have one markup for one device with both orientations, so I will have three markups.
Is the app able to detect which markup it needs depending on the device it runs? And if so, how? :)
Thanks!
Upvotes: 1
Views: 266
Reputation: 3934
Yes you can. You just have to make a device.model. This return the also the version. For exemple you can have iPad1.1 (for the first one)
function onDeviceReady() {
if (device.model == "iPad1,1") {
//DO SOMETHING
}
else if (device.model == "iPad2,3") {
//DO SOMETHING ELSE
}
}
For exemple, I use this to active or not the possibility to take picture from my device. if it's iPad1 I disable the functionnality.
Hope it helps ;)
Upvotes: 2