[android-developers] Re: Resource Directory Qualifier Limitation?

2010-08-03 Thread Greg
Yes, this is definitely the issue - however now I am lost trying to
decode what these fields are.  After searching through previous posts
and testing, it looks like inScaled = false will not scale any
resource even if it's resource directory indicates it should, and
setting it to true gives me this default behavior.

Can someone shed some light on the right combinations of density
settings such that if a resource is found in the specific density
folder that matches the target density it does not perform scaling and
if it is found in drawable it does?

Thanks,
-Greg

On Aug 3, 7:34 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Mon, Aug 2, 2010 at 7:14 PM, Greg gdub...@yahoo.com wrote:
  Mark, thanks for getting back to me.  I zipped up my sample project
  that has a surfaceview and a thread (based off of the lunar lander
  example) just because it is a very similar format to my application.
  I uploaded it here:

 http://www.megaupload.com/?d=VKBXZU9C

  The only thing it does is draw a background image and a smaller image
  - the blue square - on top of it.  This is what I want to accomplish
  in my app - a high res background and a scalable smaller image.  In
  the top level of the folder you will see a screen shot of what I see
  when running it on a 480x800 emulator with 2.2.  You can see that it
  has loaded and correctly scaled the blue square from the drawable
  folder, yet it has taken the background image from the hdpi folder and
  scaled it as if it was also located in drawable.  I put some text to
  make it easier to see relatively what part of the image you are
  looking at and unfortunately, the normal/hdpi text just got cut off,
  but you can still tell that it must be the zoomed hdpi image.

  I am hoping I am making a fundamental mistake in my manifest or
  something that you can quickly point out...

 Well, I see what you're seeing.

 My best guess is that it has to do with
 BitmapFactory.decodeResource(). I have not used this method before.
 Looking at BitmapFactory.Options, I see a variety of density-related
 settings. It is possible you will need to fiddle with these.

 For example, if you nuke your view and use an ImageView showing the
 background image, it shows up fine.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android Development Wiki:http://wiki.andmob.org

-- 
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: Resource Directory Qualifier Limitation?

2010-08-03 Thread Mark Murphy
On Mon, Aug 2, 2010 at 7:14 PM, Greg gdub...@yahoo.com wrote:
 Mark, thanks for getting back to me.  I zipped up my sample project
 that has a surfaceview and a thread (based off of the lunar lander
 example) just because it is a very similar format to my application.
 I uploaded it here:

 http://www.megaupload.com/?d=VKBXZU9C

 The only thing it does is draw a background image and a smaller image
 - the blue square - on top of it.  This is what I want to accomplish
 in my app - a high res background and a scalable smaller image.  In
 the top level of the folder you will see a screen shot of what I see
 when running it on a 480x800 emulator with 2.2.  You can see that it
 has loaded and correctly scaled the blue square from the drawable
 folder, yet it has taken the background image from the hdpi folder and
 scaled it as if it was also located in drawable.  I put some text to
 make it easier to see relatively what part of the image you are
 looking at and unfortunately, the normal/hdpi text just got cut off,
 but you can still tell that it must be the zoomed hdpi image.

 I am hoping I am making a fundamental mistake in my manifest or
 something that you can quickly point out...

Well, I see what you're seeing.

My best guess is that it has to do with
BitmapFactory.decodeResource(). I have not used this method before.
Looking at BitmapFactory.Options, I see a variety of density-related
settings. It is possible you will need to fiddle with these.

For example, if you nuke your view and use an ImageView showing the
background image, it shows up fine.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Development Wiki: http://wiki.andmob.org

-- 
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: Resource Directory Qualifier Limitation?

2010-08-02 Thread Greg
Mark, thanks for getting back to me.  I zipped up my sample project
that has a surfaceview and a thread (based off of the lunar lander
example) just because it is a very similar format to my application.
I uploaded it here:

http://www.megaupload.com/?d=VKBXZU9C

The only thing it does is draw a background image and a smaller image
- the blue square - on top of it.  This is what I want to accomplish
in my app - a high res background and a scalable smaller image.  In
the top level of the folder you will see a screen shot of what I see
when running it on a 480x800 emulator with 2.2.  You can see that it
has loaded and correctly scaled the blue square from the drawable
folder, yet it has taken the background image from the hdpi folder and
scaled it as if it was also located in drawable.  I put some text to
make it easier to see relatively what part of the image you are
looking at and unfortunately, the normal/hdpi text just got cut off,
but you can still tell that it must be the zoomed hdpi image.

I am hoping I am making a fundamental mistake in my manifest or
something that you can quickly point out...

On Aug 1, 7:15 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Sun, Aug 1, 2010 at 7:10 PM, Greg gdub...@yahoo.com wrote:
  Do I
  have to have all of my resources in the drawable directory and let
  Android scale things or have three times the number of image files by
  having resources in all three directories to make sure all resources
  are found and treated consistently?

 I would not think so.

  I am hoping this is some weird
  emulator bug that does not reflect how the real OS would treat things.

 I would not think that, either.

 Unfortunately, my two thoughts are in some amount of conflict, apparently. :-(

 Can you create a standalone sample project that demonstrates your
 phenomenon, and post it somewhere?

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android 2.2 Programming Books:http://commonsware.com/books

-- 
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: Resource Directory Qualifier Limitation?

2010-08-02 Thread Mark Murphy
I will try to take a peek at this tomorrow evening.

On Mon, Aug 2, 2010 at 7:14 PM, Greg gdub...@yahoo.com wrote:
 Mark, thanks for getting back to me.  I zipped up my sample project
 that has a surfaceview and a thread (based off of the lunar lander
 example) just because it is a very similar format to my application.
 I uploaded it here:

 http://www.megaupload.com/?d=VKBXZU9C

 The only thing it does is draw a background image and a smaller image
 - the blue square - on top of it.  This is what I want to accomplish
 in my app - a high res background and a scalable smaller image.  In
 the top level of the folder you will see a screen shot of what I see
 when running it on a 480x800 emulator with 2.2.  You can see that it
 has loaded and correctly scaled the blue square from the drawable
 folder, yet it has taken the background image from the hdpi folder and
 scaled it as if it was also located in drawable.  I put some text to
 make it easier to see relatively what part of the image you are
 looking at and unfortunately, the normal/hdpi text just got cut off,
 but you can still tell that it must be the zoomed hdpi image.

 I am hoping I am making a fundamental mistake in my manifest or
 something that you can quickly point out...

 On Aug 1, 7:15 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Sun, Aug 1, 2010 at 7:10 PM, Greg gdub...@yahoo.com wrote:
  Do I
  have to have all of my resources in the drawable directory and let
  Android scale things or have three times the number of image files by
  having resources in all three directories to make sure all resources
  are found and treated consistently?

 I would not think so.

  I am hoping this is some weird
  emulator bug that does not reflect how the real OS would treat things.

 I would not think that, either.

 Unfortunately, my two thoughts are in some amount of conflict, apparently. 
 :-(

 Can you create a standalone sample project that demonstrates your
 phenomenon, and post it somewhere?

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android 2.2 Programming Books:http://commonsware.com/books

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




-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 2.9 Available!

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