简体   繁体   中英

worklight poor performance on android

I'm currently testing worklight and I noticed a huge loss of performance on android devices compared to iOs ones. (tested on asus nexus 7 vs iphone 4)

The first point was: A simple html page jerks during a simple jquery mobile page transition. No server calls.

I removed the jQuery mobile transition as it uses a lot of javascript instead of css3 transitions capabilities, but it still continue to tilt from a page to another. I mean there's a 1/10 second 'blank screen' between 2 pages and the rendering of the next page lags.

To analyze that issue, I removed the worklight layer and hosted my simple html/jquery mobile page on an apache web server and called it from my device's chrome browser. It worked perfectly fluid even with transitions.

After, I analyzed the worklight generated code in the mobile browser simulator and it appears that there's a lot of wlclient javascript files in the , which is not a good way of implementing a web page from my point of view, and what's more a mobile one.

Is there a way to compile all those files in one to avoid multiple http requests to the server ?

Is there a way to avoid to load all the client api if we just need a small part? I mean, if I don't need encryptedcache, why load the related js?

Is there a way to force the browser engine to use inside the app (chrome, opera, android native...) in order to test the perf of each one?

Worklight 5.0.5.20121217-0622 Android 21.0.0.v201210310015-519525 Win 7 64bit Eclipse 3.7.2

Thanks a lot for your help.

removed the jQuery mobile transition as it uses a lot of javascript instead of css3 transitions capabilities, but it still continue to tilt from a page to another.

You can choose not to use jQuery Mobile and implement animations on your own or use another UI framework. You can also try creating custom CSS-based transitions for jQuery Mobile.

I removed the worklight layer and hosted my simple html/jquery mobile page on an apache web server and called it from my device's chrome browser

Worklight's file are not hosted on any server, they are part of the .apk you install on your device. The performance in the Web View is different than the performance in other browsers such as Google Chrome. You can try to improve it by looking at what other people are doing .

Is there a way to compile all those files in one to avoid multiple http requests to the server ?

There's no way to do it as part of the 'Build all and deploy' step. You can edit the contents of the native folder generated for each environment and manually put the contents into a single file. However, I would not recommend that approach since those changes will get overwritten when you 'Build All and Deploy'. Read this if you want to minify your resources using Ant, however I doubt it will notably improve performance.

Is there a way to avoid to load all the client api if we just need a small part? I mean, if I don't need encryptedcache, why load the related js?

No, you can do it manually if you read my reply to the question above.

Is there a way to force the browser engine to use inside the app (chrome, opera, android native...) in order to test the perf of each one?

No, you Worklight uses Apache Cordova and that uses the Web View provided by the Android API.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM