Good news for android developers

A good news is that there is an approach to keep OpenGL context when going to background on Android. More detail information please checkout this pull request.

Many developers and me have done test, it worked ok. But I am not sure if it works great on most Android devices. So please help us to do test and write down the result here.

You should comment the reloading resources in main.cpp for your application.

Thank you.

Any developer can help use to do a test?
Thank you.

It is working like charm…
Test is done for cocos2dx-2.0.4
Dual Mali-400MP graphics in lower configuration tablet
Htc One X
LG GT 540

For cocos2dx-0.13.0
Dual Mali-400MP graphics in lower configuration tablet
Htc One X
LG GT 540

You are great guys…very thankful to the community…

@Viraj Dasondi
Thank you for your feedback.

I tried it on my android devices, GT-I9300 and HW Ascend P1 with cocos2d-x 2.0.4. It works well.

But after I integrated the AdMob, I got a big problem. When the game is running, lock the screen then unlock it, nothing is drawed except the black background, but the background music is playing normally.

All things are well if the three files are not changed.

I have not found the reason.

NovaCreo Studio wrote:

I tried it on my android devices, GT-I9300 and HW Ascend P1 with cocos2d-x 2.0.4. It works well.
>
But after I integrated the AdMob, I got a big problem. When the game is running, lock the screen then unlock it, nothing is drawed except the black background, but the background music is playing normally.
>
All things are well if the three files are not changed.
>
I have not found the reason.

I have got the same issue here (cocos2d-1.0.1-x-0.11.0), and I haven’t integrated the AdMob. No clue what’s the problem is, I tested it on a Samsung Galaxy SI Android 2.3.3, and on a Sony Xperia S Android 4.0.3.

Anyone have an idea?

Best!

Pablo

`NovaCreo Studio
I am sorry. I have not idea too.

`Pablo Tonello
Would you please try it with latest version of cocos2d-x?
Thank you.

Hmm… this approach works for me, BUT… there is a very strange thing.
When I run my app first time, after going foregroung, I get black screen. Then, after force restarting my app, after it goes foreground, game resumes without black screen, everything is OK.
In another words, my game restoring from background sucsessfully only after restart.

What may cause such behavior?

P.s.: my devices is htc desire (2.2.2) and samsung galaxy ace (2.3.6), cocos2d-x version is 2.1.0

UPD: this happens only when I press “home” button. When I press “power” button, it works fine.