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 ...

Get Libgdx Cross-platform Game Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.