Detecting Android Go phones

834 views Asked by At

I have developed an application but now I would like to check at the first startup of the app if it is an Android Go phone and if so, inform the user that it is not supported.

In Android it is possible to check the SDK version but is it also possible to check if it is a Go phone?

I would like to exclude Android Go phones because they do not support SYSTEM_ALERT_WINDOW which my app needs.

2

There are 2 answers

1
benjiii On BEST ANSWER

Looking on the official documentation https://developer.android.com/google/play/publishing/multiple-apks, it says that for an app to run on android Go, you need to

To target devices running Android (Go edition), your APK needs to declare:

<uses-feature android:name="android.hardware.ram.low" android:required="true">

target at least API Level 26, and have a higher version code than your non-Go edition APK.

so by simply not putting the previous code in your manifest, your app will not be available for android Go.

1
Naftoli Ost On

You could call either

 ActivityManager.isLowRamDevice();

or

PackageManager.hasSystemFeature("FEATURE_RAM_LOW");

Both will return true if the device is running Android Go edition, and false if it's running the regular Android.

source