ANDROID - Immersive full screen question (MOUSESTATE issue)

Previous topic - Next topic

adaz

Hi Guys!

BOXCOLL returns false values on the bottom of the screen, I think because of the virtual navigation controls of Android. See the image.

I don't know how to tell Android that I want immersive full screen, where the navigation controls don't bother me.

How to insert this code into GLBasic?
https://developer.android.com/training/system-ui/immersive.html

Can somebody help me please?

dreamerman

If no navigation bar is shown then thats 'immersive' mode? So GLBasic does that by default (or it needs AndroidExtras or some manifest file changes, don't remember)..
To validate that issue you can give even some small source ready to compile and test, do you use orientation/screen rotation functions, any other special stuff or just basics? If touch controls responds with proper x y positions there should be no problem. On other hand I use hand written collision functions, that's only couple minutes of coding and much more handy if you have UDT, at least for me.
Check my source code editor for GLBasic - link Update: 20.04.2020

erico

Using the screen fit routine SpaceFractal did a while ago gives me no problems.
As with the extra menus, I get a shadow version of it that don´t bother me with my phone or with the ones I tried.
I also took note of some ways to disable the <back> and <menu> buttons so one does not accidentally touch it exiting the game.

Make a simple example apk, like Dreamerman said, so we can also test that out for you.
cheers.

adaz

#3
Ok Guys, here is an example project. It draws a horizontal line exactly where I touch the screen. But it is only true until I touch the bottom of the screen.

Code (glbasic) Select
GLOBAL mx,my,mb1,mb2

LOADFONT "Media/white.png",1
SETFONT 1

REPEAT
MOUSESTATE mx,my,mb1,mb2
IF mb1 THEN DRAWLINE 0,my,5000,my,RGB(255,255,255)
PRINT "TOUCH Y:"+my,200,0
SHOWSCREEN
UNTIL 0=1


(I attached the font (it has to be copied to Media folder), and I attached the compiled .apk as well.)

So, what I am experiencing is the following:

1. When I touch the very bottom (approx. 1 cm) of the screen on the phone, the white line does not appear.
2. When I begin to push my finger slowly upwards, the line appears at the very bottom (!!) of the screen. But my finger is already not there, my finger is approx. 1 cm upper than that.
3. When I continue to push my finger upwards, the line begins to approach my finger, and on the top it reaches it.

I don't know if it is understandable, or if you can regenerate this issue on your phones, so I'm very curious. Does it happen only on my phone, or it's a bug? (I have a Huawei P10)

Thank you very much!

EDIT: I already tried to disable Back button. The back button was really disabled, but that did not help as well...

erico

Is that the whole code?
I think GETDESKTOPSIZE will return the usable only area of the phone and one can scale its game accordingly, but then that would not be full screen as you want. I have no phone with in-menu close by now but will try to look for some.

adaz

Thanks erico. It still does not work, I've tried everything I think.

Another try was to achieve somehow that the navigation bar be always visible. If it solved my problem, I'd be in peace with it. But I could not dissuade AE to hide the navigation bar. I cleared every flags from the SDLActivity.java (like View.SYSTEM_UI_FLAG_LAYOUT_STABLE, etc.), but the bar is still hidden... Do you have an idea for this?

dreamerman

So, that's no an issue with BOXCOLL but some screen / navigation bar problem.
I checked that .apk on
- phone with Android 6.0, hardware buttons, both software bars (navigations and status) are invisible, line is drawn at proper position, so no issues,
- old tablet with Android 4.0 that has software bars always enabled, and they are visible in this app, (navigation bars are also visible in other GLB based apps, status bar isn't visible, but imerssive mode is available from Android 4.4),
Currently no other devices to test. I didn't play with Android from long time so can't help with such os based stuff atm.
Check my source code editor for GLBasic - link Update: 20.04.2020

adaz

Thanks anyway dreamerman. As I said now I'd be happy with visible navigation bars (if nothing else works), but I cannot make them visible. Can you help in this?

erico

This here is what I use:
http://www.glbasic.com/forum/index.php?topic=9848.0

Check the whole thread couse I can´t remember if there was a little bug somewhere.
Last time I tested using this system, bars where a bit visible (transparent) and coordinates worked fine, you can then check on disabling MENU and BACK so it pauses instead of exiting the app. Take a look.

adaz

Quote from: erico on 2018-Feb-18
This here is what I use:
http://www.glbasic.com/forum/index.php?topic=9848.0

Thanks erico, but I don't know what to do with that code, this is not about my problem. My problem is that my Huawei doesn't allow me to touch the bottom section at all, even if the software buttons are invisible.
Today I was able to try my test code on another phone, and it worked on that, but it has hardware buttons:(
I tried some other games on my Huawei, and they allowed me to touch the bottom section as well, so it IS possible somehow, but I still don't know what to do to achieve this.

MrPlow

#10
Hi


[edited scaling comment - not relevant]

I didn't read the issue correctly :)

Maybe your touch is being registered but not shown in the right place.
Why not add another feedback response in a fixed location, to the show the screen accepting the touch (even if not in the correct position).



Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#11
Android does not report the screen resolution where the system buttons is, so you might cannot use the full screen. That is pretty normal and is nothing im can do with it. This is just how onscreen buttons works. So this is by Android design.

Im will also not fix the the Immersive screen for Android 4.4, due the userbase is very small today, and im have stopped Android support anyway. The issue is property in SDLActivity.Java mouse code, which is not aware of the Immersive screen and "orientations" changes.

Android 5+ fullscreen should howover do works fine.

PS. This is not a scaling issue, but mousestate issue. scaling and boxcoll have nothing about it at all.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Oops - yep, didn't read the issue correctly, so I went on a tangent with scaling....  :S



Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

erico

Yep, the scaling part was not what I wanted to point but the part that detects screen size and convert touch coordinates accordingly.

spacefractal

#14
still, this issue is NOTHING about scaling and converting coordinates at all. Dont been confused here. This is a MOUSESTATE issue.

The main issue is simply is the java code does simpley not take and aware the feature have been set or not and then glbasic does not take any notice at all when screen configuration change, etc its techinal change onscreen resolution.

That means, when you switch to Immersive screen, then the resolution also changes too, that does property not happens and then MOUSESTATE fails and still thinks the resolutions is in normal mode. hence its freak out. This is what im thinking. Im have property tried to get it working, but did newer got it working, so im skipped the feature. Android 5.0 fullscreen was much easier to support.

Howover im will not fix this issue, since its only effect Android 4.4 and fullscreen from Android 5 can been used.

the issue is property rely in SDLActivity.Java and eventuelly in Androidmanifest.xml. The issue should also exists only for Android 4.4...... Fullscreen IS supported from Android 5.0 and up. Also im did also fixed a simular issue, which im thinks its was a Android TV issue about this one.

So this can actuelly by a bug, but im wont fix it.

Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/