Default display unit px or dp?

by Markus » Tue, 13 Oct 2009 05:17:00 GMT


Sponsored Links
 I always thought the default display unit would be pixels.

But when I run my application on WVGA800 in the emulator the lines are
five pixels wide even though I called Paint.setStrokeWidth(3). The
same seems to happen with Drawable.setBounds(); the value I provide
gets multiplied by 1.5 internally.

If that's the case, how can I specify pixels instead of dips if I want
pixels?

Can someone clarify this?

--~--~---------~--~----~------------~-------~--~----~



Default display unit px or dp?

by Romain Guy » Tue, 13 Oct 2009 05:20:09 GMT


 The Java APIs work only with pixels. Your app is probably running in
compatibility mode.






-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Default display unit px or dp?

by Markus » Tue, 13 Oct 2009 06:08:20 GMT


 Specifying android:minSdkVersion="4" in the android manifest did the
trick.

Thanks,
Markus




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Android Market ngambek

rekan2

ini saya punya android market, kalau di launch, terus close sendiri

kenapa yah

F

-- 
===============
"

2. Laporan pandangan mata nexian journey

Mantabbbsss.... Kayak reporter TVone... 

Wkakakaka


send from android tabled made in china

-----Original Message-----
From: "Herry SW" <mi...@hsw9900.com>
Sender: id-android@googlegroups.com
Date: Thu, 16 Dec 2010 05:52:19 
To: Id-android<id-android@googlegroups.com>; Indocell<indoc...@yahoogroups.com>
Reply-To: id-android@googlegroups.com
Subject: [id-android] Laporan pandangan mata nexian journey

-- 
===============
"

-- 
===============
"

3. Need to flash the screen green and red

4. INSTALL_PARSE_FAILED_NO_CERTIFICATES on Android-2.3

5. A ready for Android development Eclipse

6. Conversion to Dalvik format failed with error 1

7. Android location