Highlighted

Reporting: Adobe Air - Black Screen Bug Spotted

Community Beginner ,
May 10, 2014

Copy link to clipboard

Copied

Basically, my latest android app got rejected during a certification process due to a black screen popping up after triggering the alarm.

This is my error report that I received from the store:

Black screen appears after alarm

<Procedure>
1. Launch application
2. 'Start' > Play game > Alarm show up > End alarm > Check

<Expected Result>
Black screen should not appear

So all you have to do is create a new android project in air with nothing but a white background, set the orientation to horizontal, check the full screen option, export and install the app, run the app, minimize the app and open the clock app and set an alarm, go back to the app, wait for the alarm, then cancel the alarm once it pops up, and what you get is a black screen.


Interestinly enough, the background music plays in the background, admob ads work as well, only the screen goes black, but once we minimize the app and then go back to it again, everything's fine. Moreover, when the app is in a vertical mode, the black screen doesn't appear.


Additional info: Apps developed in Flash Professional with the use of Air 4.0. Tested on android 4.3 & 4.4.

Unfortunately, I won't be able to upload android air apps until the problem gets fixed .

Adobe Community Professional
Correct answer by Colin Holgate | Adobe Community Professional

I take it this is the Samsung store? They rejected an app I submitted for the same reason.

The issue is caused because the Android alarm alert clears out the GPU texture memory, and AIR doesn’t have any way to know that has happened. You can work around the issue by forcing textures to reload. An easy way to do that is to set the stage quality. Here’s how that would look:

stage.addEventListener(Event.ACTIVATE, fl_Activate);

stage.addEventListener(Event.DEACTIVATE, fl_Deactivate);

private function fl_Activate(event:Event=null):void {

stage.quality = "low";

}

private function fl_Deactivate(event:Event):void {

stage.quality = "medium”;

}

For our apps we use the stage quality of “low”, which uses less memory, and when the app is deactivated the quality is switched to “medium”, then back to “low” when activated again.

That’s enough to make the textures reload.

TOPICS
Development

Views

2.0K

Likes

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

Reporting: Adobe Air - Black Screen Bug Spotted

Community Beginner ,
May 10, 2014

Copy link to clipboard

Copied

Basically, my latest android app got rejected during a certification process due to a black screen popping up after triggering the alarm.

This is my error report that I received from the store:

Black screen appears after alarm

<Procedure>
1. Launch application
2. 'Start' > Play game > Alarm show up > End alarm > Check

<Expected Result>
Black screen should not appear

So all you have to do is create a new android project in air with nothing but a white background, set the orientation to horizontal, check the full screen option, export and install the app, run the app, minimize the app and open the clock app and set an alarm, go back to the app, wait for the alarm, then cancel the alarm once it pops up, and what you get is a black screen.


Interestinly enough, the background music plays in the background, admob ads work as well, only the screen goes black, but once we minimize the app and then go back to it again, everything's fine. Moreover, when the app is in a vertical mode, the black screen doesn't appear.


Additional info: Apps developed in Flash Professional with the use of Air 4.0. Tested on android 4.3 & 4.4.

Unfortunately, I won't be able to upload android air apps until the problem gets fixed .

Adobe Community Professional
Correct answer by Colin Holgate | Adobe Community Professional

I take it this is the Samsung store? They rejected an app I submitted for the same reason.

The issue is caused because the Android alarm alert clears out the GPU texture memory, and AIR doesn’t have any way to know that has happened. You can work around the issue by forcing textures to reload. An easy way to do that is to set the stage quality. Here’s how that would look:

stage.addEventListener(Event.ACTIVATE, fl_Activate);

stage.addEventListener(Event.DEACTIVATE, fl_Deactivate);

private function fl_Activate(event:Event=null):void {

stage.quality = "low";

}

private function fl_Deactivate(event:Event):void {

stage.quality = "medium”;

}

For our apps we use the stage quality of “low”, which uses less memory, and when the app is deactivated the quality is switched to “medium”, then back to “low” when activated again.

That’s enough to make the textures reload.

TOPICS
Development

Views

2.0K

Likes

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
May 10, 2014 0
Adobe Community Professional ,
May 10, 2014

Copy link to clipboard

Copied

I take it this is the Samsung store? They rejected an app I submitted for the same reason.

The issue is caused because the Android alarm alert clears out the GPU texture memory, and AIR doesn’t have any way to know that has happened. You can work around the issue by forcing textures to reload. An easy way to do that is to set the stage quality. Here’s how that would look:

stage.addEventListener(Event.ACTIVATE, fl_Activate);

stage.addEventListener(Event.DEACTIVATE, fl_Deactivate);

private function fl_Activate(event:Event=null):void {

stage.quality = "low";

}

private function fl_Deactivate(event:Event):void {

stage.quality = "medium”;

}

For our apps we use the stage quality of “low”, which uses less memory, and when the app is deactivated the quality is switched to “medium”, then back to “low” when activated again.

That’s enough to make the textures reload.

Likes

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
Reply
Loading...
May 10, 2014 1
Community Beginner ,
May 10, 2014

Copy link to clipboard

Copied

Yes, it's the samsung store. Anyway, thanks for the workaround. Tested the app and it works flawflessly

Likes

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
Reply
Loading...
May 10, 2014 0
Contributor ,
Sep 09, 2014

Copy link to clipboard

Copied

I tried this fix and still getting issues reporting on Samsung devices.  I am using GPU rendermode and not really sure how to fix this.  I have an admob interstitial on startup and feel like that is what is causing the issue but I haven't been able to reproduce myself.

Likes

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
Reply
Loading...
Sep 09, 2014 0
Adobe Community Professional ,
Sep 09, 2014

Copy link to clipboard

Copied

It may well only be GPU mode that shows the problem, though I could imagine Stage3D in Direct mode would do the same. The general case is that when the AIR app goes into the background and then comes back, the GPU textures may have been wiped out by the system. If you do really go to the background, as would be the case when an alarm dialog appears, you'll get the deactivate event that you can use to know that it has happened, and you can set the stage quality on the activate event.

In the case of the ads it may not count as being a full deactivate, but there is bound to be an event from the ad ANE. Look in its documentation for what evens happen when the ad is closed, and apply the stage quality work around to that event.

There is a chance that you won't have got the deactivate event, to set the quality to something different, and then when the activate event tries to change the quality nothing happens. At least I'm thinking that may be the case. You could work around that by testing if the quality is the one you want, then go away from that and back again to force a reload. For example, if you want the quality to be "medium" while the app is running, you could do this in the activate event, to make sure that it went away from medium:

if(stage.quality == "medium")  stage.quality = "low";

stage.quality = "medium";

Likes

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
Reply
Loading...
Sep 09, 2014 0
Contributor ,
Sep 09, 2014

Copy link to clipboard

Copied

I have tested the interstitial and do get those events but maybe different devices behave differently so maybe I will also try to toggle when the ad is dismissed.  I havent been able to reproduce on any test devices so not sure how to resolve, I just get reviews in google play that say it is blank.

Likes

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
Reply
Loading...
Sep 09, 2014 0
Engaged ,
Sep 11, 2014

Copy link to clipboard

Copied

Colin is a genius.

Likes

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
Reply
Loading...
Sep 11, 2014 0