Here's what works for me:

First, in your manifest XML, make sure you have <supports-screens
android:anyDensity="true" />. AFAIK, if that's set to false, the
platform always pre-scales your widget to MDPI-standard measurements.

Then in your ACTION_APPWIDGET_UPDATE handler, you'll need to get an
AppWidgetProviderInfo object (using
AppWidgetManager.getAppWidgetInfo). With that, reference its minHeight
property (like providerInfo.minHeight) to get the real pixel size of
the widget.

String

On May 10, 9:15 pm, James <james...@gmail.com> wrote:
> I'm writing a widget at the moment. It's supposed to fill one cell, so
> I've set the size to be 72dp by 72dp. The layout has a linear layout
> containing a 72x72dp ImageView.
>
> In onUpdate(), I call views.setImageViewBitmap with a 72px x 72px
> bitmap. This worked fine under Android 1.5 on my G1, but now I have a
> Nexus One, the image gets stretched to fill the cell, and looks
> blurry.
>
> What is the correct, device independent way, to work out how big the
> bitmap should be?
>
> James Ots
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to