Games [XUI2D] Ilans first App - Freeze on Tablet (Android)

JanG

Member
Licensed User
Longtime User
Ilans first app runs quite good on almost all my android devices.

Phones (2 tested):
When the screensaver (black screen) comes, after switch on the screen again the game starts newly again. You can't continue.

Tablet:
After switching on the screen again the game is frozen at the same position where it ended when screen was going black.

It's really fun to test this kind of apps. I think there is a lot potential for many of us!
 

moster67

Expert
Licensed User
Longtime User
I am not into game developing but when you mention 2 tested phones and one tablet, you really ought to mention what devices they are, their specs, their OS-version. I can't compare your tests with perhaps my own devices without knowing yours, right? Sorry, but a report like yours is not really useful...
 

ilan

Expert
Licensed User
Longtime User
When the screensaver (black screen) comes

you can keep the phone always alive with:

B4X:
Dim awake As PhoneWakeState
awake.KeepAlive

this will prevent the screensaver to freeze the app. anyway, i have not tested it but you could put in Activity_Resume a call to x2.start in the game class. what i think is that when the app is going to background x2.stop is called and what you need to do is call again x2.start. (just a thought i have not investigate it)
 

JanG

Member
Licensed User
Longtime User
[...]in Activity_Resume a call to x2.start in the game class. what i think is that when the app is going to background x2.stop is called and what you need to do is call again x2.start. (just a thought i have not investigate it)
Thank you for your idea! I tested this, but it doesn't work. In the examples there are 2 types. One uses gm.StartGame/gm.StopGame (e.g. SpaceInvaders/IlansApp/MonsterTruck). This kind of apps start new after sleeping. Your game progress is lost after waking up. The ones ones use gm.X2.Start/gm.X2.Stop (e.g. WalkingCharacter/Lines). These apps resume at the state they were stopped. But you can't change it simply by replacing gm.StartGame to gm.X2.Start. This doesn't work and gives strange effects. I think there is a little more to do, but I don't have the time at the moment.

[...] you really ought to mention what devices they are, their specs, their OS-version.[...]
As I wrote above it is an issue by design. It doesn't depend on the Android-Version. But if you want to know and you need this information for helping me I am very happy:
Phone: Galaxy A3 (2017), SM-A320FL, Android 8.0.0 (Benchmark Score 3463)
Tablet: Samsung Galaxy Tab Pro 10.1 (SM-T520), Android 4.4.2 (Benchmark Score 5060)
 
Top