Jump to content

Is Phone Gap that bad?


plicatibu
 Share

Recommended Posts

Hi.

I read the that phone gap has a horrible performance and that one should go with cocooenjs and elektra.

I never used any so my question: is phone gap that bad or it is just for older versions?

It seems that its current version is 3.3.

I am asking because a friend of mine has a book about phone gap and I am wondering whether I should read it or if I am better of learning cocoonjs.

Thanks.

Link to comment
Share on other sites

I have not used Cocoon nor Elektra.  I have used Phonegap, and in conjunction with ios, I have found it to be performant enough for my purposes (Pixi-based app with middlin amount of animation).  I can tell you that it is terrible with the stock Android browser, but that browser is terrible no matter how you slice it. 

 

Still, I have read that cocoon does improve the performance of graphics on the stock android browser - bringing it from essentially unusable to merely bad.  Chrome is reported to be much better than the stock browser, but not as good as Safari for graphics performance.  My guess is that if you have light to medium graphics requirements, Chrome plus Phonegap would work out.

 

Somewhere I have stashed away a link that has some data to support these assertions.  I'll look for it.

Link to comment
Share on other sites

Phonegap itselfs simply uses the native webview to show your html project. So, there is no performance boost by Phonegap itself AFAIK,

 

The phonegap project itself is a pretty solid project in my opinion. Because of the known performance issues - it is not the best solution for games yet. This will slowly change though - since the webview are getting better day by day, e.g. http://www.mobilexweb.com/blog/android-4-4-kitkat-browser-chrome-webview

Link to comment
Share on other sites

I couldn't find the original performance comparison post I was thinking about, but I did find this:

https://www.scirra.com/blog/85/the-great-html5-mobile-gaming-performance-comparison

 

The results and conclusions drawn in this article are somewhat contradictory to my assertion about Phonegap on ios.  I can only tell you that for me, it has been ok - but I'll grant you I have not tested iPad 3 yet.  The article does bear out my assertion about stock android browser with phonegap however - it's poo poo.

 

Note that the information in this article is from 2012.

 

I will give a recommendation that I think makes sense.   If you are only ever going to put out graphics based games, I think it makes sense to focus on CocoonJS.   If you plan on doing other kinds of apps as well, then Phonegap makes good sense.

Link to comment
Share on other sites

Thank you all for helping me. The links contain really nice articles.

mwatt: could you please elaborate what would be a medium graphics requirements? I'm brand new in this field and I don't have the right notion of what is considered hard requirements yet.


Gio: why is hard to integrate with cooconjs? Could you give me a sample?

My main concern with cocoonjs is about the future. It's free to use now but it's not open source AFAIK.

In the near future they will demand us to pay in order to use it. Fair enough. But how much will it cost? Won't they demand an absurd price after sometime you're used paying?

See the example of Marmalade SDK. It had an indie license of $99/year. Then suddenly the indie license started costing $499/year. And this new indie license doesn't assure you access to all supported platforms.
 

That's why I was considering PhoneGap (but of course it needs to be a viable solution).

 

Regards.

Link to comment
Share on other sites

Like benny said, PhoneGap is just a wrapper, so pretty much anything that works in a standard browser works in PhoneGap. Optimizations that make sense for standard browsers make sense for PhoneGap too, in most cases. If you've made a game that works great in standard browsers, it will just work the same in PhoneGap.

 

CocoonJS is different - if you're making a game specifically for CocoonJS, it's all good and really fast. If you're hoping to get a game designed for browsers to work and perform well with CocoonJS, depending on what your code is doing, you may be in trouble. For example, if you have multiple layered canvases, or use lots of vector graphics. There are always workarounds but it isn't as straightforward as PhoneGap.

Link to comment
Share on other sites

I published a game using CocoonJS, it's fast. I tried PhoneGap, it's far slower.

 

I think it's because CocoonJS focuses heavily for high performance app like games. They even provided a direct canvas to boost performance, which means they have heavily customized wrapper for performance instead of just multi-purpose display. Applying CocoonJS into the workflow is not quite straightforward; you need to use their launcher (and sometimes when you publish it to a final app itdoesn't always give the same result), some API to work out with their wrapper, but it's not that hard either.

 

PhoneGap really is just a wrapper for web developers who want to make mobile application without using native languages like Java/Objective-C.

 

I always look at the company behind these wrappers, who are they and what they do, and what are their market targets. According to that you can see whether the wrapper is optimized to your needs or not. In my case, if I'm creating games, I won't use PhoneGap. But for business applications, of course PhoneGap is one of the right choice.

Link to comment
Share on other sites

@plicatibu

 

What I meant by medium graphics requirements is not a lot of graphics resources in play all at once.  For instance, I can get away with animation, but I try to keep it to one or maybe two small objects at a time.

 

However, again, I must stress that on Safari, I had decent success this way.  On the stock Android browser, it was a complete disaster.

 

The folks that say Phonegap is not ideal for games, are absolutely correct.   To summarize what I am saying, you can get away with it on Safari if your graphics requirements are modest.  I have yet to try Chrome on a decent Android device, but I suspect it might be workable with modest graphics requirements (i.e., not moving more than one or two objects at a time and those objects not being really big).

 

I suppose I should add that I have been using Pixi with canvas rendering.  I haven't tried Phaser in a like manner yet, although this is in the works.

Link to comment
Share on other sites

I can suggest Cross Walk :) it is not perfect for now, but better than Phonegap or Cocoonjs ;)

 

Link to comment
Share on other sites

 

 

IOS is not supported, only android for now

It is complete browser engine bassed on chrome browser for android. 

Appliacations os around 20 MB (graphic + 4 mp3 music tracks)

Why better? For example, i can use leadbolt or another service (Cocoonjs not) and performance is 100% better than Phonegap

Link to comment
Share on other sites

Please keep us updated.

 

For now, I am not convinced:

 

  • no working examples/showroom
  • android only
  • Still not sure what the exact overload is to the final package size

That said - the overall project "sounds" promising. I just think it just will take some time until it is producion ready. But maybe you can proof me wrong.

Link to comment
Share on other sites

  • 2 weeks later...

I've been working with Phonegap/Cordova recently and my first game is finished and available in the Play Store (see here :) ). In my opinion Phonegap has three main drawbacks:

  1. It's difficult to install
  2. Canvas and sound not hardware optimized
  3. You still have to do Phonegap specific stuff in your javascript (not pure html5)

As for the first point, I know other development tools and frameworks can also be difficult to setup initially, but seriously just look at this. They "explain" the install procedure using some weird command line interface that I couldn't figure out at all. I was only able to get it up and running using this tutorial by Andrew Trice. Maybe they do this on purpose so developers will buy their build-service at $10 a month.

 

About the performance, most HTML5 game developers use the canvas element as if it's a normal screen buffer and redraw the entire canvas every frame, like 30 or 60 frames per second which will not work with Phonegap (although I must say I have not tried this). Anyway, it is possible to create games using only the document object model (DOM), and moving around DIVs and whatnot. This is perfect for turn-based games, card games, chess/checkers etc. Also, I haven't tried it but maybe you can use the canvas element as long as you don't redraw it every frame. For example redraw a level background only at the beginning of a game.

 

And the last point, I was dissapointed that I could not just copy my html/js files into phonegap and then it would work. Instead there are lots of little tweaks you have to do to make it work. Some of these are due to the default Android webviewer, which I can understand. But for example there is a separate cordova-plugin-lowlatencyaudio just so sound samples will play normally as you would expect them (i.e. without a delay).

Link to comment
Share on other sites

I agree with PhoneGap being difficult to install. Once you have it though, it is pretty simple to create and deploy an application with it. A major drawback is so far, that the WebView in Android 4.4 is buggy in terms of canvas drawing performance.

 

Crosswalk seems to be an option for Android devices, if the Blink engine does not suffer the same bug.

 

Update: After doing so, I realized that Crosswalk is difficult to install, as well.

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 9 months later...
 

Very cool phonegap game! What is your experience with phonegap and cocoonjs? I plan to use phonegap for my game but some say cocoonjs is better lmk thanks  :)

 
I've also posted this on stackoverflow (see here), but here are my two cents: I've now developed two html5 games and released them both as native Android apps.
 
Find the Difference uses phonegap/cordova and it only draws to the canvas once at the start of a level, and when the player finds a difference. The rest of the animations are all DOM manipulation, and it's not a lot of animations anyway so performance is not really an issue, even on older devices. However setting up Phonegap/Cordova to work with Eclipse or Android Studio is quite a hassle (see my post here). You have to work with NodeJS command line, using the framework results in weird and unhelpful errors, debugging is tricky, you can't play simple sounds normally without using a plug-in, the softkeyboard can cover up input boxes, weird canvas draw errors, canvas not loading at all on some devices. On the plus side, admob is easy to implement in phonegap and I've received some revenue from this game (not much though, I'm lucky when I get a few bucks per week).
 
Tap-Tap Submarine is a Phaser game deployed with Cocoonjs, which as far as I know is the fastest framework out there for canvas and action games. However it still runs much too slow on anything but high-end mobile phones, which effectively shuts out a large part of your potential users. Also, with Cocoonjs you're stuck with Mopub for any ad banners, and from my personal experience it's not very good. The webdashboard is a mess, it's difficult to get it to work and even when you get it to work half of the time it doesn't show ads at all. So this, combined with a poorly performing app, I figure my chances of getting any mopub payments are slim to nil.
 
So this is all a shame because I think html5/javascript development is great, especially with Phaser you can create some impressive games relatively easy. Still, if you already have some html5 games you want to quickly deploy to Android/iOS then phonegap might be useful. But if you are looking to develop html5 games purely to release them as native apps I wouldn't recommend it. You're probably better off going native (java using anddev, libgdx etc) because that will result in a better overall app, and it will probably cost the same amount of time and effort to develop as it would a html5 game.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...