Screen Density Issue

Put your problem here if it does not fit any of the other categories.

Screen Density Issue

Postby Downie » Tue Jun 22, 2010 9:01 am

I was wondering if anyone else was having this problem or whether I was doing something wrong.

I am trying to get the density of my device so I can position some UI in OpenGL. I am using the Motorola Milestone and know that it has a density of ~1.5. If I use a hard-coded density of 1.5 then my UI works correctly. However if I call getResources().getDisplayMetrics().density from context, it always returns a value of 1.

Any ideas?

Thanks in advance
Downie
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Jun 22, 2010 8:59 am

Top

Re: Screen Density Issue

Postby nicholas.hauschild » Wed Jun 23, 2010 2:15 am

Not sure if you have looked this up, but it seems to have a lot of information that may help explain some things for you.

http://developer.android.com/reference/ ... ml#density
nicholas.hauschild
Master Developer
Master Developer
 
Posts: 310
Joined: Fri Dec 04, 2009 4:50 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 13 guests