0 Favourites

Buttons unresponsive under Phonegap/WebOS/Android

  • So I just tried running another small performance test app on my HP Pre 3 (weirdly enough, the second layout is displayed 20 FPS faster than on my laptop) but ended up with unresponsive button behaviour.

    This isn't the first time for this to happen (in the past, it also happened on my Android tablet) and I'd really like to find out why this is the case.

    Here's my .capx:

    docs.google.com/file/d/0B4HbmIw0kk7FRnFsTWlvTDhtN0U/edit

    Disabling "Use Mouse Input" on the touch object makes me end up with an 100% unresponsive app (the button does switch to on whenever I touch it, but nothing happens). Setting it to On or replacing the "On Object Touched" event with "On Object Clicked" makes it work somewhat, but still requires me to touch the button several times and, sometimes, to pause and unpause by swipping upwards (which accesses the WebOS card view)

    While the performance is really not that bad, this particular Phonegap Build port suffers from another three issues, which I'd also like to explain:

    1. There's no application icon (possibly due to either the standard icon being too big or being packed wrong).

    2. There's no audio, even though I made sure to include and call an .M4A audio piece (M4A should be the standard for WebOS. Previous tests with OGG didn't work either)

    3. I can't switch the orientation. No matter the angle, the orientation is always staying the same (that's despite having the orientation set to universal on export).

    Help is very much appreciated.

  • Curious, are you using Phonegap build, or building manually from Eclipse?

    I haven't tried Phonegap build, but I built an app with eclipse and phonegap a few weeks ago and didn't have any issues. The only issue I had was generating double touches when I had Use Mouse Input set to YES.

  • Is there a reason you are using the touch event instead of the button - onClick event?

    I've never used buttons, so maybe they don't work with touch if you use the OnClick event?

  • Phonegap Build.

    I haven't yet looked into manually building it with Eclipse (though this would be the obvious solution for a quick fix), since I'd have to download Eclipse first and that's always a pain (I'm on 384kbps).

    Is Eclipse still as JAVA (AKA The Source of All Evil) centric as it used to be? That's one of the reasons I went with Visual Studio 2010 Ultimate, back when I had to choose a set of tools for my day job.

    EDIT: No particular reason. I was just trying several ways of accessing the buttons. None of which really seemed to work.

    The touch event does indeed not work. But neither does onClick (well. Not accurately, anyways. Pushing the button anywhere from 5-50 times is definitely not the kind of experience I was going for).

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Blinx123 I have never had any luck with using the button object in PhoneGap or any other mobile wrapper. What I usually do is use sprites as buttons, this way I can make them match my games theme better, and they always work.

    Here is an old example I made a while back with a rollover effect:

    https://dl.dropbox.com/u/43763487/examples/buttonexample.capx

  • I'm a visual studio man myself, so yes Eclipse is still very Java driven. I don't like it much either, but I am able to use it for what I need and get out. Same for xcode.

  • Wink

    Ya. I've done the same with my memory game. What's weird though:

    1. This approach doesn't seem to work all too well in WebOS either (it did work absolutely fine in Android)

    2. As soon as I manage to actually get in the game, flipping a card (a basic animated sprite) examines the same weird behaviour as with the buttons (i. e. takes approx 30 seconds and several touches).

    Tomorrow, I'll try to manually wrap my IPKs. Something is definitely off and chances are it's Phonegap Build.

    EDIT: I just realized my explanation might've been a bit misleading. The buttons actually are responsive all the time. It's the events that won't fire.

  • Blinx123 I noticed that you are using a Multiline box plugin in your .capx. I wonder if this might have something to do with your issue? Most plugins I have tried seem to work with phoneGap on Android but not with accelerated wrappers. But there is a firs time for everything.

    I don't have a WebOS devise to test on right now but it is on my list of devises to get.

  • Well. I can't imagine, but I'll try to remove it anyways.

    I added the multiline plugin to see whether it would display correctly on a mobile device (which it indeed does. The keyboard also works as it should).

    WebOS is a pretty great little OS. Too bad it's on its deathbed.

  • So I just went to HTML5Test.com to find out why exactly audio wouldn't work.

    Turns out, WebOS 2.x does support neither AAC nor OGG (I was referring to the Enyo 1.0 SDK before, but apparently that info was only good for WebOS 3.x) but only WAV.

    Now I'm not entirely sure what that means for me.

    I've never used WAV as an audio resource for background music before, as I was under the impression that:

    a) Being uncompressed, files are just way too big for several minutes/hours of music.

    b) WAV lacks the concurrency of OGG/AAC.

    a) is, in all likeliness, correct but please someone tell me I'm wrong about b) ;)

    On another note: Since Construct2 forces me to convert WAV to OGG/AAC, I'll probably have to manually change all audio tags within the app's source. Correct?

    EDIT: I just realized something. Apparently, the touch issue is due to the way Construct2 handles touch events. I haven't yet looked into the produced code, but this just became apparent after trying the touch emulation within Construct2.

  • Quick update.

    Buttons do work fine now. I switched to the standard OnClick action and disabled touch emulation. Touch actions are still a horrible mess. Depending on where I place them, they're either slower (sprites) or don't work at all (buttons).

    Audio is still not working though. I slightly altered the function querying the browser for OGG compatibility. While this did work with IE9 and an MP3 file, I can't quite get it to work with .WAV and my HP Pre 3.

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