When testing our game, which is highly dependent on System.currentTimeMillis() , we experience an annoying error.
Our game uses an array of delta tags, which indicates when certain things happen. These timestamps correspond to the part of the music being played.
Testing at home does not give us any problems. Unable to reproduce error while testing from our home.
But testing while driving in a car between cities gives us problems of synchronization between time stamps and music. My best guess is that Android will freeze the system, including the system timer, because it is switching the network or looking for a signal?
I tried to embed a fake tooltip into the game by creating a thread for a few seconds when I press a specific button. This freezes the screen (obviously), but it still syncs perfectly when the dream is over.
The only way to reproduce this mistake is to make a trip by car or bus or train, which, of course, is most likely when most people will play in our game.
Question of course
source share