mobile和Phonegap最佳技术

mobile和Phonegap最佳技术

本文介绍了Jquery-mobile和Phonegap最佳技术的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jqmobile和phonegap。虽然开发移动Web应用程序通常建议使用multipage技术,即将不同的页面放在同一个.html文件中,以便转换更快。然而,只要我使用phonegap(所以每个html文件都包含在每个手机的apk LOCAL),是否也建议使用多页技术?使用jqmobile和phonegap将多个文件放在同一个.html中会更快吗?



注意,

解决方案

在我的老实说,jQuery Mobile不是最好的工具,用于基于PhoneGap的应用程序。 jQM依赖于jQuery,它包含了很多代码,当你正在构建一个移动应用程序并不是真正需要的。有代码在那里支持IE和Firefox,但由于大三手机操作系统(iOS,Android,BB)都是基于WebKit的,它只是过度杀。





此外,如果你是在Android上,你可能想禁用一些CSS让事情更流畅。




I am working with jqmobile and phonegap. While developing mobile web applications is normally recommended to use the multipage technique, that is, put different pages inside the same .html file so that the transitions go faster. However, as long as I´m using phonegap (so every html file is contained in the apk LOCALLY in each mobile phone), is it also recommended to use multipage technique? Is it faster to put more than one file inside the same .html using jqmobile with phonegap?

Regards,

解决方案

In my honest opinion, jQuery Mobile is not the best tool to use in PhoneGap based apps. jQM is dependent on jQuery which contains a lot of code that is not really required when you are building a mobile app. There is code in there that supports IE and Firefox but since the big three mobile phone OS'es (iOS, Android, BB) are all WebKit based it is just over kill.

However, if I was going to use jQM in my PG app I would use a single page approach if at all possible. This will prevent a couple of common issues that people see when using jQM/PG. For instance when you navigate to a second page the transitions are not always great on the mobile device, they are particularly bad on Android. As well when you app moves to page two it has to reload jQuery, jQuery Mobile and PhoneGap and this takes time. So if you can fit everything into one page by doing show/hide div's it would be better performance wise. If you need to go to a second page look at loading it via AJAX into the current pages DOM.

Also if you are on Android you may want to disable some CSS to get things to run smoother.

http://stackoverflow.com/a/8212384/41679

这篇关于Jquery-mobile和Phonegap最佳技术的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 16:26