4

I preview my Android app in a Nexus 4 :). Here it is

enter image description here

But when I try to preview it on a Nexus 7 emulator, :(

enter image description here

I think that I'm having issues on supporting multiple screens on my game. My question is, how can I make it look bigger on nexus 7 or 10 or any other devices?

By the way, I placed my images (board.png,small_hole.png, big_hole.png and bg.png) on drawable-xhdpi folder (I'm using Android Studio)

Do you think I used the wrong layout or properties in my xml file? Is there something wrong in my code?

This is my xml layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg.png>

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/board"
        android:orientation="horizontal" >

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginLeft="20dp" >

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@drawable/big_hole" >
            </ImageView>
        </FrameLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_gravity="center_vertical">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_marginBottom="2dp">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/small_hole" >
                </ImageView>

                // paste 6 more ImageViews here

            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_marginTop="7dp">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/small_hole" >
                </ImageView>

               // paste 6 more ImageViews here

            </LinearLayout>

        </LinearLayout>

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginRight="20dp" >

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:scaleType="fitCenter"
                android:background="@drawable/big_hole" >
            </ImageView>

        </FrameLayout>

    </LinearLayout>

</RelativeLayout>

thank you guys..

reixa
  • 6,903
  • 6
  • 49
  • 68
tuty_fruity
  • 523
  • 1
  • 5
  • 18

2 Answers2

0

Try placing youre images in res/mdpi they will be streched to fit screens which are bigger (hdpi, xhdpi) (if i remember correctly the modyfiers are x1.5 and x2 for hdpi and xhdpi).

Alternatevly you can make a layout folder for larger screens ie. layout-sw720dp and create a new layout file there.

deWord
  • 46
  • 6
0

Nexus 4 access drawable-xhdpi resources and

Nexus 7 access drawable-large-tvdpi or drawable-sw600dp-tvdpi resources.

Nexus 10 access drawable-xlarge-xhdpi or drawable-sw720dp-xhdpi resources.

and u should resize ur image and u shud put in respective folders.

and Nexus 4 is 4.7 inch (768*1280) of size and Nexus 7 is 7 inch (800*1280) of size.

more info:

Different resolution support android

Application Skeleton to support multiple screen

Is there a list of screen resolutions for all Android based phones and tablets?

Community
  • 1
  • 1
M S Gadag
  • 2,057
  • 1
  • 12
  • 15