Martin,
Game code should be adapted to use real screen dimensions.
You will most likely want to have high-res versions of your game
artwork, and possibly low-res versions, provided in the application.
Having high-res (hdpi) images is important so your game looks crisp on
high-res devices.
Low-res images can be automatically created by Android at load time from
regular images, and most look ok. Some images, though, don't look good
if loaded this way, and so should have high quality low-res (ldpi)
provided in the application.
Detailed information on this can be found in the Android Development Guide:
http://developer.android.com/guide/practices/screens_support.html
For best compatibility (from 1.5 on), your resources should be placed into:
res/drawable-mdpi-v4
res/drawable-hdpi-v4
res/drawable
Using "-v4" hides high-res and low-res images from Android 1.5, so it
only sees default resources (320x480, mdpi), as it should.
-- Kostya
02.10.2010 18:20, Martin пишет:
Thank you!! :-)
My game worked perfekt with android:targetSdkVersion="3". I changed it
to "8" and all my Bitmaps, which I draw with canvas.drawBitmap are
cropped after this change.
I draw my Bitmaps, for example the background-bitmap like this:
canvas.drawBitmap(Global.imageBackground,
new Rect(0,0,320,480),
new
Rect(0,0,Global.screen_width,Global.screen_height), null);
The Bitmap Global.imageBackground has the dimensions 320x480.
Do all my Bitmaps get bigger, when I change the
android:targetSdkVersion to "8"?
How can I solve this problem?
Greetings, Martin
On 2 Okt., 13:50, Kostya Vasilyev<[email protected]> wrote:
Applications built with sdk 3 (Android 1.5) and not having
supports-screens tag in the manifest are assumed to only be able to deal
with HVGA / mdpi screens. Android runs them in compatibility mode, and
presents "fake" screen dimensions / density to the application (HVGA,
320x480, 160 dpi). Whatever application draws at this size is then
scaled to fit the entire (larger/smaller) screen.
Applications built with sdk 4 (Android 1.6 and later) are assumed by
default to have support for real screen sizes / densities. Android
doesn't emulate HVGA, and reports real screen size / density to such
applications.
-- Kostya
02.10.2010 15:30, Martin пишет:
Hi!
I am debugging my game directly on the device (Nexus One), so the
width and height of the screen should NEVER change, am I right?
When I start
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
System.out.println(dm.widthPixels+" "+dm.heightPixels);
with android:targetSdkVersion="3" in the AndroidManifest.xml i get
different values than with android:targetSdkVersion="8".
How can this be?
Greetings, Martin
--
Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com
--
Kostya Vasilyev -- WiFi Manager + pretty widget -- 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en