Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Delayed initialization on Android if no internet connection available.

Discussion in 'Unity Everyplay' started by Frima_FXVezina, Oct 26, 2015.

  1. Frima_FXVezina

    Frima_FXVezina

    Joined:
    Apr 23, 2015
    Posts:
    5
    I started by writing the following message in the "propose a feature" feedback section as I couldn't find any way in the documentation nor on the forums that would help me handling the use-case I am trying to handle right now. Still thought I should ask you guys first, just in case.

    Here's the full feature request:
    "The Android device family being so vast and constantly evolving, I understand the technical requirement for this check to be mandatorily performed before confirming if the device is supported or not.

    However, I do not understand why the native api tries to init itself when it's native library is loaded and simply stops after a defined number of tries when I am able to know if an internet connection is available or not. Worst thing is, I don't even have any means to tell the api when it is a right time to retry and give me a tangible answer. There is also no way for me to know if the compatibility check could be performed or not. The only option I am left with to communicate my users is to tell them the device isn't supported, even though that might not really be the case. I can't even tell them to try again on their next session as I might have received a totally legit negative response.

    So after my rant, what I would like to see added to Everyplay:
    1- A way to initialize manually Everyplay on Android when I decide it is the proper time to do so. (Might wanna make it an option in the everyplay settings to auto-init or not).
    2- Any way to differentiate an negative response for a device that is unsupported from a negativeresponse because of compatibility check failure.

    Otherwise, awesome api guys!
    "​

    So, basically, my problem is that I cannot identify the true device support status programatically to communicate to the user, or that I am unable to recover from a fail compatibility check (which would also solve my current problem). Is there any way this can currently be done? Or this should go directly into the feature request box?

    Technical infos:
    Unity : 5.2.1f1
    Everyplay SDK : Unity 2010-1510 - Oct 9th 2015

    Thanks in advance for your time!

    François-Xavier Vézina
    Game Programmer at Frima Studio
     
  2. ullatussimo

    ullatussimo

    Unity Technologies

    Joined:
    Jun 16, 2015
    Posts:
    101
    Hello @Frima_FXVezina ,

    Thanks for reaching out!

    Our Unity plugin contains a feature called Early Initialization. This feature automatically handles the Initialization of Everyplay. The feature was put in place to make it easier to get started with using Everyplay.

    However, it is possible to disable the Early Initialization system and handle the initialization of Everyplay manually.
    You just need to open up Assets/Plugins/Everyplay/Scripts/EveryplayEarlyInitializer.cs -script and disable the Everyplay.Initialize() -call there.

    After you have disabled the call there you have total control on when to initialize Everyplay by calling Everyplay.Initialize() at the time of your choosing.

    Thanks for your suggestions, they will be taken into account.

    Hope this helps!

    Cheers,
    Simo
     
  3. Frima_FXVezina

    Frima_FXVezina

    Joined:
    Apr 23, 2015
    Posts:
    5
    Hello again!

    Thanks for the quick reply!

    I made the change in our project and am happy to report that this does indeed work wonderfully and allows me to handle the android initialization flow at my own leisure and address the test case that was problematic for us.

    I would still strongly advise having something like a boolean in the Everyplay settings that active the Early Initialization or not as this could prove problematic for us to re-apply this "patch" every time we want to update the SDK.

    Or you may even want to look into doing the internet connectivity handling natively in the java classes to keep the ease of integration in future version? I understand this would probably mean some changes in the initialization flow, which would maybe even required developers to change their implementation to conform to these modifications and might be kept until a major version needs to be rolled out.

    My mere two cents on it, I can easily have faith you guys will address this in the way that makes the most common sense. I understand for now this is only a workaround, and am really grateful for it!

    Thanks again! Will keep an eye out for further developments on your plugin :)

    Best regards,
    François-Xavier Vézina
     
  4. skdev3

    skdev3

    Joined:
    Jul 15, 2015
    Posts:
    46
    How to use Delayed initialization option in Unity 2017.2?