Page 1 of 1

STK on Android: Resume game after phone unlock

PostPosted: 03 Nov 2017, 21:56
by eltomito
Hi!

I installed STK on my Xiaomi Note 2 and it works great, it runs really smooth and looks alright. The only thing that's kind of annoying is that I can't resume the game where I left off after doing something else with my phone.

If I pause STK mid-game, go to the phone home screen and then return to STK, then STK reloads completely and starts from the main menu as if I've never paused it in the first place.

If I lock the phone while in the game (paused or unpaused) and then I unlock the phone, STK crashes.

It would be great if I could pause the game, lock the phone or do something else with it and then resume playing STK where I left it.

Thank you!

Re: STK on Android: Resume game after phone unlock

PostPosted: 04 Nov 2017, 09:54
by deve
I will try to find a reason. I assume that other applications work correctly on your device?

It certainly shouldn't force to reload everything. It also works fine on my devices.

Maybe adding some flags to AndroidManifest.xml can help. There is for example "android:alwaysRetainTaskState". Also when I compare our manifest file with other applications, they have for example
android:configChanges="keyboardHidden|orientation|screenSize"
while we have only
android:configChanges="keyboardHidden|orientation"

Can you manually install and test if I will prepare you apk for testing? And also are you able to provide logs from logcat? It may be useful.

Re: STK on Android: Resume game after phone unlock

PostPosted: 04 Nov 2017, 13:46
by eltomito
Just to be sure, I checked again and Beach Buggy Racing resumes as expected, so it's possible to do that on my phone ;)
I can manually install and test an apk and I guess I can get the logs from logcat too.

Re: STK on Android: Resume game after phone unlock

PostPosted: 04 Nov 2017, 22:28
by deve
I found one bug, that may cause this issue. Some configuration changes weren't marked as handled by the app, so in this case android was restarting the activity. At least now STK is not restarted anymore when I connect external keyboard.

I uploaded the apk on dropbox, so that you can see if it works now. Here is the link:
https://www.dropbox.com/s/jkxznkohwzz2i ... g.apk?dl=0

Note that it's signed with debug key, so that you have to first uninstall previous version, and then install this one.

And if this modification doesn't help, then I will need logcat logs to see what happens. If you are using linux, then you can just connect the device to usb port, enable debugging via usb in android settings, and then use "adb logcat". Adb is available in ubuntu repositories. Or you can use "logcat" directly on your phone from terminal, but you may need to have rooted device to receive full log.

Re: STK on Android: Resume game after phone unlock

PostPosted: 05 Nov 2017, 15:34
by eltomito
The apk you sent fixed the problem. Resume works now!
I'm just thinking it would be great if the game could autopause when you leave it using the home button or the sleep button on the phone.
But it's just a minor detail, the way it works in the new apk is fantastic already.

Thank you!