O'Reilly logo

Libgdx Cross-platform Game Development Cookbook by Alberto Cejas Sánchez, David Saltares Márquez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing platform-specific code

One of the strong points of Libgdx is the cross-platform deployment feature since a single Java core project can be published to Android, iOS, HTML, and desktop with the help of RovoVM and Google Web Toolkit. However, in spite of abstracting the programmer from the dirty work, each platform has its particularities and there is still a need to handle them specifically under certain circumstances.

This recipe will deal with a real-life platform-specific problem that involves leading the user to a particular rating interface:

  • Desktop: This will route the user to a custom web
  • Android: This will route the user to the app's Google Play Store section
  • iOS: This will route the user to the app's Apple Store section
  • HTML: This ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required