Forum Discussion
motorsep
10 years agoStart Partner
[Gear VR] How to shut down app on exit to the Store ?
When I use OVRQUITMENU or exit to Oculus Home from Universal Menu, shouldn't the app/game shut down automatically ?
If it should - then it's a bug. If not, what do I need to do to shut it down?
If I do nothing, then when I get the phone out if Gear VR, the app is still running in the background. When using Gear VR, it takes away memory and processing power that could be utilized by another Gear VR app/game.
Thanks.
If it should - then it's a bug. If not, what do I need to do to shut it down?
If I do nothing, then when I get the phone out if Gear VR, the app is still running in the background. When using Gear VR, it takes away memory and processing power that could be utilized by another Gear VR app/game.
Thanks.
- Yes, short-press brings up the confirm quit menu and if you confirm quit, then it should quit the app and take you to home. If that isn't happening, it would be a bug. We need a lot more information about the problem. What app is having the problem? What hardware and versions of UE4, the integration, Android, and SystemActivities are you using? Can you provide complete logcat from a failing run?
- Yeah, it seems working:
D/UE4 (28611): [2016.04.07-01.59.59:261][64000]LogHMD: GearVR shutdown.
D/UE4 (28611): [2016.04.07-01.59.59:307][64000]LogWindows: FAndroidMisc::RequestExit(1)
Why do you think it doesn't exit? If you refer to the "ghost app" that you still see if you press the Tasks button on the phone, then I can say it is not a real app. If you select it, the app will be started from the beginning. I don't know why that 'ghost app' stays in the tasks, seems like this is how the System.exit(0) works on Android (see implementation of AndroidThunkJava_ForceQuit() in Engine\Build\Android\Java\src\com\epicgames\ue4\GameActivity.java - So, the list where you see the 'ghost app' is called 'recently used apps' list and it just shows the list of recently used apps. To make sure your app is not in memory you may use 'top' command in 'adb shell'.
Alternatively, you can exclude your app from appearing in the recently used apps list. You need to add android:excludeFromRecents="true" attribute to <activity> section in AndroidManifest.xml. In UE4, just go to 'Project Settings' -> 'Platforms' -> 'Android' -> 'Advanced APK packaging' and add the android:excludeFromRecents="true" line into 'Extra tags for UE4.GameActivity <activity> node'. Re-package and re-deploy.
25 Replies
Replies have been turned off for this discussion
- vrdavebOculus StaffYes, short-press brings up the confirm quit menu and if you confirm quit, then it should quit the app and take you to home. If that isn't happening, it would be a bug. We need a lot more information about the problem. What app is having the problem? What hardware and versions of UE4, the integration, Android, and SystemActivities are you using? Can you provide complete logcat from a failing run?
- motorsepStart Partner
vrdaveb said:
Yes, short-press brings up the confirm quit menu and if you confirm quit, then it should quit the app and take you to home. If that isn't happening, it would be a bug. We need a lot more information about the problem. What app is having the problem? What hardware and versions of UE4, the integration, Android, and SystemActivities are you using? Can you provide complete logcat from a failing run?
Right. If I do short press, I get quit menu, press Yes, I am taken to Oculus Home. Then I take out phone from GVR and my app is still running. If I tap on it, I will be asked to plug in my phone into GVR and I am back into the game. Rinse / repeat.
It's my test app (I can upload project and link it to you), UE 4.11pre8 stock, Galaxy S6 SM-G920T, android 5.1.1, I am guessing latest SystemActivities since I have screenshot/video recording in UM (VR Service Version 2.3.12 / 231200000 MAIN / 6/22/11 10:25 PM not sure if that's where I look the version for SystemActivities). Not sure what you mean by "integration".
Is there some short guide how to get logcat when using UE4 dev builds? - motorsepStart PartnerSo, I am looking into this https://docs.unrealengine.com/latest/INT/Platforms/GearVR/Debugging/index.html and I see in order to work with logs I have to turn on development mode (I am guessing even if I have phone in GVR and use WiFi for debugging). However, when I was dealing with issues related to Back button, I was told not to run development mode as back button on the phone won't work.
So, what do I need to do? :blush: - motorsepStart PartnerWith the latest update I got a few hours ago (see my post about video recording in Mobile Development), now my app gets shut down if I remove phone from Gear VR. However, if I exit into Oculus Home (Store), and then remove device from Gear VR, the app will still be running. So something got fixed, but not completely? I will try to get logcat this weekend.
- motorsepStart PartnerAlright, got my debugging setup working. Here is the link to logcat file and a screenshot showing my app still running even though I exited to Oculus Home and then removed device from Gear VR:
Logcat file: https://drive.google.com/open?id=0BwE6dxM0O2PseEhCN2ZTM0c4OWs
Basically what I did was I turned on developer mode for Gear VR Service, ran adb logcat -c, then adb logcat -s UE4 OVR VrApi VrLib VRSVC HmdInfo >logoutput.txt, then I opened my app, put phone into GVR, looked around once, short-pressed back button on GVR, got Exit to Oculus Home prompt, said Yes, waited until Oculus Store/Home is loaded, took off GVR and removed phone from it.
Oh, and VR Service Version is now 2.4.29 / 242900000 MAIN / 6/22/11 10:25 PM - motorsepStart PartnerBump! Just wondering if any of the info I provided is of use.
- motorsepStart Partner@vrdaveb Sorry to keep bumping it up, but any chance you have an idea whether it's Oculus or UE4 or my issue?
- artyom17Expert ProtegeBasically, both ways should work. Are you on the latest 4.11? Are you sure your logcat is complete? It doesn't seem like. You should see log entries like these:
D UE4 : AndroidEGL::ResetDisplay()
D UE4 : Execution has been paused...
D UE4 : Case APP_CMD_TERM_WINDOW, tid = 12849
D UE4 : LogAndroidEvents: EnqueueAppEvent : 3, 0, tid = 12849
D UE4 : [2016.04.06-22.25.39:744][ 0]LogHMD: !!! Rendering thread is released! tid = 12887
D UE4 : [2016.04.06-22.25.39:744][ 0]LogAndroid: Case APP_CMD_TERM_WINDOW
D UE4 : [2016.04.06-22.25.39:745][ 0]LogAndroidEvents:Display: DequeueAppEvent : 3, 0
D UE4 : APP_EVENT_STATE_WINDOW_DESTROYED, 0, 0, 0
D UE4 : AndroidEGL::DestroyWindow()
D UE4 : AndroidEGL::UnBind()
D UE4 : AndroidEGL::ResetDisplay()
D UE4 : AndroidEGL::DestroySurface()
D UE4 : FAndroidAppEntry::DestroyWindow() called
D UE4 : LogAndroidEvents: EnqueueAppEvent : 8, 0, tid = 12849
D UE4 : ==============> GameActive.onStop complete!
D UE4 : [2016.04.06-22.25.39:855][ 0]LogAndroid: Case APP_CMD_STOP
D UE4 : [2016.04.06-22.25.39:855][ 0]LogAndroidEvents:Display: DequeueAppEvent : 8, 0
D UE4 : Battery: status = 2, rawlevel = 51, scale = 100
D UE4 : nativeBatteryEvent(stat = 2, lvl = 51, t = 30.00)
D UE4 : Battery: status = 3, rawlevel = 51, scale = 100
D UE4 : nativeBatteryEvent(stat = 3, lvl = 51, t = 30.00)
D UE4 : Battery: status = 3, rawlevel = 51, scale = 100
D UE4 : LogAndroidEvents: EnqueueAppEvent : 5, 0, tid = 12849
D UE4 : [2016.04.06-22.25.59:256][ 0]LogAndroid: Case APP_CMD_INPUT_CHANGED
D UE4 : [2016.04.06-22.25.59:256][ 0]LogAndroid: Case APP_CMD_DESTROY
D UE4 : [2016.04.06-22.25.59:256][ 0]LogAndroidEvents:Display: DequeueAppEvent : 5, 0
D UE4 : APP_EVENT_STATE_ON_DESTROY
D UE4 : [2016.04.06-22.25.59:356][ 0]LogAndroid: Exiting
D UE4 : [2016.04.06-22.25.59:358][ 0]LogHMD: FGearVRCustomPresent::Shutdown() is called
D UE4 : [2016.04.06-22.25.59:363][ 0]LogHMD: GearVR shutdown.
D UE4 : AndroidEGL::ResetDisplay()
D UE4 : AndroidEGL::DestroySurface()
D UE4 : AndroidEGL::ResetDisplay()
D UE4 : AndroidEGL::DestroySurface()
D UE4 : [2016.04.06-22.25.59:386][ 0]LogAndroid: Exiting is over
D UE4 : [2016.04.06-22.25.59:386][ 0]LogWindows: FAndroidMisc::RequestExit(1) - motorsepStart PartnerIt should be whole logcat. I followed instructions, and pressed Ctrl + C after I pulled out phone from the Gear VR. Then uploaded logcat to GDrive.
If you Ctrl + F over my logcat, whatever you see in your posted part of the logcat is present in mine. Maybe because I pulled phone out of GVR and only later pressed Ctrl + C logcat has extra stuff in it?
Maybe Epic's instructions aren't correct and I missed something ? - artyom17Expert Protegeall what you need to do is to run 'adb logcat -c' first (before running the app, while phone is connected to usb), then run the app, dock it, do whatever you do, connect the phone back to usb and run 'adb logcat -d >log.txt'. That is it, you have full log.txt.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 20 days ago