使用jQuery Mobile的使用的PhoneGap [英] Using jQuery Mobile with phonegap

查看:165
本文介绍了使用jQuery Mobile的使用的PhoneGap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发使用的PhoneGap为Android的Andr​​oid应用程序。在jQuery移动为我们提供了丰富的UI组件。所以我选择使用jQuery Mobile的。

现在的问题是,当我使用jQuery移动它deceasing应用程序的性能。
意味着加载时间增加了。所以,我只是想知道如何使用它们正确地使应用程序的性能不会得到受影响。

presently我插入这样的。

 < META NAME =视口CONTENT =WIDTH =设备宽度,初始规模= 1><链接rel =stylesheet属性
    HREF =HTTP://$c$c.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css/>
&所述; SCRIPT SRC =HTTP://$c$c.jquery.com/jquery-1.8.2.min.js>&下; /脚本>
<脚本
    SRC =HTTP://$c$c.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js>&下; /脚本>
<脚本>


解决方案

我建议你打包的jQuery您的资产/ WWW里面就像杰森说。
然后加入:的android:hardwareAccelerated =真正的里面在AndroidManifest.xml这样的标记:

 <应用
        机器人:allowBackup =真
        机器人:图标=@绘制/ ic_launcher
        机器人:标签=@字符串/ APP_NAME
        机器人:hardwareAccelerated =真
        机器人:主题=@风格/ AppTheme>
        <活动

这将使用GPU渲染的WebView。

不要忘了最新的目标或至少ICS版本编译。它可在首创您的应用程序来完成或编辑您的Andr​​oidManifest.xml:

 <采用-SDK
        安卓的minSdkVersion =9
        机器人:targetSdkVersion =16/>

此方法校对与我的应用程序的工作。 :D

I am developing an android application using phonegap for android. As jQuery mobile provide us rich ui components. So I have choose to use jQuery mobile.

Now the problem is that when I am using jQuery mobile it is deceasing application performance. Means the loading time has been increased. So I just want to know how to use them properly so the application performance will not get affected.

Presently I am inserting like this.

<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet"
    href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script
    src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<script>

解决方案

I suggest you to package jquery inside your asset/www just like Jason said. Then add : android:hardwareAccelerated="true" Inside tag in androidmanifest.xml like this :

<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:hardwareAccelerated="true"
        android:theme="@style/AppTheme" >
        <activity

This will render your webview using GPU.

Dont forget to target latest or atleast ICS version for compiling. It can be done in first creation of your apps or edit your androidmanifest.xml :

 <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="16" />

This method proofed worked with my apps. :D

这篇关于使用jQuery Mobile的使用的PhoneGap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆