I'm making a game in which I use multiple ObjectAnimators. But their speed is different depending on which device the game is running on. And it's bothersome because it kind of breaks the gameplay of the game.
For example, between a Sony Xperia Z3 and a Huawei P8lite, the Huawei will display the animation much faster than the Sony. Which doesn't make sense since the Huawei's screen has a smaller resolution. (specs comparison)
So I'm starting to think that there's something more to it. Like, maybe the FPS or ppi/dpi...? I don't know...
I found this thread: Animation speed on different devices, but it lacks a clear answer.
Example code used in my game:
ObjectAnimator anim = ObjectAnimator.ofFloat(this, View.X, this.getX()+120, this.getX()-120);
anim.setInterpolator(new LinearInterpolator());
anim.setDuration(600);
anim.start();
Why are the animations made with ObjectAnimator have different speed when used on different devices, but keeping distance and duration the same if it's nothing to do with resolution? How can I fix it?