deveu
Posts: 0
Joined: Tue Apr 08, 2014 4:10 am

Is pixel density support for android development? dp & sp vs px or %

I have designed my app using fixed width/height (px) in my images, cell, grid etc. and it looks the way I want for low density pixel devices (eg galaxy tab 1280x800 149 ppi)

Unfortunately when I test in an asus fonepad 9 (1280x800 216 ppi) medium pixel density it no longer shows correctly.

I don't want to edit html as I want to still be able to use appery interface to continue building.

I am building for landscape so do not want to use percentages as I'd rather is goes off screen in portrait then "compress" (I will use force landscape in the android manifesto).

As I'm only developing for Android; does appery support dp (for image) and sp (for font)?

http://developer.android.com/training...

deveu
Posts: 0
Joined: Tue Apr 08, 2014 4:10 am

Is pixel density support for android development? dp & sp vs px or %

Hi,

I'm not sure I understand how it works. Can you give me an example of what I would replace this css code with:

code
img {
width: 900px;
height: 800px;
}
/code

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Is pixel density support for android development? dp & sp vs px or %

Hi,

You can set different element size depending on device pixel density:
http://www.w3.org/TR/css3-values/#res...

Return to “Issues”