Poor phone performance issues

I created an Android application using the PhoneGap shell and JqueryMobile containing several html and js pages.

the first load time is very long (after 5-10 seconds against your own applications), and page navigation is too slow.

Navigating from one screen to another takes a lot of time.

Are there any tips / howtos / tricks to increase speed? This is really unsuitable for a frequently used application.

Another problem is using the application memory too much (about 50 MB for a simple application)

All tricks and hints are welcome.

+4
source share
2 answers

Some optimization tips that I found useful for slow devices:

  • Try changing the default transition to the page. Many Android devices do not support the hardware accelerated phone features in the browser, which means that the CSS3 transitions that JQueryMobile tries to use by default are very slow. You can use:

    $.mobile.defaultPageTransition = 'none'; 

    to disable all transitions by default.

  • As for the script loading time, you can do a lot, except perhaps studying individual loading times for your dependencies and finding out alternatives - but you can make sure that your application does not look inspiring, it loads. Here is a quick hack that I use:

     <style type="text/css"> .doc {display: none;} /* don't show body by default */ </style> <body id="main_body" class="doc"> 

    As soon as everything loads, I call

     $("#main_body").removeClass("doc"); 

    to show the application. I use the Javascript Preloader (LABjs) to ensure that all of my dependencies are loaded.

+7
source

First of all, instead of using a heavy structure like jQuery, give xuijs a try!

+2
source

All Articles