Landscape Problem

Monkey Targets Forums/Android/Landscape Problem

York(Posted 2012) [#1]
Hey guys,

I have just released my new game and now there is a problem and I donīt know why.

Fryman reports that the game running in landscape mode, but it is cut at the half of the screen.

See here:
[img \]

My AndroidMainifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"

	package="com.yorkburkhardt.roccosblocklandfree"
	
	android:versionCode="2"
	android:versionName="1.1"
	android:installLocation="auto">
	
	<uses-sdk 
		android:minSdkVersion="3"
		android:targetSdkVersion="7" />
		
	<uses-feature android:glEsVersion="0x00010001" />
		
	<application android:label="Roccos Block Land Free" android:icon="@drawable/icon">
		<activity 
			android:name="MonkeyGame" 
			android:label="Roccos Block Land Free"
			android:screenOrientation="landscape"
			android:configChanges="keyboardHidden|orientation"
			android:theme=\"@...;
			<intent-filter>
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />
			</intent-filter>
		</activity>
    	<activity android:name="com.google.ads.AdActivity"
              android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
      	</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest> 


On my Huawei, and a Samsung Galaxy S2 there are no problems with it.?? hmm :(
So, can anybody help me?


dave.h(Posted 2012) [#2]
ive recently had this problem.i the game running in 640x480.The problem was because i hadnt got the scale set up correctly .eg

Global WIDTH:Float = 640
Global HEIGHT:Float = 480
Global SCREEN_WIDTH:Int
Global SCREEN_HEIGHT:Int

Method OnCreate:Int()
SCREEN_WIDTH = DeviceWidth()
SCREEN_HEIGHT = DeviceHeight()
end

Method OnRender:Int()
Scale SCREEN_WIDTH / WIDTH, SCREEN_HEIGHT / HEIGHT
PushMatrix
'DRAW STUFF HERE
PopMatrix
END

i know im prob showing you how to suck eggs here but its always been that problem when its happened to me


York(Posted 2012) [#3]
Hey thanks for your answer. But thatīs the way I do. If I run it in html5 it scales up correctly.

On my Galaxy S2 there is also no problem with the scale..


dave.h(Posted 2012) [#4]
ive just downloaded on my phone which is an experia x10 and the screen is fine on that.i also tested it a galaxy tab 7" and that works great as well.


York(Posted 2012) [#5]
Thank you for trying =) But it is very curios.. Thatīs why I like iOS more than Android. On iOS we havenīt so many different devices.

But I donīt understand this problem. Perhaps the Htc One X ( where the prob appears ) need more information in the manifest file.. ?


FelipeA(Posted 2012) [#6]
I tested the game on my samsung galaxy s2 and at first install it happened that and then crashed. After opening it again it worked great.


Volker(Posted 2012) [#7]
No problems on Galaxy Tab here too.


silentshark(Posted 2012) [#8]
Ok on my s2 as well. How about playing around with different resolutions in the blue stacks emulator, to see if you cn encourage the bug to surface consistently?


benmc(Posted 2012) [#9]
What does your main.xml look like?


York(Posted 2012) [#10]
Hey,

my main.xml looks like this:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:orientation="horizontal" >

	<view class="${ANDROID_APP_PACKAGE}.MonkeyGame$MonkeyView"
    	android:id="@+id/monkeyview"
		android:keepScreenOn="true"
  		android:layout_width="fill_parent"
		android:layout_height="fill_parent"
		/>
	
</LinearLayout>





York(Posted 2012) [#11]
So the problem seems to be cleared:

"the orientation works fine now ive switched roms, must of been my phone"

Thank you to all, who have tested it and helped me =)


benmc(Posted 2012) [#12]
It just dawned on me..... have you tried changing your minSdkVersion in the Manifest to at least 8 instead of 3?

It's set to 3 right now, which can be really problematic. I think that supports Android 1.5, but I can't get Monkey games to work on 1.5 anyway, so I up the minSdkVersion to 8 (Android 2.2) and then targetSdkVersion to 15.

I used to have this problem with my Java games where the jump from minSdk 3 to 4 made a huge difference in how the layout was handled.


York(Posted 2012) [#13]
Hey benmc,

i will just try it with the next update. Perhaps this is the way I can solve some trouble. Thank you for this tip.


benmc(Posted 2012) [#14]
The only problem may be that anyone with an SDK below 8 may not be able to get the update or download since it's already out there with 3. It could result in some negative feedback if current customers can't get the update. Hopefully it was just a ROM and you can leave it at 3.