Platform
Contains utilities for platform-specific code. Allows to easily determine current application platform and its version. Can execute given actions only on specific platforms.
Properties
The ApplicationType reported by the current libGDX application. Throws GdxRuntimeException when unable to determine the platform.
True if ApplicationType.Android is the currentPlatform.
True if ApplicationType.Applet is the currentPlatform.
True if ApplicationType.Desktop with a graphical application is the currentPlatform.
True if ApplicationType.HeadlessDesktop without a graphical application is the currentPlatform.
True if ApplicationType.iOS is the currentPlatform.
True if ApplicationType.Android or ApplicationType.iOS are the currentPlatform.
True if ApplicationType.WebGL is the currentPlatform. To determine if the application is running in an Applet, use isApplet instead.
Functions
Executes action if the currentPlatform is ApplicationType.Android. Returns action result or null.
Executes action if the currentPlatform is ApplicationType.Applet. Returns action result or null.
Executes action if the currentPlatform is ApplicationType.Desktop. Returns action result or null.
Executes action if the currentPlatform is ApplicationType.HeadlessDesktop. Returns action result or null.
Executes action if the currentPlatform is ApplicationType.Android or ApplicationType.iOS. Returns action result or null.
Executes action is the current platform version (such as Android API version or iOS major OS version) is equal to or higher than minVersion and equal to or lower than maxVersion. If a platform is given, the currentPlatform must also be the same in order to execute the action.
Executes action if the currentPlatform is ApplicationType.WebGL. Returns action result or null. Not that the action will not be executed in an Applet - use runOnApplet instead.