Screen resolutions Problem

Put your problem here if it does not fit any of the other categories.

Screen resolutions Problem

Postby spikey100 » Sat Feb 11, 2012 6:56 am

I have been creating an application that runs successfully on several devices, with different screen sizes and resolutions.
When I install it on the new HTC Evo 3D it does not use the whole screen.

Is there a way to make the application use the whole of the qHD screen (960 * 540)?

Thanks
spikey100
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Nov 05, 2011 5:04 am

Top

Re: Screen resolutions Problem

Postby jonbonazza » Sat Feb 11, 2012 9:46 pm

What do you mean it doesn't use the "whole screen"? Can you elaborate?
jonbonazza
Master Developer
Master Developer
 
Posts: 665
Joined: Thu Jul 15, 2010 2:58 pm
Location: WV USA

Re: Screen resolutions Problem

Postby spikey100 » Sun Feb 12, 2012 12:58 am

The background image leaves space to the left and right and bottom.
The full screen is 93mm wide by 53mm high. Our image leaves an 11mm space each side and 6mm at the bottom.

This is how we measure, it works on every other device we have tried. Maybe there is a better way.

Code: Select all
        //get the window size
        Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
        winSize.x = display.getWidth();
        winSize.y = display.getHeight();
spikey100
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Nov 05, 2011 5:04 am

Re: Screen resolutions Problem

Postby jonbonazza » Sun Feb 12, 2012 2:19 am

Are you not using XML to place components? If so, you should use device independant pixels, as well as seperate layouts for different pixel density categories (i.e. hdpi, ldi, mdpi, etc..).

There shouldn't be a problem like this with the device you mentioned, so it must be something you are doing wrong in your code/project.
jonbonazza
Master Developer
Master Developer
 
Posts: 665
Joined: Thu Jul 15, 2010 2:58 pm
Location: WV USA

Re: Screen resolutions Problem

Postby spikey100 » Sun Feb 12, 2012 3:17 am

I use XML where there is no alternative, most of my screens have a basic XML layout that I manipulate in code. I do use dip. The screen scales correctly on a Galaxy S, Sony Tablet and the emulator set for HTC Legend.

I agree it is something wrong in my code, unfortunately I can't find the solution.
spikey100
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Nov 05, 2011 5:04 am

Re: Screen resolutions Problem

Postby jonbonazza » Sun Feb 12, 2012 8:23 pm

can you paste the snippet of code where you setup your layout?
jonbonazza
Master Developer
Master Developer
 
Posts: 665
Joined: Thu Jul 15, 2010 2:58 pm
Location: WV USA

Top

Re: Screen resolutions Problem

Postby spikey100 » Mon Feb 13, 2012 6:37 am

Code below loads the screen.

Code: Select all
super.onCreate(savedInstanceState);
        // requesting to turn the title OFF
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        // making it full screen
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        // layout this screen
        setContentView(R.layout.main);


.xml layout file

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center"
    android:background="@drawable/bubbleblue480x800">
    <ImageButton
        android:id="@+id/btn_g1"
        android:layout_width="200dp"
        android:layout_height="50dp"
        android:layout_centerHorizontal="true"
        android:adjustViewBounds="true"
        android:scaleType="fitCenter"
        android:clickable = "true"
        android:onClick="mainClickHandler"
        android:src="@drawable/g1_button"
        android:background="#0000"
        ></ImageButton>
    <ImageButton
        android:id="@+id/btn_g2"
        android:layout_width="160dp"
        android:layout_height="50dp"
        android:adjustViewBounds="true"
        android:scaleType="fitCenter"
        android:layout_below = "@id/btn_g1"
        android:layout_centerHorizontal="true"
        android:clickable = "true"
        android:onClick="mainClickHandler"
        android:src="@drawable/g2_button"
        android:background="#0000"
        ></ImageButton>
    <ImageButton
        android:id="@+id/btn_g3"
        android:layout_width="160dp"
        android:layout_height="50dp"
        android:adjustViewBounds="true"
        android:scaleType="fitCenter"
        android:layout_below = "@id/btn_g2"
        android:layout_centerHorizontal="true"
        android:clickable = "true"
        android:onClick="mainClickHandler"
        android:src="@drawable/g3_button"
        android:background="#0000"
        ></ImageButton>
    <ImageButton
        android:id="@+id/quit_butt"
        android:layout_height="50dp"
        android:layout_width="120dp"
        android:scaleType="fitCenter"
        android:layout_below = "@id/btn_g3"
        android:layout_centerHorizontal="true"
        android:clickable = "true"
        android:onClick="mainClickHandler"
        android:src="@drawable/quit_button"
        android:background="#0000"
        ></ImageButton>

</RelativeLayout>
spikey100
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Nov 05, 2011 5:04 am

Re: Screen resolutions Problem

Postby spikey100 » Mon Feb 13, 2012 12:18 pm

Adding the following line to the manifest solved the screen size issue with the HTC evo3d.

Code: Select all
<uses-sdk android:minSdkVersion="8"  />


Unfortunately it stopped all the automatic scaling that was allowing the application to run on multiple screen sizes.
The only page that now scales correctly is the one that built entirely in code with no XML.

There must be some other settings that are required when using android:minSdkVersion?
spikey100
Junior Developer
Junior Developer
 
Posts: 18
Joined: Sat Nov 05, 2011 5:04 am

Re: Screen resolutions Problem

Postby hgft » Wed Feb 29, 2012 9:36 am

Coach Outlet Online Sale is with imperfections which consist of cuts, scars, and scratches will exist, the grain in its organically grown problem has between one of the most considerable dietary fibers strength, and getting a last end result between one of the most considerable durability. The grain also has organically grown breathability, resulting in increased comfort using the path from the wearer.

Louis Vuitton Outlet could possibly be one of the most well-known is not necessarily one of the most ideal for you! possibly the most current quarter round shoulder bag with fluorescent color provides you a shine in the moment, desire to possess the urge to it immediately; But possibly your pores and skin color could possibly be the earth beside the handbag could possibly be one of the most make you fondle admiringly joker choice.

Louis Vuitton Outlet supply reduce, the weakening from the role, tiny haystack in slender whole body once more and again. the right way to purchase Louis Vuitton bags That's between the powerful cohesion when Cunningham lancelet find yourself isolated point, allow wind and bad weather insulation, yr pursuing year, pile of grass system earlier short increased grass blanketed with it or bi erosion.

Jennifer Garner and Ben Affleck are the proud parents of a newborn son! The 39-year-old actress gave birth to the couple's third child in Santa Monica, Calif., a source tells Us Weekly. The family's newest addition joins older sisters Violet, 6, and Seraphina, 3. “I would have thought [Ben] wanted a boy]. At first … I really thought so,” Jen, who kept the baby's gender under wraps, told Jay Leno last month.
hgft
Experienced Developer
Experienced Developer
 
Posts: 66
Joined: Tue Feb 28, 2012 9:11 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 21 guests