• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Workaround for an AIR 2.7 Android landscape/GPU fullscreen issue

Community Beginner ,
Jul 14, 2011 Jul 14, 2011

Copy link to clipboard

Copied

I'm developing a game with AIR 2.7 and have encountered a very rare and very bizarre issue where if the game is loading while my phone's screen is off (HTC Desire) landscape/GPU fullscreen can break and the game is displayed at 50% of fullscreen scale even though all Stage properties indicate the stage is the correct size.

It's possible to recreate an instance of this issue by using the 'Debug Movie on Device via USB' with the phone's screen off and only unlocking it as the game is loading at the point the "[SWF] android_app.swf - 5863962 bytes after decompression" line has appeared in the Output panel.

Photo of my phone showing this problem attached:

fullscreen_issue.jpg

By allowing Auto-orientation in publish settings I found that if this issue had occurred rotating the device instantly corrected it and fullscreen worked.  That lead me to find that toggling stage.displayState between "normal" and "fullscreen" also cleared this issue.

Here are the code snippets to highlight what I've added to prevent this issue occuring -- note: var "canvas" is set to stage, global var declarations and the handleActivate event need to be added elsewhere:


        private function handleActivate(event:Event):void {
            NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;

            // various app specific things I need to do
            // ...


            fullScreenIssueWorkaround();  // force switch between "normal" and "fullScreen" states to clear
                                          // intermittent fullscreen display issue
        }

             --


        private function updateFullScreenIssueWorkaround():void {
           
            trace("updateFullScreenIssueWorkaround: displayState set to fullScreen");
            if(canvas.displayState == "normal")    canvas.displayState = "fullScreen";
            clearInterval(intervalFullScreenIssueWorkaround);
            intervalFullScreenIssueWorkaround = null;
        }
       
        private function fullScreenIssueWorkaround():void {
           
            if(! intervalFullScreenIssueWorkaround) {
                trace("fullScreenIssueWorkaround: displayState set to normal");
                canvas.displayState = "normal";
                intervalFullScreenIssueWorkaround = setInterval(updateFullScreenIssueWorkaround, updateFrequency);
            }
        }


I hope this is of help to somebody out there hitting the same issue!

Simon / iojoe.com

TOPICS
Development

Views

2.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 14, 2011 Jul 14, 2011

Copy link to clipboard

Copied

Thanks for sharing, bookmarked for later use as I am sure this will surface as a problem for me in the future

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 14, 2011 Jul 14, 2011

Copy link to clipboard

Copied

http://forums.adobe.com/thread/872910?tstart=30


sanika Kulshreshtha wrote:



Hi,

The stage offset issue on fullscreen + landscape + gpu mode has been fixed in the latest release. Please download the sdk from http://www.adobe.com/products/air/sdk/.

Please let us know how it goes.



Thanks.

Sanika

Hi,

Since you can reproduce it on your device simonuu, please try the new SDK and report back. I also was seeing the issue on Android, but not able to reproduce it every time. (iOS was every time) I just tryed the new SDK and so far it seems to have fixed it on both iOS and Android.

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 14, 2011 Jul 14, 2011

Copy link to clipboard

Copied

Hi,

The fix for the fullScreen issue was specific to iOS. If you are seeing this problem on Android, I encourage you to file a bug at http://bugbase.adobe.com with all the relevant test files.

Thanks,

Sanika

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 19, 2011 Jul 19, 2011

Copy link to clipboard

Copied

LATEST

yeah... fixed on iOS, confirmed it is not fixed on android.

thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines