Download

Timer

Hi,
i’m trying to make a timer what will work even app is closed.
Can somebody give me some advice ?
Thx

PS without connection to internet and sync with gadget’s time.

You don’t have to sync with system time. Just get it at timer start, and get it at timer resumed. Then display the difference.

I don’t think it would be possible without referencing another source of time.

Hi,
it’s not what i’m searching. Because client can change time and timer will display wrong time.

The only way to really rectify this if you don’t trust the client is to query a time service on the internet and store this information instead, without the internet connection, system time and any other mechanisms you place on the client computer can easily be manipulated.

Well, it’s a good idea. To request internet connection for the first run…
But i don’t know how to do it.
Any way, thank you for advice i will try it.

Sorry, i dind’t understood you right.
I don’t want to make my app dependent of internet.
I know that on android is a way to make a timer that is working even app is closed. So i’m searching something like this on UE.

Your looking for a way to determine how much time has passed since the person last played your game?

HaxO gave good advice here, as all would need to do is store the time in a save file when the person exits the app. When they start the game again you calculate the difference between the current time and the time in the save file and that is how much time has passed. There are blueprint nodes for doing this.

Is there a game or a mechanic you have in mind when talking about Android? Give us an example of what you want to achieve and we could possibly figure out how they accomplish it, remember though when you close the app, there is no longer a process scheduled to execute on the CPU, doesn’t matter whether it is Windows, Mac OS X or Android. Unless a true simulation, most games use trickery to achieve the desired effect.

I’m want to give access to app only for 24 hour but without possibility to cheat.
For example, i run app at 8:00 am and game read this time. At 11 am i change time on device to 9 am, and when i will run app again it will read just one hour, not 3.
A solution is to sync app time with internet but i don’t want to make app depend from internet, it will be the last solution what i will do.
An android developer told me that in manifest file you can add receiver that is like timer that still work even then app is closed. So i want to know if in UE is possible that.
There i’m searching solution for PC, but i created another thread about editing the manifest file for android to test and solution what i described earlier.