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

    motorsepAuthor
    Inspiring
    April 7, 2016
    Hmm.. I used wifi connection and I was under impression I need to run that cmd line Epic has in their docs and then run the game. This way the phone is always in GearVR.

    I'll try it your way now, thanks.
    Up and Coming
    April 7, 2016
    Yeah, you can also do it with adb over wifi. It is even easier - run 'adb logcat -c' at the beginning and 'adb logcat -d >log.txt' to get full log. You may add filters via -s option too. 
    motorsepAuthor
    Inspiring
    April 7, 2016
    Alright, here we go:

    A. Removed phone from GVR without exiting to Home (after phone was removed my app was not running): https://drive.google.com/open?id=0BwE6dxM0O2PsVHFrTzY3TFNkQlU

    B. Removed phone from GVR after exiting to Home (after phone was removed my app was still running): https://drive.google.com/open?id=0BwE6dxM0O2PsS3VGdHQxMDVaRjg
    Up and Coming
    April 7, 2016
    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
    motorsepAuthor
    Inspiring
    April 7, 2016

    artyom17 said:

    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



    I see, thanks! I thought it doesn't exit because the "ghost" app was hanging in the Tasks. Indeed, if I tap it, it will start as if I just ran it fresh.

    Sorry, I didn't know how that works and I wanted to make sure it wouldn't affect performance of other apps that people might run after leaving my app/game. Better be safe than sorry, right? :blush: 
    Up and Coming
    April 7, 2016
    Right! :)
    Up and Coming
    April 7, 2016
    artyom17 said:
    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.

    While this is probably the case i don't see it with any of the apps available trough Oculus home. Since the majority are made in Unity, maybe it's Unreal thing? Do we need to poke Epic about that?
    motorsepAuthor
    Inspiring
    April 7, 2016

    moulder6 said:

    While this is probably the case i don't see it with any of the apps available trough Oculus home. Since the majority are made in Unity, maybe it's Unreal thing? Do we need to poke Epic about that?


    Feel free to raise your concerns to Epic, since it might be UE4 issue: https://answers.unrealengine.com/questions/396823/gear-vr-how-to-shut-down-app-on-exit-to-the-store.html

    Maybe if several people express concerns over same issue, they might look into it.
    Up and Coming
    April 7, 2016
    This is a good question. I'll discuss this with our mobile guys too.
    Up and Coming
    April 7, 2016
    I've just tried our native samples (which come with Mobile SDK) and those apps do exactly the same. Still gonna ask the guys if it is fixable (but, I assume, if it would be fixable then it was fixed already).