I have a canvas/bitmap on which my app does it's painting (basically a rearranged version of FingerPaint from the API Demos). Every time width and height are required in methods such as Bitmap.createBitmap() or canvas.drawRect() I have width and height set as follows:
Display display = getWindowManager().getDefaultDisplay();
width = display.getWidth();
height = display.getHeight() - 50;
The reason for the "- 50" is to ignore the area of the Notification Bar / Title Bar at the top of the screen, so the only area that can be drawn upon is actually visible.
Now I know very little about pixels and screen density and how that all interact so my question is.. Is subtracting 50 to make up for the Notification/Title Bars a bad idea? Might it be -50 on the G1 emulator (and Motorola Droid as I've verified) but say -60 on the Nexus One? Or am I good and this is cross-device compatible?