0

I look over some guide and tutorial but my problem still exists. I develop this application using small image to create button, text and background and i put it in res/drawable-ldpi directory. Then i see on web that i have to make images with this proportion: 3:4:6. So if my images were small, to create them for medium screen size, i have to take dimension of small image and multiple for 4/3, and for large screen multiple for 6/3=2. I see these here: Providing Resource. Now when i create just some images for normal screen ( medium ) i launch emulator with screen density 160 or 200, but the image still remain that used in ldpi. What can i do? Can you explain me well what is the problem with these multiple screen and how to solve this? This is a part of my android manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="spazio.digitale.com" android:versionCode="1"
android:versionName="1.0" android:installLocation="auto"
android:screenOrientation="portrait"
>
<uses-sdk android:minSdkVersion="7" android:maxSdkVersion="11" />
<uses-permission android:name="android.permission.INTERNET" />
<supports-screens android:normalScreens="true"
    android:smallScreens="true" android:largeScreens="true"
    android:anyDensity="true" />
alain.janinm
  • 19,951
  • 10
  • 65
  • 112
Jayyrus
  • 12,961
  • 41
  • 132
  • 214
  • have you seen this:http://stackoverflow.com/questions/5739353/webview-is-not-filling-the-whole-screen-of-device-or-emulator/5739694#5739694 – Hanry Oct 13 '11 at 07:42
  • yes! I edited main post with android manifest – Jayyrus Oct 13 '11 at 07:44

3 Answers3

1

use to pixels scale to design.. put this in manifest

<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"
/>
M410
  • 301
  • 3
  • 15
Jigar Patel
  • 436
  • 4
  • 9
0

For button, create images using 9-patch tool.

Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
0

With bitmaps, the rule of thumb is to start with the highest density first, and then scale it down, because it's always easier to scale down bitmaps than to scale them up.

Also, you seem to be confusing screen density with screen size. Do not worry about the screen size for now (unless you have one background image that takes the entire screen size, which I doubt). And no, the ratio you mentioned has nothing to do with screen sizes, that only applies to screen densities. Fix the density issue first and foremost. Then, once that's fixed, you can focus on making sure the layout fits the size.

And don't even bother with ldpi, that's only 0.2% of the market of handsets. You're just wasting your time optimizing for that density.

Stephan Branczyk
  • 9,363
  • 2
  • 33
  • 49
  • i've already done for that screen size! but the problem is that emulator, and i think device too, doesn't take image from drawable-mdpi e drawable-hdpi but still in drawable-ldpi – Jayyrus Oct 13 '11 at 07:51
  • and "clean" your code to make sure the resources aren't cached – Stephan Branczyk Oct 13 '11 at 07:57
  • so, here is an example of my layout: as you can see i use a background image. so i have to set layout to be universal with all screen size and than make image with different dimension to be fit in different screen size, true? – Jayyrus Oct 13 '11 at 08:01
  • also give me the sizes of your images at each density, I want to make sure the math works out. – Stephan Branczyk Oct 13 '11 at 08:01
  • low = 180x31, medium = 240x49, high = 360x62, not all the image have the same size :P this is only an example – Jayyrus Oct 13 '11 at 08:03
  • Yes, true. But first, work out the solution without the biggest background image, then once the density is worked out with the smaller images, you can work on the biggest image. – Stephan Branczyk Oct 13 '11 at 08:04
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/4219/discussion-between-stephan-branczyk-and-jackturky) – Stephan Branczyk Oct 13 '11 at 08:04
  • can u use chat? i come back in 5 min, coffe and i'm here – Jayyrus Oct 13 '11 at 08:05