One of the most common complaints you hear from Adobe AIR developers is that they can’t get true full screen on Android devices that have an on-screen navigation bar (the one that contains the back, home and task buttons), with full screen usually meaning that the buttons are simply replaced with a series of grey dots.
If you’re one of those developers, then this AIR Native Extension (ANE) may be the solution you’ve been looking for.
This ANE requires Adobe AIR 4+.
How does it work?
This ANE enables developers to offer the same true full screen experience you see in apps like YouTube in their own Adobe AIR apps, expanding the app right to the edges of the screen, hiding the status and navigation bars until the user next interacts with the screen.
This is ideally suited to video or cut-scene content.
Code example
Using the ANE in your app couldn’t be easier:
import com.mesmotronic.ane.AndroidFullScreen; AndroidFullScreen.hideSystemUI();
If you want to include the ANE in a cross-platform app, you have two options for implementation:
if (!AndroidFullScreen.hideSystemUI()) { stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; }
or
if (AndroidFullScreen.isSupported) { AndroidFullScreen.hideSystemUI(); } else { stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; }
Starling
To use this ANE with Starling, add Starling.handleLostContext = true; at the start of your ActionScript code to prevent Stage3D lost context errors breaking your app when switching between the normal app state and true full screen.
What’s next?
In the future, we’ll probably add more of Android’s ImmersiveMode features, like enabling your app to appear behind the user’s status and/or navigation bar.
Download
Click here to download the latest release from GitHub
Open source
This source code for this project has been made available on GitHub, under the BSD license.
Enable true full screen in your Android apps using out new ANE for Adobe AIR http://t.co/5UTmGhxLHH
Hi,
I´m trying to use your “AndroidFullScreen.ane” with Flash CS6 on MAC. I´m compiling for “AIR 4.0.0.1390 for Android”.
I´m importing the ANE from ActionScript settings panel, and I´m using “import com.mesmotronic.ane.fullscreen.AndroidFullScreen” on my main source .as, but I get this error:
“1172: Definition not be found: com.mesmotronic.ane.fullscreen:AndroidFullScreen”
Any ideas?
On the other hand, with the next line: “stage.displayMode = StageDisplayMode.FULL_SCREEN_INTERACTIVE”, do you want to say “stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE”?
I don´t know if I´m doing something wrong.
Thanks,
Jesus
will try it ! thx a lot :)
[…] Enable true full screen in your Android apps using out new ANE for Adobe AIR | Mesmotronic Blog […]
Hi erChusBC,
Thanks for pointing out the typo: we did of course mean stage.displayState! ;-)
We don’t have Flash CS6 installed here, but Adobe have published a useful article about using ANEs with Flash CS6 at http://adobe.ly/1bPehDr and another one covering Flash CS5.5 at http://adobe.ly/1cyZ7lG.
Check that you’re using “import com.mesmotronic.ane.AndroidFullScreen;” without the “fullscreen.” in the middle.
Let us know how you get on!
UPDATE: We’ve just tested the ANE with Flash CC using AIR 4 SDK and… it worked!
Same error with Flash CC / Win7 64bit: Definition not found. I know nothing about ANEs, but every ANE I’ve tried had an AS3 class to import… weird. I Would love this to work!
OK Bingo, the import statement is wrong, its:
import com.mesmotronic.ane.AndroidFullScreen;
Well, now we need a way to know the real pixel resolution… This extension doesn’t affect the reported height with stageHeight / fullscreenHeight / Capabilities.screenResolutionY; the’re all the same as with the nav bar ;(
Hi José,
I’ve just added basic resize handlers to the Flex example on GitHub, one for the Application and one for the stage, and it’s correctly reporting that there’s a few extra pixels available in both directions:
protected function resizeHandler(event:ResizeEvent):void
{
trace("Application:", width, "x", height);
}
protected function addedToStageHandler(event:Event):void
{
stage.addEventListener(Event.RESIZE, function(e:Event):void
{
trace("stage:", stage.stageWidth, "x", stage.stageHeight);
});
}
UPDATE:
We’ve just created an AS3 example project for Flash Builder with a stage Event.RESIZE handler, and can confirm that the stageWidth and stageHeight properties are being reported correctly. The example has been added to GitHub.
Check out our true full screen #ANE for Adobe #AIR for #Android, now with added examples for #AS3 and #Flash CC http://t.co/aWVJspWbBP
Hi again,
I have tested the ANE with the new import statement, and I can compiling without problems with Flash CS6 on MAC and “AIR 4.0.0.1390 for Android”. Thank you!
Anyway, I have a problem with my project. I´m using the “Starling” engine (Stage 3D) for some graphics objects and when I execute “AndroidFullScreen.hideSystemUI()”, it´s seem this objects desapairs instead of “on-screen navigation bar”, any ideas?
Thanks!
Hi erChusBC: great to hear that you’re up and running.
UPDATE (20/02/2014): The Starling issue is caused by a lost context error and can be resolved simply by adding “Starling.handleLostContext = true;” to your code and updating the view port size to stage.stageWidth x stage.stageHeight when the stage is resized.
To use out true full screen #ANE for Adobe #AIR for #Android with #Starling, add Starling.handleLostContext=true; http://t.co/W9nKpj6WiN
erChusBC
Where do you put the code for starling…
How does your xml file looks like also?
I can’t make it work
You can put
Starling.handleLostContext = true;
in the constructor of your document class, before you create any other Starling objects.Several basic AS3 and Flex examples are available on GitHub. Just click the Source code (zip) button on https://github.com/mesmotronic/air-fullscreen-ane/releases to download them and you can take a look at the XML to see how it compares to yours.
It works but the moment i touch the screen to play the game
the toolbar comes back again on Nexus FHD 7 1920×1080
Actually both of the toolbar are coming back again
the top one
and the navigation one
As stated in the blog post, that’s how the plug-in works. Android does not currently support interactive true full screen without root.
But whats the use of this ane if after that it comes back again to the previous state?
As it mentions in the post, it was primarily created to facilitate the playback of true full screen video, cut scenes and animation sequences.
If you’re using Android 4.4 KitKat, you can now use the new true full screen interactive immersive mode using the latest update to this ANE. Check out the latest post at http://wp.me/pKrhE-9f
Hi, I am getting this error. Please tell me, How to solve this?
“The content cannot be loaded because there was a problem loading an extension: Error: Extension namespace is invalid”
Hi, I am getting this error, Is there any solution for this?
The content cannot be loaded because there was a problem loading an extension: Error: Extension namespace is invalid
It’s not something we’ve seen here, but the most likely reason it that you’re trying to use the extension with using AIR < 4.0.
Hi,
The extension worked good with video loaded using StageVideo, but the flash display object is not showing in full screen, can this be done using this extension full screen for flash display not only video
i have used this:
import com.mesmotronic.ane.AndroidFullScreen;
this.removeEventListener(Event.ADDED_TO_STAGE, onAdded);
function onAdded(e:Event):void {
AndroidFullScreen.showUnderSystemUI();
AndroidFullScreen.immersiveMode();
if (! AndroidFullScreen.immersiveMode()) {
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}
}
If you head over to GitHub (link above) and download the source for the project, there are several examples included which demonstrate the plugin being used for non-video purposes which should help you to resolve the issues you’re experiencing.
Thx.
I have solved it, i just unchecked the full screen from Flash pro.
(false)
Is it should work on ICS 4.0.3.?
I have rooted device with physical navigation buttons.
Air 13.0.0.111 and Flash CS6.
No matter what I do, can’t hide the nav bar. I’ve tested ‘fullscreen-ane-example-fla’ example but still no luck. Maybe I´m doing something wrong.
Yes: hideSystemUI() works with ICS, but immersiveMode() requires KK
It does not work for me. I have Tracer OVO 1.2, 7″ tablet…
I tried to embed AIR runtime with app and without that. Also I tried uncheck the fullscreen option but it doesn’t work. Three gray dots instead icons, that’s all I was able to get. Other applications from Google play have no problems with fullscreen on my tablet.
Maybe Aspect ratio and Auto orientation option it matter?
Any help will be appreciated. Thanks!
The most common issue in Flash Pro is using the wrong version of the AIR SDK. The current ANE required AIR 13+: do you have the latest version installed? If not, you could try updating or using an older release of the ANE from https://github.com/mesmotronic/air-fullscreen-ane/releases
Yes, I have AIR 13.0.0.111 installed and Flash CS6.
A colleague confirmed it’s working in Flash CC, Android 4.2; unfortunately, we don’t currently have access to CS6 or an OVO. Our suggestions at this point would be to:
Ok I’ve tested all versions. All returns TRUE but nav bar won’t disappear.
My AS3 code:
import com.mesmotronic.ane.AndroidFullScreen;
anetest.text = String(AndroidFullScreen.isSupported);
AndroidFullScreen.hideSystemUI();
My publish and library path settings:
[URL removed]
And apk (1.0 and 1.2.3):
[URL removed]
Also I checked:
anetest.text = String(AndroidFullScreen.hideSystemUI());
Both newest and older version returns TRUE.
Both of your APKs work perfectly on all of the Android 4.x devices I’ve tested them on so far (although we couldn’t find anything running 4.0).
Are you plan some research on this issue?
I have to use third party apps (like full!screen) to run my AIR apps in fulscreen mode. Also I cant uprade my Android to 4.0.4 or higher.
I will try to experiment with my launcher, maybe it’s stock launcher issue but I highly doubt it.
Our full screen ANE is a tool that we thought others may find useful and have made freely available as an open source project for others to use and experiment with in any way they wish. So, while we are not able to allocate any additional time or resources to this issue, you (or any other developer) are welcome to fork the project and adapt it to your specific requirements.