iprasila Posted February 12, 2014 Share Posted February 12, 2014 Hello, I was wondering if you guys have some experience with using PhoneGap/Cordova to package your game as an Android app. I've recently tested both Cordova and PhoneGap for a simple sprite draw on canvas on Android 4.4 and the it seems terribly slow compared with the same code in the Android Chrome browser. Also, it seems that both Cordova and PhoneGap don't respect much the config.xml file settings. I've tried to force the game to run only in landscape and while there is this option in the config.xml it is not actually used by the CLI build tool. I've had to manually modify the AndroidManifest.xml in order to achive the desired result. Obviously, Corodova and PhoneGap still need a lot of polishing. Ion Quote Link to comment Share on other sites More sharing options...
Gio Posted February 12, 2014 Share Posted February 12, 2014 What about Crosswalk? I haven't tried it myself but it's supposed to be much faster. Quote Link to comment Share on other sites More sharing options...
iprasila Posted February 12, 2014 Author Share Posted February 12, 2014 Thanks for the tip, I'll give it a try later today. Quote Link to comment Share on other sites More sharing options...
enpu Posted February 12, 2014 Share Posted February 12, 2014 Have you tried CocoonJS? Makes HTML5 games run really great on mobile. pjau 1 Quote Link to comment Share on other sites More sharing options...
iprasila Posted February 12, 2014 Author Share Posted February 12, 2014 Have you tried CocoonJS? Makes HTML5 games run really great on mobile. Thanks for the suggestion.Yes, I've already tried CocoonJS. I don't particularly enjoy the workflow, also I hate the idea that I have to be careful what part of the HTML5 is available when I run my app as a WebView or as a Canvas app ... Quote Link to comment Share on other sites More sharing options...
iprasila Posted February 12, 2014 Author Share Posted February 12, 2014 What about Crosswalk? I haven't tried it myself but it's supposed to be much faster. First impression is really good. A bit hackish to find the documentation for the command line options . Fortunately the configuration file is in Pyhton, you can always read the source. I will need to do more tests, I'm really curious how many fps I can get on Android 4.4. Because of the new Chromium WebView, PhoneGap is really crippled on KitKat. Quote Link to comment Share on other sites More sharing options...
iprasila Posted February 12, 2014 Author Share Posted February 12, 2014 With Crosswalk for arm:=================== I have about 60 fps on Android 4.3 ... which is perfect.However, on Android 4.4 KitKat I get about 30 fps Quote Link to comment Share on other sites More sharing options...
Kai Hartmann Posted February 12, 2014 Share Posted February 12, 2014 I am facing the same issue here, using PhoneGap. I read, that the WebView on Android is not hardware accelerated, and that is the reason why it performs so badly.But I am really stumped how slow it is, I am just moving a small single sprite on a canvas, and it's like a slide show. I have to give CocoonJS a try, since their Demos from the Play Store are very fast and smooth.Probably I am doing something wrong, or CocoonJS has some magic in store. Quote Link to comment Share on other sites More sharing options...
iprasila Posted February 12, 2014 Author Share Posted February 12, 2014 I am facing the same issue here, using PhoneGap. I read, that the WebView on Android is not hardware accelerated, and that is the reason why it performs so badly.But I am really stumped how slow it is, I am just moving a small single sprite on a canvas, and it's like a slide show. I have to give CocoonJS a try, since their Demos from the Play Store are very fast and smooth.Probably I am doing something wrong, or CocoonJS has some magic in store. If your game uses Canvas only operations than CocoonJS will work just fine for you, if you mix DOM manipulation and Canvas ... well, you'll see. I wouldn't blame PhoneGap, after all PhoneGap uses what Android offers as the default WebView class. PhoneGaps doesn't implement their own version of Canvas like CocoonJS. Quote Link to comment Share on other sites More sharing options...
iprasila Posted February 12, 2014 Author Share Posted February 12, 2014 Have you tried CocoonJS? Makes HTML5 games run really great on mobile. Yes, see my previous answer. Doesn't fit my workflow well. Quote Link to comment Share on other sites More sharing options...
Kai Hartmann Posted February 12, 2014 Share Posted February 12, 2014 If your game uses Canvas only operations than CocoonJS will work just fine for you, if you mix DOM manipulation and Canvas ... well, you'll see. I wouldn't blame PhoneGap, after all PhoneGap uses what Android offers as the default WebView class. PhoneGaps doesn't implement their own version of Canvas like CocoonJS. Oh, I'm not blaming PhoneGap, PhoneGap is great. I think the Android WebView sucks (If I am not doing anything wrong). Actually found a topic/discussion about this issue at the chromium project: https://code.google.com/p/chromium/issues/detail?id=315111 Maybe this is a solution: https://code.google.com/p/android/issues/detail?id=35739 Quote Link to comment Share on other sites More sharing options...
iprasila Posted April 2, 2014 Author Share Posted April 2, 2014 Oh, I'm not blaming PhoneGap, PhoneGap is great. I think the Android WebView sucks (If I am not doing anything wrong). Actually found a topic/discussion about this issue at the chromium project: https://code.google.com/p/chromium/issues/detail?id=315111 Maybe this is a solution: https://code.google.com/p/android/issues/detail?id=35739 Hello, it is currently possible to use Cordova with Crosswalk as backend. Basically, you will keep using the Cordova syntax except that the WebView in which your app will run will be based on Crosswalk instead of the default Android one. Using the default Android 4.4 WebView for e.g. I was only able to get 4-8 fps while with the Cordova + Crosswalk backend I get 40-60 fps. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.