Question

I have developed android mobile application using jquery mobile 1.2.0 and cordova. Its working fine, but the performance is too slow. The problem is click events of components (i.e..button, collapsible header, list items and other) responding too slow. (or not working sometimes)

My app size is more than 4MB. Is it the reason for the poor performance? and also in application js total no of lines are crossing over 120000. After some search i follow the below points, but still the app performance is slow...

What i have done so far is;

  1. Limit the usage of ul, li's
  2. Script and style sheets are refered in index page only...

So, here my questions are;

  1. What are factors are affecting the jquery mobile application performance?
  2. Can i splitting the single js into multiple js?
  3. How can i improve the application performance?
  4. Using 'on' instead of 'live' for click event are not working..So, still i am using 'live'
  5. How many html pages should be used? Is there any limitation?
  6. What will be the application folder size? Is there any limitation?
  7. Is there any procedure to follow while developing the jquery mobile application?

Please anyone suggest regarding this?

Thanks in advance...

Was it helpful?

Solution

What are factors are affecting the jquery mobile application performance?

1) the version --- improvements are made with each version including speed. JQM 1.4.2 i believe is the latest.

2) do your js files have the .min (minified version) you may gain a few milliseconds if u minify your js files.

3) if you run your APP on an iphone, does it have a better feel than on Android phone. Test your APP on multiple devices to see the performance.

4) Network bandwidth. -- are you running your APP on local server or a remote one. Check your network traffic, don't download torrent files while you are testing your app.

and a lot more

Can i splitting the single js into multiple js?

Doesn't matter, it will still the take the same time load and initialize. were you position you js files on your pages is quite important.

How can i improve the application performance?

Get the fastest Android Smartphone out there, faster the phone is more fluid the APP will be

Upgrade the JQM version, may gain some performance

See if you can trim your code down a little bit and make it smarter. 120000 lines of code sounds like you have a serious APP

Using 'on' instead of 'live' for click event are not working..So, still i am using 'live'

it's ok i believe for JQM 1.2,3 and JS version 1.7. It has depreciatet on later versions so use the ON method if you use later versions.

How many html pages should be used? Is there any limitation?

if its a multy page (page) template with one thousands pages and images then it depends, need to check DOM performance on high load on pages. the browser will probably crash.

What will be the application folder size? Is there any limitation?

Not sure, i don't thing there is a limit if you run your app on a local server, but then again i never heard of a JQM APP worth of pages at 1gig in size. Pictures take most of the Space, Videos, and music. If the App is on a remote server then your contract will specify how much size you are allowed unless you are hosting your own server. If the whole of JQM APP will get Installed on smartphones and Tablets you will need to check the specs for the individual device. Their storage varies.

Is there any procedure to follow while developing the jquery mobile application?

Yes the JQM web site, everything you need to know its there and well documented.

you can ask your questions here on Stack overflow as you go along in building your APP

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top