Images from drawable-nodpi getting scale

by Wri » Fri, 22 Oct 2010 05:27:43 GMT


Sponsored Links
 I recently rebuilt my project to target 2.2 from 2.1.

In the old project, I did not specify a target SDK (the manifest did
not contain something like: <uses-sdk android:minSdkVersion="8" />).
This gave me an error in the console when running, but everything
worked fine so I didn't fool with it.

The new project now uses <uses-sdk android:minSdkVersion="8" /> in the
manifest.

But now my drawables from the /drawable-nodpi/ folder are loading with
scaling, making them much smaller and significantly changing the
desired visuals.

If I cut out the <uses-sdk android:minSdkVersion="8" /> tag from my
manifest, they load properly without scaling.

Even when loading my images like so:

                BitmapFactory.Options opts = new
BitmapFactory.Options();
                opts.inScaled = false;
                Bitmap bm = BitmapFactory.decodeResource(_resources,
resId, opts);

They are still scaled when I declare the minimum SDK in the manifest,
but not scaled if I remove that tag.

Why is this happening? How can I load them without scaling while still
declaring the minimum SDK?

--



Images from drawable-nodpi getting scale

by TreKing » Fri, 22 Oct 2010 23:44:20 GMT


 



Be careful here ... "target SDK" is NOT the same as "minSDK". Was that a
typo or are you not clear on this?



So you're app is designed to work ONLY on 2.2 (SDK 8) or is that what your
"target" (what you're testing on) is?



This I don't know - I haven't had to deal with all this screen support stuff
as the defaults work out fine for me for now, but I would double check you
really want min SDK to 8 and read over this:
 http://developer.android.com/guide/practices/screens_support.html 

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

--


Sponsored Links


Images from drawable-nodpi getting scale

by Stephen Jungels » Sat, 23 Oct 2010 00:20:19 GMT


 In addition to what was said above, if you study the
<supports-screens> directive carefully and set it properly in your
manifest, that will most likely clear things up.





>



Images from drawable-nodpi getting scale

by Kostya Vasilyev » Sat, 23 Oct 2010 01:44:45 GMT


 If you don't specify <supports-screens> or minSdk, then your app will 
run in compatibility mode, meaning that it's given an HVGA (240x320) 
"virtual screen", which is then scaled as a whole. So your images will 
be scaled.


If you specify minSdk >= 4, or <supports-screens>, then scaling should 
work as expected.


Except one case - if you're running on 1.5.

Since 1.5 didn't have support for multiple resolutions, it doesn't 
understand alternative resource qualifiers and might occasionally grab 
the wrong image. To prevent this, add "-v4" at the end of your qualified 
resource directory names, e.g. "drawable-hdpi-v4", "drawable-ldpi-v4". 
This makes those directories invisible to 1.5.


-- Kostya

22.10.2010 20:20, Stephen Jungels :
In addition to what was said above, if you study the <supports-screens> directive carefully and set it properly in your manifest, that will most likely clear things up.
In the old project, I did not specify a target SDK (the manifest did not contain something like:<uses-sdk android:minSdkVersion="8" />).
Be careful here ... "target SDK" is NOT the same as "minSDK". Was that a typo or are you not clear on this?
The new project now uses<uses-sdk android:minSdkVersion="8" /> in the manifest.
So you're app is designed to work ONLY on 2.2 (SDK 8) or is that what your "target" (what you're testing on) is?
Why is this happening? How can I load them without scaling while still declaring the minimum SDK?
This I don't know - I haven't had to deal with all this screen support stuff as the defaults work out fine for me for now, but I would double check you really want min SDK to 8 and read over this: http://developer.android.com/guide/practices/screens_support.html ------------------------------------------------------------------------------------------------- TreKing - Chicago transit tracking app for Android-powered devices --



Other Threads

1. xor algorithm used when gc in dalvik

The gc in dalvik is not very difficult.
I can understand most things and how they work.
But one thing I don't understand.
When freeing the memory allocated by mspace which is set int the bits
of heap bitmap, it uses xor operating to calculate what should be
collected.
Suppose like this:
After last gc      after this gc       result           should be
collected
0                      0                      0                 N
1                      1                      0                 N
1                      0                      1                 Y
0                      1                      1                 Y(Is
this right?)

The first three cases are obviously correct.
But the last case perhaps is wrong.
Although it was not used before last gc, it is used since then.
It should not be collected as garbage I think.
Can anyone explain why?

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. lock screen always portrait

I want to know how to set it always landscape, thx

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. booting using AutoBoot

4. restricting edittext control's max chars

5. Use Camera API for normal quality pictures

6. noHistory="true" rocks

7. How to select/install a locale other than English