Game not suspending on Android

  • Hello,

    If I export a game to phonegap and install it on my Samsung S3 running Android 2.3.6, the Android task manager shows that the game is still using cpu and consuming memory.

    I verified this by exporting the Space Blaster game that is included in the examples folder of Construct 2 108.2 64 edition.

    I also tried debug and release builds for Android.

    Cheers,

    Gez

  • How much CPU is it using exactly? And it's a non-issue if it still uses memory because it's still there for when you switch back to it.

    Try adding some text to a text object in the Browser object's 'on suspended' and 'on resumed' events. This will indicate if it's working properly, and I suspect it actually is, since double-checking our source code indicates we do handle these events.

  • Hi Ashley,

    I started the game by pressing 'touch to begin' and cpu usage has settled to around 50% (but it fluctuates 30% - 49%).

    When I say that it is consuming memory I mean its actively consuming memory over time, if I leave it for a 10 minutes when I go back to the game I get a black screen, and have to force the app to close before I can use it again. However if I switch to another app and go back immediately, the game starts again i.e. it doesn't suspend, it exits.

    I wish I had another android device to test this on, I have to assume its an issue with my particular hardware/software, otherwise I would expect to see other people reporting the same issue, as it is quite an obvious problem.

    Gerry

  • Gez - I tested it on my Android phone and it doesn't get stuck in the background, it simply exits when I press the Home button and never pauses and resumes. I'm not sure if it's a PhoneGap bug, it's hard to tell - I'm in touch with PhoneGap about it.

  • Gez try to logcat it. On your device. There is an logcat app also try to install it click record then start the space blaster game etc... save it and check the log files then.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello, Happy new year!

    I used the logcat app as you suggested, here is the log:

    dl.dropbox.com/u/68543810/alogcat.2013-01-02-09-55-59%2B1100.txt

    I don't really understand it but I did notice this:

    ...

    D/CordovaLog(16597): Uncaught TypeError: Property 'nb' of object [object DOMWindow] is not a function

    D/CordovaLog(16597): file:///android_asset/www/c2runtime.js: Line 73 : Uncaught TypeError: Property 'nb' of object [object DOMWindow] is not a function

    ...

    Gerry

  • Gez - can you try that again but disable minify on export? The minification has garbled the error message and made it useless.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)