I can't speak for Google play services, but between the embedded LibGDX networking and Kryonet, I would suggest Kryonet. After all, it was written partially by the authors of Libgdx :) . It's also a big plus that you can integrate kryonet using gradle.
By "Libgdx's embedded networking" I assume you mean the sockets that Libgdx provides. Kryonet handles all of the socket intricacies for you. Why reinvent the wheel?
Kyronet uses a UDP broadcast to discover servers. Its super easy:
InetAddress address = client.discoverHost(54777, 5000);
System.out.println(address);
(or there is a discoverHosts()
function that allows you to get all servers listening on that port)
One caveat is that server discovery only works on the same subnet since UDP broadcasts usually don't travel beyond subnets without special configuration. If you want automatic server discovery outside of the same subnet, then you will likely have to use a matchmaking provider or create a matchmaking server yourself. It seems like Google play services may be a viable option for matchmaking.
To use Google Play services, there is an apk that does need to be installed on the user's device that needs to be present to interact with the services. It is best practice to check for Google Play services before you start using them and prompt the user to install them if they are missing. However, I would venture that most people these days use enough apps with Google Play services that it will already be on the user's device.
Google play services will only be available on the android platform so your android project will need to wrap these google play services in a callback object that would be injected into your core game. I.E.
Create interface in core project
public interface IGooglePlayServices{
void callSomeService(object someParam);
}
Implement it in your android project
public class GooglePlayServices implements IGooglePlayServices {
public void callSomeService(object someParam){
handleToPlayServices.callSomeService();
}
}
Then in your AndroidLauncher
inject it into your game
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
IGooglePlayServices services = new GooglePlayServices();
initialize(new MyGdxGame(services), cfg);
}