I am upgrading an old app that still detects the data field size and device manually, having plenty of redundant code that should be done by resources...
I assume there is a way to know both the data field size and the device where the data field is running, but I haven't been able to figure it out. Right now I'm doing this. I could add device name as resource string, but that wouldn't help much because I would still have to figure out the data field size. The reason why I need this is that I am using the full height and most of the width of the data field.
The code monster now looks something like this...
function is(dc) {
var width = dc.getWidth();
var height = dc.getHeight();
if ((width == 119) && (height == 78 || height == 79)) {
return "edge1000small";
} else if (width == 240) {
return "edge1000large";
} else if (width == 400 || width == 199) {
return "edge1000largelandscape";
} else if (width == 132) {
return "edge1000smalllandscape";
} else if (width == 200) {
return "edge520large";....