• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by DORNE · Mar 18, 2018 at 10:20 AM · async

How to use ARCore Session.CheckApkAvailability (); ?

Could you tel me how to use Session.CheckApkAvailability (); ?

I have try different ways without any success: 1) await Session.CheckApkAvailability (); 2) if (Session.CheckApkAvailability ().Result == ApkAvailabilityStatus.SupportedInstalled) 3) Session.CheckApkAvailability (); while (!Session.CheckApkAvailability ().IsComplete) {}

Thanks a lot

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by czpublic · Mar 19, 2018 at 08:28 AM

Try this: (Tested on Samsung Galaxy S7 Edge)

    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)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DORNE · Mar 19, 2018 at 09:41 AM 1
Share

It works well, thanks a lot for your reactivity !

avatar image
0

Answer by Ruminya · Sep 15, 2018 at 04:51 AM

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

75 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to load a large texture at runtime without blocking the pipeline? 1 Answer

Asyncchronous image loading 2 Answers

Load Level Additive Async Lag spike 0 Answers

AsyncOperation.allowSceneActivation is actually static? 0 Answers

AsyncOperation.completed event does not exist in 2017.1.2p4 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges