Another density question

hackhack

Active Member
Licensed User
Longtime User
Seems making a nice interface is hard, so I was thinking I would plan out an interface in my paint program. Ie, not in the emulator or anything.

But now I'm thinking I don't know what the density of my computer screen is, and perhaps something that looks nice on my computer screen would look weird on the tablet because density.

is that a correct worry? Should i contact the manufactures of the screen to try and figure out the density? :)
 

Gary Miyakawa

Active Member
Licensed User
Longtime User
My app was building a remote control replacement device on the Android platform. I was struggling with the 40+ buttons going into the right place on each type of device (plus the rotation of each device).

What I ended up doing was querying the device to find out the size (X and Y and Scale) of the screen. I then adjusted the button location and size based on the screen size. This did mean I had to figure out the location of each button as a percentage of the screen size but in the end, my layout works on any screen size/density that is out there (up to 2k by 4k).

There may have been other ways but this gave me absolute control over the location and preserved the image quality (and wasn't as hard as I thought it would be)..

Good luck!

Gary M
 
Upvote 0

hackhack

Active Member
Licensed User
Longtime User
The density of your computer screen is determined by Windows, not the screen manufacturer, and is usually 96 dpi unless you have changed it in Display Properties.

Ah, thanks. But now that confuses me - if windows just says all screens have the same density why couldn't Android? Or is it because all computer monitors are made the same way regardless of size?



My app was building a remote control replacement device on the Android platform. I was struggling with the 40+ buttons going into the right place on each type of device (plus the rotation of each device).

At least it isn't just me :)

What I ended up doing was querying the device to find out the size (X and Y and Scale) of the screen. I then adjusted the button location and size based on the screen size. This did mean I had to figure out the location of each button as a percentage of the screen size but in the end, my layout works on any screen size/density that is out there (up to 2k by 4k).

Ah yes, sounds like a good way. But could you figure out the location without having to know all possible configurations of possible devices?
 
Upvote 0

Gary Miyakawa

Active Member
Licensed User
Longtime User
Since I based the layout on the actual screen size and density.. I was able to make a "universal" layout (one time) that seems to work on everything I've tried...

Looking at the stats from admob and Android market, it seems to be working on all equipment... (I personally tested on Droid, DroidX, Atrix and Xoom)....

Good Luck,

Gary M
 
Upvote 0
Top