Android Ultimate Plugin tutorial part 8 – Immersive Full Screen Mode

Hi Guys, let’s tackle about Immersive Full Screen Mode so what is this? this Android Feature lets your app go truly “full screen” but take note this feature is only introduces on Android 4.4 (API Level 19) so make sure your Android Device version is 4.4 and above before testing this feature.

and thankfully to activate Immersive  Full Screen Mode using  our Android Ultimate Plugin is very easy and quick.

First you need to get the instance of AndroidUltimatePluginController

private AndroidUltimatePluginController androidUltimatePluginController=AndroidUltimatePluginController.GetInstance();

Next  if you want to see some Debug Toast Message pass 1 to SetDebug() method else 0 if you don’t want to see this debug messages.

androidUltimatePluginController.SetDebug(0);

To Active Immersive Full Screen Mode just call ImmersiveOn() method and pass your preferred delay in our case we pass 500 milliseconds or 0 if you want to activate it immediately.

androidUltimatePluginController.ImmersiveOn(500);

To Deactivate Immersive Full Screen Mode just call ImmersiveOff() method

androidUltimatePluginController.ImmersiveOff();

And that’s it , see this is so easy and Quick and you don’t need to put Prefab on Unity3d Heirarchy which is extra effort on your side.

Note: this feature is only introduces on Android 4.4 (API Level 19) so make sure your Android Device version is 4.4 and above to activate this feature.

For Reference here’s the exact code that we used on our Immersive Demo

using UnityEngine;
using System.Collections;

public class ShareAndExperienceDemo : MonoBehaviour {
    
    private AndroidUltimatePluginController androidUltimatePluginController;
    private bool isImmersive = false;
    
    // Use this for initialization
    void Start (){
        androidUltimatePluginController = AndroidUltimatePluginController.GetInstance();
        androidUltimatePluginController.SetDebug(0);
    }    

    public void ImmersiveToggle(){
        if(!isImmersive){
            androidUltimatePluginController.ImmersiveOn(500);
            isImmersive = true;
        }else{
            androidUltimatePluginController.ImmersiveOff();
            isImmersive = false;
        }
    }    
}

 

For more information about Immersive Full Screen mode just visit this link

https://developer.android.com/training/system-ui/immersive.html

if the above line of codes does not work or if you have any questions or comments or feedback or suggestions don’t hesitate to email us at gigadrillgames@gmail.com or you can always comment below.

Thank you again for reading and visiting our tutorial.

Happy Coding 🙂

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.