Stay organized with collections
Save and categorize content based on your preferences.
Since Google Play Games on PC provides a standard Android runtime environment,
there are no differences between packing your game for mobile or PC outside of
ensuring that you include x86 or x86-64 binaries. When possible, you should use
the same APK or App Bundle on PC as you do for mobile
builds.
When using one package across mobile and Google Play Games on PC, it is best to
enable Google Play Games on PC specific features at runtime either by
detecting the presence of a keyboard:
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-09-19 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-19 UTC."],[],[],null,["# Package a game for Google Play Games on PC\n\nSince Google Play Games on PC provides a standard Android runtime environment,\nthere are no differences between packing your game for mobile or PC outside of\nensuring that you include x86 or x86-64 binaries. When possible, you should use\nthe same APK or [App Bundle](/guide/app-bundle) on PC as you do for mobile\nbuilds.\n\nWhen using one package across mobile and Google Play Games on PC, it is best to\nenable Google Play Games on PC specific features at runtime either by\n[detecting the presence of a keyboard](/games/develop/all-screens#handle-interaction-models):\n\n\u003cbr /\u003e\n\n### Kotlin\n\n\u003cbr /\u003e\n\n val hasKeyboard = resources.configuration.keyboard == KEYBOARD_QWERTY\n\n\u003cbr /\u003e\n\n### Java\n\n\u003cbr /\u003e\n\n boolean hasKeyboard = getResources().getConfiguration().keyboard == KEYBOARD.QWERTY\n\n\u003cbr /\u003e\n\n### C#\n\n\u003cbr /\u003e\n\n var unityPlayerClass = new AndroidJavaClass(\"com.unity3d.player.UnityPlayer\");\n var currentActivity = unityPlayerClass.GetStatic\u003cAndroidJavaObject\u003e(\"currentActivity\");\n var resources = currentActivity.Call\u003cAndroidJavaObject\u003e(\"getResources\");\n var configuration = resources.Call\u003cAndroidJavaObject\u003e(\"getConfiguration\");\n var keyboard = configuration.Get\u003cint\u003e(\"keyboard\");\n var hasKeyboard == 2; // Configuration.KEYBOARD_QWERTY\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nOr by checking for the `\"com.google.android.play.feature.HPE_EXPERIENCE\"` system\nfeature: \n\n### Kotlin\n\n```kotlin\nvar isPC = packageManager.hasSystemFeature(\"com.google.android.play.feature.HPE_EXPERIENCE\")\n \n```\n\n### Java\n\n```java\nPackageManager pm = getPackageManager();\nboolean isPC = pm.hasSystemFeature(\"com.google.android.play.feature.HPE_EXPERIENCE\")\n \n```\n\n### C#\n\n```c#\nvar unityPlayerClass = new AndroidJavaClass(\"com.unity3d.player.UnityPlayer\");\nvar currentActivity = unityPlayerClass.GetStatic\u003cAndroidJavaObject\u003e(\"currentActivity\");\nvar packageManager = currentActivity.Call\u003cAndroidJavaObject\u003e(\"getPackageManager\");\nvar isPC = packageManager.Call\u003cbool\u003e(\"hasSystemFeature\", \"com.google.android.play.feature.HPE_EXPERIENCE\");\n \n```"]]