Some phonegap questions

Discussion and feedback on Construct 2

Post » Mon Nov 07, 2011 7:31 pm

I am very excited about scirra's recent experimental integration with PhoneGap.
However I have a few questions (Keep in mind that I do not know much about this technology) If any of you know the answer, I would be happy to be enlightened ;).
1. You note that the browser still powers the apps even though they are 'native'. What sort of performance limitations does this bring up?
2. Will the service cost money in the future? as in monthly payments?
3. You also note that only one sound will work at a time. Is this a limitation that will never be fixed or a simple missing feature?

Thanks, sqiddster.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Nov 07, 2011 8:20 pm

[QUOTE=sqiddster]
1. You note that the browser still powers the apps even though they are 'native'. What sort of performance limitations does this bring up?[/quote]
Well, it runs with the same performance as it would in the browser. So it depends on the quality of the phone's javascript engine and HTML5 support. Mobiles are a bit behind desktop browsers so it might be a while before most games run really well this way. For example most mobile browsers don't yet have very fast javascript engines - but they're all moving towards fast compiled engines like desktop browsers, and they're all making moves towards hardware accelerating their canvases as well, so it should only be a matter of time until they're fast enough for most games.

[quote]2. Will the service cost money in the future? as in monthly payments?[/quote]
Possibly - it's up to PhoneGap, and I'm not sure they're certain of their plans yet, but there's a chance they'll keep a free version. Best try it out now while it's free!

[quote]3. You also note that only one sound will work at a time. Is this a limitation that will never be fixed or a simple missing feature?[/QUOTE]
As the r66 changelog notes, it's a hardware limitation. We might be able to work around it with uncompressed WAVs but we'd have to be careful to do that in a way that means nobody can accidentally upload gigantic WAVs to their server that ruins the game download time.Ashley2011-11-07 20:22:32
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Nov 07, 2011 8:57 pm

A hardware limitation? How so? That sounds odd, since phones can play more than one sound at a time.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Nov 07, 2011 9:04 pm

They use hardware audio decoders for compressed formats (.m4a) to save battery life, but the decoder can only do one audio stream at a time. It's only designed for music playback - think of an iPod, it's not really designed for gaming. WAVs don't need decoding so can probably play on top, but it's not something I've actually tried yet so can't say for sure.Ashley2011-11-07 21:04:47
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Nov 07, 2011 11:03 pm

One noob question... how do I enable PhoneGap API audio? I just exported an app for PhoneGap with R66, but still could not get the audio to work with my android phone. I know I must have missed something....
B
6
G
2
Posts: 11
Reputation: 1,214

Post » Mon Nov 07, 2011 11:26 pm

@oriskao it should just work... hmm... is it just a simple "play sound" action?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Nov 08, 2011 12:06 pm

I really liked the work with phonegap, but other question. Phonegap people have the objetive to work with games, ou just minor aplications for smartphones?
B
203
S
37
G
13
Posts: 136
Reputation: 29,523

Post » Tue Nov 08, 2011 1:34 pm

[QUOTE=oriskao] One noob question... how do I enable PhoneGap API audio? I just exported an app for PhoneGap with R66, but still could not get the audio to work with my android phone. I know I must have missed something.... [/QUOTE]

Same here (Android 2.3.4, HTC Flyer); anyways, you can get sound working without limitations (excepted for the poor quality...) on Android using HTML5 and Firefox mobile!

@Ashley: What interests me is iOS - does sound work now on this platform?
I did some testing with Phonegap 1.1.0 and 1.2.0, but neither seem to play sound, though 1.2.0 is better at displaying my game fullscreen in the iPad simulator; is it possible that sound only works when using the online Phonegap build service requiring a valid iOS developer certificate?
B
10
G
2
Posts: 15
Reputation: 1,325

Post » Tue Nov 08, 2011 1:42 pm

I think iOS might limit you to only playing audio when the user performs some action.

So you might only be able to play audio in an 'on object touched' / 'on touch start' event. Try playing some audio in one of those events... it's not using the browser to play audio (it's PhoneGap's Media API) but I guess maybe the same limitation applies.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Nov 08, 2011 2:12 pm

Thank you for the explanation, when attached to a touch event it works.
Now I'll have to rethink the iOS version of my game based on this limitation (forget sound on start of layout, change sound volume on some action and other "sophisticated" features), but something is better than nothing!..
Hopefully this can be solved in an upcoming Phonegap and/or C2 release!
Do you think the restrictions with audio might be related to this: https://github.com/callback/callback-ios/pull/8 ?
B
10
G
2
Posts: 15
Reputation: 1,325

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 13 guests