Blackberry OS5+ webworks application is terribly slow - javascript

Iam developing a blackberry webworks application which is supposed to work on OS 5.0 and upwards.The app does use a fair bit of jquerymobile. The HTML's had already been developed and it was working well in the ripple emulator. But when I deployed it in an OS5.0 device, the load times were terrible. It took nearly a minute to load a page with some 3 images and a couple of tables (nothing was fetched from the server , all files were in the packaged application in the device). I even tried the pages on the native browser directly and its rendering capabilities were poor (css / jquery mobile etc came out horribly. Javascript was enabled in the device).
What I would like to know is, is native application/very basic html only way to get a decent experience on OS5.0? Is using fair bit of a javascript even feasible on OS5.0 HTML apps?
I even tried using a browserfield2 with caching but that too didnt make much difference.
Just wanted to see if things are indeed this bad in OS5.0 or if I missed something out. Any help/feedback will be greatly appreciated..

Related

How to go about implementing a webkit based windows application?

This is a bit of an open-ended question, since I am just starting out on the project.
Problem: I have clients who cannot install web-browsers on their machines, and are stuck with IE6. The app we are selling them is a web-based app using a lot of javascript and jquery.
Solution: Implement a windows application that has a web-browser control based on webkit (since the regular webbrowser control is not going to support javascript and jquery), which loads the app.
I started doing research, and I found 2 controls:
https://code.google.com/p/open-webkit-sharp/
and
http://webkitdotnet.sourceforge.net/
I started off with the second one, and tried the sample app they built, only to discover that the version of webkit they used is really old and doesn't run our app right.
So my current solution is to compile webkit myself and include the newer version in the control and see how that works out.
Since this is a time-sensitive issue I thought I'd also ask for the experience of StackOverflow at the same time I am going down my route, to see if there is a simpler solution, or if there are any libraries or pre-built controls I could use that I missed in my search?
Thank you for any help!

Reasons why an web-application on iPad3 iOS6 works "sometimes and sometimes not"?

which is all the user, I'm having to remote debug can tell me... Since I'm also without a device to test for the next couple of days, I'm pretty much in the dark.
The application is a web-app written in javascript/jQuery Mobile and working fine on iPad1+2 and iOS3+4. When the user was instructed, the system worked without problems on his iPad
Now he is stuck on the first page and sometimes "nothing happens", but even when the page works he cannot even log into the system.
Question:
Since the application worked fine the first time and I have read there are some new caching mechanisms in iOS, I suspect it could be related to this. However, there is no place to go online when looking for things to be aware of when using script heavy web applications on iOS6.
So, what pitfalls do I have to be aware of when upgrading an application to iOS6?

Android performance hit on later versions than 2.3.5 (phonegap/cordova)

Currently I'm developing an Android App with Phonegap/Cordova (2.1.0/2.2.0) , JQ-Mobi(not jQueryMobile), HTML5 and Javascript and CSS3. The App contains 2 native exstensions.
Somehow, when I export my project to a device with the lastest Android version, the app runs so much slower than an 2.3.5 device.
I've tried enabling the HardwareAcceleration and removed all of the box-shadows and other tough to render css3 stuff. Still on a 4.1.1 or 4.0.4 it runs crappy.
I also upgraded to the latest version of Cordova (now 2.2.0) and it doesn't seem to make it better.
Javascript DOM manipulation happens for about 80-90% when the app is started.
The worst performance is in switching panels and scrolling through forms, most of them have some transitions in them.
I tested it on a Samsung Galaxy S2 android 2.3.5 and it look fine and performs well.
Same device, but 4.0.4 runs crappy.
Samsung Galaxy S3 4.1.1 runs even crappier.
HTC Flyer P512 with android 3.2.1 runs it how it should be running.
Can anyone help me out here? How do I get this performance up? Any Hint or Tips which I havn't mentioned?
I'd like to add that I don't get the issues on an Iphone 3gs and up to explain that it is definitly an Android problem.
My phonegap apps run smoothly on iOS, but perform extremely poorly on Android. As I understand it this is just because Android is much slower at interpreting JavaScript than iOS.
One thing that can help a lot is cutting down on the use of libraries such as jQuery and JQM. If you want to include them, don't use them where you don't have to.
functions such as jQuery.animate run notoriously slow on Android and you'd be better of iterating over arrays with raw JS rather than using jQuery.each etc. etc.
The problem is not just with graphical rendering, but with the speed at which JavaScript is executed. Although lowering the screen resolution can boost your performance.
Edit
I am trying to get to the bottom of this myself and the only answer I can get is to keep computational operations at a minimal.
Use libraries sparingly and solve your problems with raw and well written JavaScript when possible
Keep a small DOM and manipulate it as seldom as possible
Make use of JavaScript performance enhancing techniques
So it really seems that this is a core performance issue, rather than something that could be solved on the Phonegap layer. As a non-scientific example, the exact same init() function on one of my apps executes in about 1.2 seconds in iPhone 4s on average, while taking a sluggish 5 seconds to complete on my samsung galaxy s3.
The core of the problem is that everything is loaded and running in a single page (execution context), personally, though single page apps (sencha, jqmobile etc) are all the rage, the performance on modern devices does not do the user experience any justice. I would separate the app into different pages, this will significantly reduce the size of the DOM and create separate execution contexts for each new page, meaning that your main page (execution context) is nice and lean (DOM is small).
I had the exact same problem. I asked a similar question and eventually answered it myself here after a tonne of research:
Cordova/Phonegap slow performance with Open Layers on new Tablet, but fine on new phone
I won't repeat the entire answer I gave, but the slow performance on certain Android versions is due to what is essentially a bug in WebView which throttles the CPU support for GPU based processes, but doesn't provide GPU support to compensate.
Kitkat V4.4.3 upwards have this fixed, but older versions such as V4.4.2 which are still being used on some devices still suffer.
You can avoid this by not using WebView at all for the HTML rendering, and instead use Crosswalk. For our project this solved the problem entirely and we now have a smooth running application across all Android versions we're targeting. It's quite trivial to do as well.
https://crosswalk-project.org/documentation/cordova.html
https://blog.nraboy.com/2014/10/use-crosswalk-ionic-framework-android-apps/
Try using multithreading and background processing for resource extensive operations.
That worked for me when i had similar problem with one of my apps when it crashes when it runs on versions later than 2.3.3. I never worked with PhoneGap so I'm not sure how you are going to do it.

How do I troubleshoot a crashing Android webview (due to rich JS / interactions)?

I'm using a Droid X, running Android 2.2. I am a client side web dev.
I have some rich functionality (ajax call, spinner, dom access to reinject results).
On of the interactions makes the webview crash. It is not crashing on other android devices (the ones I've tested at least). It also doesn't crash on iPhone or iPad.
Isolating specifically what part of the JavaScript is crashing the webview (I assume it's the JS) is proving to be very difficult.
Anybody have tips on how I can effectively troubleshoot this so I patch my code so the webview won't crash?
Thanks.
Answer: There isn't an easy way that I found. I just had to try to isolate the code as much as possible. It's a good idea to keep the JS decoupled and modular so you can pull out 1 piece, and then run the page without causing errors all over the place. This makes troubleshooting issues like the one above much easier as well.

Developing a cross-platform self-contained HTML application

I am thinking of building an application, kind of like TiddlyWiki in the sense that everything is self-contained in an HTML file, or at least in a bundle where a user won't have to install anything. It works on just about any browser, and on mobile phones (Android and iPhone), and in some browsers (e.g. Firefox), manages to save to the local filesystem without a plugin (albeit, it launches many security warnings, but there are other solutions for that). Other browsers happen to use a Java plugin to bypass this restriction.
Are there any technologies that exist that make this possible? HTML5's web storage sounds like it would be almost perfect, except that the data would be tied to the browser.
Any assistance would be appreciated (even if that just means editting / retagging the question to get more folks looking).
Whats about the fileapi: http://caniuse.com/#search=fileapi
I am just adding a relevant comment with this but not exactly an answer...
When you are saying that you want to develop application which contains everything... Then I would like to add about Titanium, PhoneGap, and others (Corona)...
This softwares provides JavaScript base which will be running on all the mobiles (if mobile applications), desktops (if desktop applications) and so on.... But Titanium (as i am working on it) works on the SDK of all the other languages for development...
Now TiddlyWiki, what i have understood from the link is that it is creating a web application or something like that which will work on all the other mobile devices. But this is NOT Good always, Since some application needs to be a NATIVE environment (which is supported by Titanium). Native applications will be much more faster than any other developed applications..

Categories

Resources