Re: [android-developers] Re: When to set android:anyDensity to what value?

2011-04-11 Thread lbendlin
Our application is used when driving,  and spends most of its life as a 
service, Not a single user has yet complained about grainy or jagged images, 
menu icons or some such in the UI part. The service occasionally shows 
custom toasts that cover the whole screen, and for these we use 300x300 
pixel images . Looks perfect across all devices (although it has a bit of a 
performance hit on the older phones, but then again it is infrequent). YMMV

-- 
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

Re: [android-developers] Re: When to set android:anyDensity to what value?

2011-04-11 Thread Kostya Vasilyev

11.04.2011 14:58, lbendlin пишет:
Our application is used when driving, and spends most of its life as a 
service, Not a single user has yet complained


They don't want to risk their life by looking closer :)

about grainy or jagged images, menu icons or some such in the UI part. 
The service occasionally shows custom toasts that cover the whole 
screen, and for these we use 300x300 pixel images . Looks perfect 
across all devices (although it has a bit of a performance hit on the 
older phones, but then again it is infrequent). YMMV 


--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
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


Re: [android-developers] Re: When to set android:anyDensity to what value?

2011-04-11 Thread lbendlin
That's exactly the point. Mobile utility applications have very short UI 
usage cycles. Users usually don't take the time to look for that jagged 
edge, they get the information they need and carry on.
 
(Having said that I still get wound up each time I look at the built in 
Android web browser because I can't help noticing the horizontal 
misalignment between the address text field and the load progress bar... 
Pathetic, I know.)

-- 
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

[android-developers] Re: When to set android:anyDensity to what value?

2011-04-10 Thread MarcoAndroid
So I should set it to true even when my app doesn't include resources
to accommodate any screen density (suppose I'm lazy so I don't create
any size- or density specific resources)?

I'm wondering this because taken from:
http://developer.android.com/guide/topics/manifest/supports-screens-element.html
it says that if you set anyDensity to true it means the application
includes resources to accommodate any screen density.

But I'm not including any of these explicitly,  so what happens then
scaling wise when anyDensity=true?



On 5 apr, 23:09, Dianne Hackborn hack...@android.com wrote:
 Always set it to true...  or better, just make android:targetSdkVersion =
 4.  Having it false is only for compatibility with old apps that were
 written before there was a concept of density in the APIs.  Using this
 compatibility mode can cause some undesirable artifacts such as text metrics
 being slightly inconsistent with actual rendering.









 On Tue, Apr 5, 2011 at 1:42 PM, MarcoAndroid marco...@gmail.com wrote:
  Hello there,

  I've read
 http://developer.android.com/guide/practices/screens_support.html
  and

 http://groups.google.com/group/android-developers/browse_thread/threa...
  and

 http://groups.google.com/group/android-developers/browse_frm/thread/5...
  and more related sources.

  Still, what and when to set android:anyDensity to I find hard to
  figure out.

  So, are these conclusions correct:

  1- android:anyDensity has been introduced really only for older apps
  (1.6 level 4 or lower) because those were most likely built with
  hardcoded density-dependent values like 'px'? And apps with level
  before 4 even don't understand density dependent resource directories
  like res/drawable-hdpi?
  By setting android:anyDensity=false, Android tries to scale those
  resources that use px values and in 'res/drawable' to match the
  device's real screen density.
  From level 5 onwards it is a well-known best-practice to always use dp
  and sp and density dependend resource directories, so usually apps
  take care themselves of being independent using those. And thus
  normally for those apps android:anyDensity=true is sufficient (no
  auto-density-scaling).

  2- If android:anyDensity=false are these density dependend resource
  directories plainly ignored as mentioned in this thread?

 http://groups.google.com/group/android-developers/browse_frm/thread/5...
  But: how does the android:anyDensity=true or false relate to
  resources that you might have put in res/drawable-mdpi and res/
  drawable-hdpi etc? Does that setting then only have effect for those
  density resources you didn't specify in any configuration specific
  density-directory, and how?

  3- And what if I'm lazy and for any app I make I don't want to create
  density specific resources (like images), so only have the 'res/
  drawable' dir, but do use dp and sp everywhere... What should
  android:anyDensity be set to then? My guess is false so Android will
  alwyas scale my resources from 'drawable'...

  Regards,
  Marco

  --
  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

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

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

-- 
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


[android-developers] Re: When to set android:anyDensity to what value?

2011-04-10 Thread MarcoAndroid

In short: am I always safe with anyDensity=true as long as I use dp
and sp as I read in Table 2 here: 
http://developer.android.com/guide/practices/screens_support.html:
'That is, as long as your application uses density-independent units
(dp) for screen layout sizes, then it will perform properly on
different densities when this attribute is set to true'?
Even for a 1.5 app?

Or are there more rules like *having* to provide resources to
accomodate any screen density (as it says here:
http://developer.android.com/guide/topics/manifest/supports-screens-element.html:
setting anyDensity to true means the application includes resources
to accommodate any screen density?)

-- 
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


Re: [android-developers] Re: When to set android:anyDensity to what value?

2011-04-10 Thread Kostya Vasilyev

There are really two related things here:

1 - Setting anyDensity to true or minSdk/targetSdk to 4 or above means 
that your application sees the real screen size/resolution/density at 
runtime. Android will scale your images as needed when they are loaded, 
so you won't get missing resource exceptions, but they may not always 
look very good, especially when scaling up, say from -mdpi to -hdpi density.


You can look at Android's own resources as an example of this scheme:

android-sdk-windows\platforms\android-X\data\res

has drawable-mdpi and drawable-hdpi, but no drawable-ldpi, relying on 
runtime scaling from -mdpi to -ldpi.


2 - Using sp and dp units in your layouts makes them scale with 
density, so one layout should work for all densities (although you 
should still test them on a variety devices, because of different screen 
aspect ratios, this is especially apparent with QVGA screens).


-- Kostya

10.04.2011 23:10, MarcoAndroid пишет:

In short: am I always safe with anyDensity=true as long as I use dp
and sp as I read in Table 2 
here:http://developer.android.com/guide/practices/screens_support.html:
'That is, as long as your application uses density-independent units
(dp) for screen layout sizes, then it will perform properly on
different densities when this attribute is set to true'?
Even for a 1.5 app?


--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
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


Re: [android-developers] Re: When to set android:anyDensity to what value?

2011-04-10 Thread lbendlin
I have minSDK set to 3, anyDensity to true, and have just a single resource 
folder. Works fine for all devices from 1.5 all the way up to 3.x

-- 
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

[android-developers] Re: When to set android:anyDensity to what value?

2011-04-10 Thread Zsolt Vasvari
Can't imagine that would look very good on an XHDPI screen.

On Apr 11, 6:57 am, lbendlin l...@bendlin.us wrote:
 I have minSDK set to 3, anyDensity to true, and have just a single resource
 folder. Works fine for all devices from 1.5 all the way up to 3.x

-- 
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


Re: [android-developers] Re: When to set android:anyDensity to what value?

2011-04-10 Thread Dianne Hackborn
Well you'll get 2x doubled images...  but the screen itself is 2x the
density of an mdpi screen, so the app's icons will mostly just look like
they are on an mdpi screen. :}

On Sun, Apr 10, 2011 at 5:49 PM, Zsolt Vasvari zvasv...@gmail.com wrote:

 Can't imagine that would look very good on an XHDPI screen.

 On Apr 11, 6:57 am, lbendlin l...@bendlin.us wrote:
  I have minSDK set to 3, anyDensity to true, and have just a single
 resource
  folder. Works fine for all devices from 1.5 all the way up to 3.x

 --
 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




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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

-- 
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