Skip to main content
Inspiring
March 31, 2016
Solved

[Gear VR] How to shut down app on exit to the Store ?

  • March 31, 2016
  • 25 replies
  • 8323 views
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.
    This topic has been closed for replies.
    Best answer by vrdaveb
    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?

    25 replies

    vrdavebAnswer
    Inspiring
    March 31, 2016
    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?
    motorsepAuthor
    Inspiring
    March 31, 2016

    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? 
    motorsepAuthor
    Inspiring
    March 31, 2016
    So, 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: 

    motorsepAuthor
    Inspiring
    April 2, 2016
    With 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.
    motorsepAuthor
    Inspiring
    April 3, 2016
    Alright, 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 
    motorsepAuthor
    Inspiring
    April 4, 2016
    Bump! Just wondering if any of the info I provided is of use.
    motorsepAuthor
    Inspiring
    April 6, 2016
    @vrdaveb Sorry to keep bumping it up, but any chance you have an idea whether it's Oculus or UE4 or my issue?
    Up and Coming
    April 6, 2016
    Basically, 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)


    motorsepAuthor
    Inspiring
    April 6, 2016
    It 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 ?
    Up and Coming
    April 7, 2016
    all 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.