All along I’ve been testing on an Android 2 version ported to x86 (which runs within VirtualBox), due to problems with the emulators. My application and layout appears fine on this port.
I am now finishing my development, and am testing on my real phone, a Droid Bionic.
However, my overall application layout does not take up the full size of my screen, even when I have my dimensions set to the below. There is a black outer box that it seems to reside within and I can’t enlarge this window.
If I change the dimensions of my overall layout from fill_parent to say 1000px, I can see the layout being truncated as it still sits within this unchanged window size.
Can anyone advise me how to resolve this?
Thanks
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@layout/overall_background"
android:orientation="vertical"
>
<GridView
android:id="@+id/gridView"
android:gravity="fill_horizontal"
android:stretchMode="columnWidth"
android:horizontalSpacing="0px"
android:background="@layout/grid_background"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
Edit:
I am fairly sure this is because of the screen compatibility mode you are running in because your android:targetSdkVersion in your manifest is set incorrectly. This should be set to the highest SDK version that you have tested your app with and it works on.’
Please see this link and in specific read the first few paragraphs.
Edit: Please see the documentation on how you should be setting the target SDK attribute
These lines in particular are of interest:
Given that your ran into this issue tells me your target sdk is set to 3 or lower. So Android 1.5 or lower. This means that anyone running your app on a phone with something newer then Android 1.5 is going to be running in compatibility mode. This leads to decreased performance and incompatible default graphics. I.E. the graphics will not look like what everything else on the phone looks like because of the compatibility mode.
Currently something like 95% of all Android are running a newer version then 1.5.
What you need to do is up your tarket SDK to 4,5,6,7 … etc one at a time and fully test the App until you get to the current SDK release of 15. When you release the target SDK should be 15 to ensure it runs well on all OS versions.