Solved - LibGDX - Communicating between the main project and Android

So I’ve only ever coded in 1 project before and I’m interested in giving my game an achievement based system. These achievements would only be for the Android version and I would be using Google Play services.

I’m a little stumped to how I would communicate between the main project and the Android project for unlocking the achievements. My first thought is that I could create an interface that the Android project implements and pass that interface over to the main project. I could then call the interface methods inside the main project, when needed and the Android device would perform whatever it’s implementing. Is this the correct way to go about this? :persecutioncomplex:

[quote=“SauronWatchesYou,post:1,topic:54786”]
Yes.
But all the achievment logic should be on your main project, only the tiny part that unlocks and shows the Google Play “achievment unlocked” should be on your android project. So your interface should contain a single method like “public void unlockAndShowAchievment()”. If you start putting too much logic in your android project you’ll make your cross platform project an Android only game.

Thank you for clearing it up :slight_smile: this is exactly what I thought. :point: