Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by techmale

Hi

I am unsure if this should be engine related, but there is no forum for deployment related stuff, so...

I am developing a small test game, with the main intention of publishing it on Android.
I have embedded my code inside an app, using a WebView to run it.
This all works great, as I get about 50fps on my test phone.

However, when I leave the game and come back to it, ie: restart, it runs at half the speed. And if I leave it again and come back it drops another 50%, down to about 10fps.

What is worse, is that if I kill the process ("force stop"), and restart it, it will be running at 50fps again.

Has anyone seen anything similar?
Does anyone know a solution?


On a different note, is anyone else developing for embedded apps?
eg: phonegap, Titanium or Appmobi?

1 decade ago by MobileMark

I use Appmobi to develop my games for both Android and iOS devices. The only problem I ever see with Android using Appmobi is the different speeds it runs on different devices (not too noticiable unless you have both devices running side by side), but I'm pretty sure the fragmentation of the OS and hardware are to blame.

As far as different speeds from opening and closing the app, I have never had that problem with any of my apks I made with Appmobi's build process.

1 decade ago by techmale

It seems I posted too early, as I am now answering my own question...

The problem is caused by the way android switches intents.

The running embedded web view is paused, and restarted later. This restart reloads the javascript and starts it again, but at the same time, when the webview was paused, the running javascript environment is stored and restarted.

The upshot of this is that you have 2 copies of the code running, and every time you restart you add another.

The simple solution is to clear the html page before the app closes, by overriding the onPaused method and calling webview.loadData("");

NB: this is only for embedded HTML apps, it works fine in the browser.
Page 1 of 1
« first « previous next › last »