Package a game for Google Play Games on PC

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:

Kotlin

valhasKeyboard=resources.configuration.keyboard==KEYBOARD_QWERTY

Java

booleanhasKeyboard=getResources().getConfiguration().keyboard==KEYBOARD.QWERTY

C#

varunityPlayerClass=newAndroidJavaClass("com.unity3d.player.UnityPlayer");
varcurrentActivity=unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity");
varresources=currentActivity.Call<AndroidJavaObject>("getResources");
varconfiguration=resources.Call<AndroidJavaObject>("getConfiguration");
varkeyboard=configuration.Get<int>("keyboard");
varhasKeyboard==2;// Configuration.KEYBOARD_QWERTY

Or by checking for the "com.google.android.play.feature.HPE_EXPERIENCE" system feature:

Kotlin

varisPC=packageManager.hasSystemFeature("com.google.android.play.feature.HPE_EXPERIENCE")

Java

PackageManagerpm=getPackageManager();
booleanisPC=pm.hasSystemFeature("com.google.android.play.feature.HPE_EXPERIENCE")

C#

varunityPlayerClass=newAndroidJavaClass("com.unity3d.player.UnityPlayer");
varcurrentActivity=unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity");
varpackageManager=currentActivity.Call<AndroidJavaObject>("getPackageManager");
varisPC=packageManager.Call<bool>("hasSystemFeature","com.google.android.play.feature.HPE_EXPERIENCE");

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 2026年06月09日 UTC.