Teena Posted October 7, 2014 Share Posted October 7, 2014 Hello there,I have developed game in html5 that is perfectly working on desktop browsers.I have converted this to android app using phonegap.Now my problem is touch events are very slow in android device. I am using three touch events:-touchstart,touchmove and touchend.There is no delay in touchend event but there is approx 300ms delay in touchmove.I just want to solve this delay.,or is there any other way to convert html5 game to android other than phonegap . Thanks. Quote Link to comment Share on other sites More sharing options...
JUL Posted October 7, 2014 Share Posted October 7, 2014 cocoonjs is not flawless but it gives the best performances atm (50/60 ps on average) and it's very easy to use. Just zip your project and open it with the cocoonjs launcher for testing.Make sure you zip your project directly, ie, index.html must NOT be inside a folder, but at the first level of the archive. Then once you tested it and it works, follow the instruction on cocoojs website to publish your game. Quote Link to comment Share on other sites More sharing options...
Sebi Posted October 7, 2014 Share Posted October 7, 2014 You could also try Crosswalk. Quote Link to comment Share on other sites More sharing options...
chg Posted October 7, 2014 Share Posted October 7, 2014 Have you tried tricks like calling preventDefault() on the event object passed to your touchstart event handler? Quote Link to comment Share on other sites More sharing options...
Teena Posted October 7, 2014 Author Share Posted October 7, 2014 yes , i m calling preventDefault which is doing its job ,even my game is working fine in mobile browser chrome(i have tested) ,but not in webview and apk version. Quote Link to comment Share on other sites More sharing options...
Teena Posted October 7, 2014 Author Share Posted October 7, 2014 @ SebastianNette:My game is in kb only, and i tried crosswalk it gives me apk of 16 mb,that is too much...which not good for mobile games Quote Link to comment Share on other sites More sharing options...
Sebi Posted October 7, 2014 Share Posted October 7, 2014 It adds chromium to your game to avoid the webview. Not sure if ppl actually care about the file size. You could also just write a native game if you can't get your game working properly with phonegap/crosswalk/cocoon. Quote Link to comment Share on other sites More sharing options...
chg Posted October 7, 2014 Share Posted October 7, 2014 yes , i m calling preventDefault which is doing its job ,even my game is working fine in mobile browser chrome(i have tested) ,but not in webview and apk version.Sorry, this just sounds too much like you're fighting some default behaviour the WebView control is trying to do for you. Have you experimented with calling stopPropagation() on the event, or trying to handle the event in it's capture phase? Quote Link to comment Share on other sites More sharing options...
oddskill Posted October 7, 2014 Share Posted October 7, 2014 another option is to try intel xdk http://xdk-software.intel.com/ Quote Link to comment Share on other sites More sharing options...
agamemnus Posted October 7, 2014 Share Posted October 7, 2014 Even the 4.4.2 webview is horrid... that's Chromium 30. That Intel SDK thing is Crosswalk, I think. People don't care too much about the file size. I've found that a "this file is large" Google Play window scares a lot of them off, though... but that's at something like 75MB. The other kinda serious issue with Crosswalk is that it uses architecture-specific code, so you will have to compile to x86 and ARM via a multiple APK option and application.mk file... Android L's webview should be probably Chromium 40+ when it comes out. That runs much, much better. Quote Link to comment Share on other sites More sharing options...
Teena Posted October 8, 2014 Author Share Posted October 8, 2014 Is there any way to solve that touch event delay in phonegap app? Quote Link to comment Share on other sites More sharing options...
agamemnus Posted October 8, 2014 Share Posted October 8, 2014 http://www.sitepoint.com/5-ways-prevent-300ms-click-delay-mobile-devices/ Quote Link to comment Share on other sites More sharing options...
Teena Posted October 8, 2014 Author Share Posted October 8, 2014 Thanks all for your suggestions!My problem solved! Quote Link to comment Share on other sites More sharing options...
chg Posted October 8, 2014 Share Posted October 8, 2014 Thanks all for your suggestions!My problem solved!Please post the solution. It will likely help others that find themselves with a similar problem to know what worked for you. Quote Link to comment Share on other sites More sharing options...
agamemnus Posted October 9, 2014 Share Posted October 9, 2014 Please post the solution. It will likely help others that find themselves with a similar problem to know what worked for you. I'll help... Just needs to have a fixed viewport, etc. http://www.sitepoint.com/5-ways-prevent-300ms-click-delay-mobile-devices/ Quote Link to comment Share on other sites More sharing options...
Teena Posted October 9, 2014 Author Share Posted October 9, 2014 I was giving styles like font-size,colour etc... in multiple for loops somewhere in my code.,and these are making android app slower.I just take these parameters out of loop ,the delay of touch events was only because of this. Quote Link to comment Share on other sites More sharing options...
AmeliaAbbe Posted October 9, 2014 Share Posted October 9, 2014 Fine being a lot more particular... can i program a great operating system iphone app throughout Caffeine that has something similar to the web view in order to that we may point out nearby documents within the telephone?Now i am thinking about making a great operating system online game along with i am thinking if it is usually carried out with a little HTML5 along with Javascript which is in the area stashed within the telephone. We seen anything in regards to a web view throughout Caffeine which is precisely why I will be thinking if it could possibly do the job. Quote Link to comment Share on other sites More sharing options...
Nileegames Posted October 16, 2014 Share Posted October 16, 2014 Cocoonjs is the best, we just finished one game Brainy dogs made on HTML5 later ported to iOS and Android. Check out : https://www.facebook.com/brainydogs Quote Link to comment Share on other sites More sharing options...
lidev Posted October 30, 2014 Share Posted October 30, 2014 I think CocoonJS is the best Quote Link to comment Share on other sites More sharing options...
Raiper34 Posted October 30, 2014 Share Posted October 30, 2014 My crosswalk games: https://play.google.com/store/apps/developer?id=Raiper34 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.