ANDROID - Immersive full screen question (MOUSESTATE issue)

Previous topic - Next topic


Thank you spacefractal and guys. I already compiled this code for Android 5.1.1, API level 22, so it should work as you said. But it doesn't :( Do you have an idea where that "bug" could be, maybe I can try to fix it?

It's strange:
"aapt dump badging" command says:

package: name='' versionCode='1' versionName='1.00' platformBuildVersionName='5.1.1-1819727'

How can it be?


checkout your androidmanifest.xml, which require changes.

targetSdkVersion is wrong and think you still using Android 4.4 SDK, where fullscreen feature is not present. targetSdkVersion should set to the current SDK using. If you update and fixing, then targetSdkVersion should set target to that.

here is the manifest im used for CatchOut, before im stopped:

Code (glbasic) Select

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<supports-screens android:resizeable="false"
  android:anyDensity="true" />
    <application android:label="@string/app_name" android:icon="@drawable/icon" android:debuggable="false">
<meta-data android:name="TVOnly" android:value="0" />
<meta-data android:name="UseShop" android:value="0" />
        <activity android:name=""
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
<category android:name="tv.ouya.intent.category.GAME" />

There is also various Android TV as well OUYA stuff you might can remove..... There was also a crash bug in eailer Android Extras on some devices, when the OuyaSDK is present. that is fixed and will simply not init it, when its not on Ouya. You can also eventuelly remove all those stuff in onCreate().
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 -


It was my mistake, I didn't notice an error message after compile, so I used an old apk. Now it really compiled to api 22:

package: name='com.adaz.antirock' versionCode='1' versionName='1.00' platformBuildVersionName='5.1.1-1819727'

But the same MOUSESTATE issue still extists :-(


1. do you use sensorLandscape or sensorPortrait in manifest (not set to any orientation or such, which might fail too)? dont use other values than one of the two.

2. Does X also the same (your code only show Y, but what does X)?

3. Also can you give me the Logcat output? (can been called from _Logview.bat). This logout various info on startup.

4. do you use Android Extras 3.01.2?

if you in LOGCAT can see Screen Resolution is different than SDL resolution, its could been that issue. This was more designed for Android TV and not on a device.

Then you can try to comment those two Java lines out in around line 1885 (its in onTouch() function):
         if (SDLActivity.mSingleton.ViewWidth!=0) x=x/SDLActivity.mSingleton.ViewWidth;
         if (SDLActivity.mSingleton.ViewHeight!=0) y=y/SDLActivity.mSingleton.ViewHeight;

That why im want to checkout the Logcat to information what its does in the startup.....

please note:
Android 4.x system will also only report the screen resolution in the screen area you can use for your app. THIS IS BY DESIGN. Immersive fullscreen in Android 4.4 is not supported by glbasic, nor its ever do. But fullscreen from Android 5 is howover supported.

PS. Yes even im did stopped Android support, then im might eventuelly fix SDLActivity issues like this. But new features and SDK updates wont been happens for supports new Android features.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 -


Spacefractal, you're very kind by helping me in this!

1. I used portrait, but now I tried it with sensorPortrait, no luck.

2. X does nothing wrong, it's OK.

3. Logcat output:

Code (glbasic) Select
Android Debug Bridge version 1.0.32
List of devices attached
7EX7N17803000238        device

int logctl_get(): open '/dev/hwlog_switch' fail -1, 13. Permission denied

Note: log switch off, only log_main and log_events will have logs!
--------- beginning of main
02-18 23:48:51.888 30161 30161 I glbasic : OnResume()
02-18 23:48:51.889 30161 30161 I glbasic : OnResume() end
02-18 23:48:51.903 30161 30161 I glbasic : surfaceCreated()
02-18 23:48:51.907 30161 30161 I glbasic : surfaceChanged()
02-18 23:48:51.907 30161 30161 I SDL     : pixel format RGB_565
02-18 23:48:51.907 30161 30161 I glbasic : Window size:929x1560
02-18 23:48:51.907 30161 30161 I glbasic : startApp, resume
02-18 23:48:51.907 30161 30161 I glbasic : startApp, resume 1
02-18 23:48:51.907 30161 30161 I glbasic : startApp, resume 4
02-18 23:48:51.907 30161 30200 I SDL     : ceateGLContext
02-18 23:48:51.907 30161 30161 I glbasic : hint screensize to glb
02-18 23:48:51.907 30161 30161 I glbasic : glb_notify_screen_size 929x1560
02-18 23:48:52.409 30161 30200 I glbasic : pause loop ended
02-18 23:49:04.560 30161 30161 I glbasic : OnPause()
02-18 23:49:04.574 30161 30200 I glbasic : pause loop in showscreen/hibernate
02-18 23:49:04.609 30161 30161 I glbasic : surfaceDestroyed()

4. Yes, I do. I removed the old one, and downloaded from the link you provided. (How can I check its version? In the chm file it says 2.8.)
I don't know what is SDL resolution. The phone reports 929x1560 every time.

Thank you!

EDIT: I read your inserted lines later. So after I commented out these lines, something happened: the lines are WAY FAR from my fingers now. The top left is OK, but when I approach the bottom left, they reach the screen edges much sooner than before.


Can you try this Java file?

Its proprety some Android TV that kick in and you using fullhd in a portrait mode, which im have set a default max. Mousestate should have works anyway, but might have failed with the mousestate, which im should checkout here. but anyway its now not forced anymore. Only when contain string is set in strings.xml.

Make sure to overwrite that one that is inside glbasic android folder (search after that in the glbasic folder). Not in your app distrubtion folder. Glbasic will overwrite (unlike the manifest file).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 -


Ahhh,  I'm know why that happens. Actuelly it's a confirmed bug.

That Java file Should fix it, but not in 100% correct way around android TV/ouya scaling stuff, which got kicked in and Should skip it when it's in portrait mode, which its did not. But the Java thing it howover no more forced anyway in above file, except when a string in string.xml is set.

It's a stupid bug really. Nice spotted. I'm do a better fix later (even I'm stopped android support, except thing like this).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 -


Im have in this morning removed all AndroidTV scaling code, so its dont interfere normal devices, actuelly forced 720p is only happens on Ouya and GameStick. Android 5 devices TV is normally quite much faster than Android 4 consoles anyway.

Im have updated the Android update thread in the top. here only the java file is requried update. Howover its wont fix the issue in the bottom about system buttons, as im wrote due system.

Howover im will not support the Immersive Android 4.4, you need to have the system buttons, which is also pretty normal way.

Make sure to make a proper use of the back button eventuelly.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 -


Spacefractal, YOU ARE A GENIUS!!! It's working!!! I cannot say how happy I am! This resolved this problem. I don't know what you did, but you did it!
So what did you do? :)


removed Android TV scaling stuff.... its effected this issue, mostly im did set a scalling max in y 1560 resolution. this happens easy in portrait mode. Then its try to scaling it.... but the code did not take system button area at all, but returned as its was full screen. Then mousestate returns wrong.

Also Android TV stuff do require Landscape anyway.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 -