8

I've been trying everything I can think of to get my app to display full screen on the Galaxy Tab.

Basically, it works like the Lunar Lander example app that comes with the Android SDK. What would you do to make that Lunar Lander app display in full screen on Large screen devices like the Galaxy Tab?

I'm not concerned about the quality of the graphics at this point, but just how an app created like this can fill the screen. It was basically designed to work on a 320x480 MDPI screen with images in the drawable folder and it uses a SurfaceHolder and view to draw the individual bitmaps.

Any advice?

CLARIFICATION: Sorry, I don't mean full screen as in removing the notification and title bar, I mean that everything has a giant black border around it and it the graphics don't take up the whole screen.

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
Ben Mc
  • 2,038
  • 6
  • 30
  • 37

8 Answers8

10

If you set your target sdk level to anything less than 9, then support for extra-large screens is assumed to be false. If you set targetSdkVersion=9 in the manifest, then xlarge support is assumed to be true. See the documentation on Supporting Multiple Screens, in particular the description of compatibility mode.

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521
6

another way to do is creating a xml called styles.xml in res/values

define a style:

<style name="Theme.FullScreen" parent="android:Theme">
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowNoTitle">true</item>
    </style>

later in the manifest, tell android what activity must be in fullscreen setting the style above:

<activity android:name=".activity.NewSearchBrowserActivity" android:theme="@style/Theme.FullScreen" android:screenOrientation="landscape"></activity>

in this way you make a reusable theme what can be applied to any activity.

Franco
  • 7,385
  • 3
  • 27
  • 22
  • Sorry, I don't mean full screen as in removing the notification and title bar, I mean that everything has a giant black border around it and it the graphics don't take up the whole screen. – Ben Mc Feb 03 '11 at 01:26
5

Ted mentioned XLargeSceens, the Galaxy Tab is running 2.2 and therefore doesn't have the xlargeScreens attribute as it was added in 2.3; Because the upcoming generation of tablets will have 3.0 and XlargeScreens you are going to want to use it anyway (and compile against 2.3/3.0)

In your Manifest you need to declare support for all reasonable screen sizes and provide the correct set of resources

<supports-screens 
    android:smallScreens="false" 
    android:largeScreens="true"
    android:xlargeScreens="true"  
    android:normalScreens="true" 
    android:anyDensity="true"
/>
smith324
  • 13,020
  • 9
  • 37
  • 58
  • 3
    Just a reminder, the 'supports-screens' tag goes under the 'manifest' tag, NOT the 'application' tag. After half an hour of mucking-about, I can confirm it does nothing if you put it there. – Roberto Tyley Nov 08 '11 at 14:51
2

Unless you support SDK versions that are at least 4, i.e.:
<uses-sdk android:minSdkVersion="4"/>,

you will have to do the following explicitly:

<supports-screens android:smallScreens="true"
    android:normalScreens="true"
    android:largeScreens="true"
    android:anyDensity="true" />
WSBT
  • 33,033
  • 18
  • 128
  • 133
1
 public void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

This is working fine for me... try this

Javo
  • 21
  • 4
0

Give this one in your manifest file:

<supports-screens android:smallScreens="true"
    android:normalScreens="true"
    android:largeScreens="true"
    android:anyDensity="true" />

Surely it will work.

Juan Mellado
  • 14,973
  • 5
  • 47
  • 54
Ravi
  • 2,277
  • 3
  • 22
  • 37
0

<uses-sdk android:minSdkVersion="4" />

or an other version number is missing in your manifest

VinceFR
  • 2,551
  • 1
  • 21
  • 27
0

you can add this exactly under

  super.onCreate(savedInstanceState);

of the activity you want to be full screen.

 requestWindowFeature(Window.FEATURE_NO_TITLE);
 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
            WindowManager.LayoutParams.FLAG_FULLSCREEN);  
Daniel
  • 3,322
  • 5
  • 30
  • 40
  • @bluebrain : I don't think it's related to the version we are using. It should work in all versions. – Daniel Apr 02 '12 at 00:49