Android Mobile Event end play problem

Hello,

I made a blueprint Save Game who saves the Time when Event End plays.
It works fine on PC but on Mobile it won´t Save or activate the “Event End Play” part on the blueprint

Hello pandagraphy,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. When you tested this on the device, did you launch on or package it out?
  2. What is the exact device that you are using(example: iPhone 5s)?
  3. What is that exact OS current installed on the device (example: iOS 8.0.1)
  4. Could you provide screen shots of any blueprints that may be involved with this issue?

Hello,

  1. launch it on device

  2. Testet on Galaxy S5 and HTC One

  3. Version 5.0

Save the Time, when Game Closed on Character Blueprint

Show Hour and Minute with Widged on Screen. Get it from Save Game Blueprint

works fine on pc

but didn´t work on mobile

Hello pandagraphy,

You will need to package the game out and install it onto the device in order to test the save system. This is because launch on does not include all the files from the game when testing. Could please try packaging out the game and installing it on to the device and provide the results?

Hello Rudy,

I packaged the game out and installed it on device, got the same problem .

Hello pandagraphy,

I was able to reproduce this issue on our end. I have written up a report (UE-17241) and I have submitted it to the developers for further consideration. I will provide updates with any pertinent information as it becomes available. Thank you for your time and information.

Make it a great day

Thank you Rudy! =)

Hello pandagraphy,

Unfortunately on Android it isn’t possible to detect when the application is force closed. The onStop event is triggered from just pausing the application so you won’t want to terminate on it, and onDestroy is only called if in the background and the system needs to kill it for memory, and even then isn’t guaranteed.

The only recommendation is to save any state instead on entering background (paused). There is an application lifecycle event for this called ApplicationWillEnterBackgroundDelegate you may use instead.

But I don’t know how to use them. If anyone can give me some examples, I would be really grateful.

Hello pandagraphy,

Steps to use event:

  1. Right click blueprint graph
  2. Uncheck context sensitive
  3. Type in “Application Will Enter Background Delegate”
  4. Choose “Assign Application Will Enter Background Delegate”

I hope that this information helps.

Make it a great day

Hello Rudy,

thanks for your answer, but i means how to connect it on my blueprint… at which point and with what :slight_smile:

Hello pandagraphy,

In the example provided below I have assigned a custom event on event construct with the Application will enter background delegate event. All this does is turn the custom event into an “ApplicationWillEnterBackgroundDelegate” event. This custom event will now fire off just before the application is sent to the back ground (example: hitting the home button on a mobile device to pull up another app.) I hope that this clears things up a bit

Make it a great day

Thanks Rudy , but if I like you doing this I get an error message.

"This blueprint (self) is not a ApplicationLifecycleComponent, therefore ‘Target’ must have a connection.

Hello pandagraphy,

If you hover over the blue pin you will see that you need to add an ApplicationLifecycle component to the actor that you are using.

I’m afraid I do not understand which component you need it and how I include this in my Blueprint

Hello pandagraphy,

You will need to add the component to the blueprint that you are showing above. You will then need to get a reference to that component and use it to set up the event. After this you will remove your End play event and instead hook up the new ApplicationWillEnterBackgroundDelegate Event.

1 Like