private IEnumerator CheckCompatibility()
{
AsyncTask<ApkAvailabilityStatus> checkTask = Session.CheckApkAvailability();
CustomYieldInstruction customYield = checkTask.WaitForCompletion();
yield return customYield;
ApkAvailabilityStatus result = checkTask.Result;
switch (result)
{
case ApkAvailabilityStatus.SupportedApkTooOld:
_ShowAndroidToastMessage("Supported apk too old");
break;
case ApkAvailabilityStatus.SupportedInstalled:
_ShowAndroidToastMessage("Supported and installed");
break;
case ApkAvailabilityStatus.SupportedNotInstalled:
_ShowAndroidToastMessage("Supported, not installed, requesting installation");
Session.RequestApkInstallation(false);
break;
case ApkAvailabilityStatus.UnknownChecking:
_ShowAndroidToastMessage("Unknown Checking");
break;
case ApkAvailabilityStatus.UnknownError:
_ShowAndroidToastMessage("Unknown Error");
break;
case ApkAvailabilityStatus.UnknownTimedOut:
_ShowAndroidToastMessage("Unknown Timed out");
break;
case ApkAvailabilityStatus.UnsupportedDeviceNotCapable:
_ShowAndroidToastMessage("Unsupported Device Not Capable");
break;
}
}
All you need is to call StartCoroutine(CheckCompatibility()); from Start method
(_ShowAndroidToastMessage method taken from ComputerVisionController class)
It’s work on Samsung A6 too, but we need to check which platform using before “StartCoroutine”, an error happen when runing on UNITY_EDITOR.
How to check platform: here