怎么让员工提高积极性:jquery mobile - Android 问题&解答 - eoe·Android开发...
来源:百度文库 编辑:中财网 时间:2024/05/10 09:09:00
将js的api文档集成到android项目中,简单而且实用。这个时候,你就可以不再用原生态的UI了。通过HTML + JS +css 你可以做出各种各样的UI
需要注意到是,用这种方式开发程序,软件的运行效率会比原生态UI慢,但是UI界面更加美观和灵活变动。
第一步: 到http://jquerymobile.com/ 下载最新的 JQuery 的API 包
第二步: 将下载好的文件解压,放到android项目的assets文件夹中。
第三步: 在assets文件夹下新建一个sample文件夹。并在sample文件夹中新建一个index.html文件
index.html文件的内容如下:
view plaincopy to clipboardprint?
1.
2.
3.
4.;Page Title
5. rel="stylesheet"
href="../jquery/jquery.mobile-1.0a1.min.css"
mce_href="jquery/jquery.mobile-1.0a1.min.css"
/>
6.src="../jquery/jquery-1.4.3.min.js"
mce_src="jquery/jquery-1.4.3.min.js">
7.src="../jquery/jquery.mobile-1.0a1.min.js"
mce_src="jquery/jquery.mobile-1.0a1.min.js">
8.
9.
10.
21.
22.
第四步:编辑main。xml的内容如下
view plaincopy to clipboardprint?
1. version="1.0"
encoding="utf-8"?>
2.xmlns:android="http://schemas.android.com/apk/res/android"
3. android:orientation="vertical"
android:layout_width="fill_parent"
4. android:layout_height="fill_parent">
5.android:id="@+id/webView01"
android:layout_width="fill_parent"
6. android:layout_height="wrap_content"
/>
7.
第五步,编辑myActivity.java的内容如下:
view plaincopy to clipboardprint?
1. package com.geolo.android;
2. import android.app.Activity;
3. import android.os.Bundle;
4. import android.webkit.WebChromeClient;
5. import android.webkit.WebView;
6. public
class MainActivity extends Activity {
7. /** Called when the activity is first created. */
8. @Override
9. public
void onCreate(Bundle savedInstanceState) {
10. super.onCreate(savedInstanceState);
11. setContentView(R.layout.main);
12. WebView mWebView = (WebView)findViewById(R.id.webView01);
13. mWebView.getSettings().setJavaScriptEnabled(true);
14. mWebView.setWebChromeClient(new WebChromeClient());
15. mWebView.loadUrl("file:///android_asset/sample/index.html");
16. }
17. }
需要注意到是,用这种方式开发程序,软件的运行效率会比原生态UI慢,但是UI界面更加美观和灵活变动。
第一步: 到http://jquerymobile.com/ 下载最新的 JQuery 的API 包
第二步: 将下载好的文件解压,放到android项目的assets文件夹中。
第三步: 在assets文件夹下新建一个sample文件夹。并在sample文件夹中新建一个index.html文件
index.html文件的内容如下:
view plaincopy to clipboardprint?
1.
2.
3.
4.
5. rel="stylesheet"
href="../jquery/jquery.mobile-1.0a1.min.css"
mce_href="jquery/jquery.mobile-1.0a1.min.css"
/>
6.
mce_src="jquery/jquery-1.4.3.min.js">
7.
mce_src="jquery/jquery.mobile-1.0a1.min.js">
8.
9.
10.
data-role="page">
11.
14.
17.
20.
11.
data-role="header">
12.
13.
12.
;Page Title
13.
14.
data-role="content">
15.
16.
15.
;Page content goes here.
16.
17.
data-role="footer">
18.
19.
18.
;Page Footer
19.
20.
21.
22.
第四步:编辑main。xml的内容如下
view plaincopy to clipboardprint?
1. version="1.0"
encoding="utf-8"?>
2.
3. android:orientation="vertical"
android:layout_width="fill_parent"
4. android:layout_height="fill_parent">
5.
android:layout_width="fill_parent"
6. android:layout_height="wrap_content"
/>
7.
第五步,编辑myActivity.java的内容如下:
view plaincopy to clipboardprint?
1. package com.geolo.android;
2. import android.app.Activity;
3. import android.os.Bundle;
4. import android.webkit.WebChromeClient;
5. import android.webkit.WebView;
6. public
class MainActivity extends Activity {
7. /** Called when the activity is first created. */
8. @Override
9. public
void onCreate(Bundle savedInstanceState) {
10. super.onCreate(savedInstanceState);
11. setContentView(R.layout.main);
12. WebView mWebView = (WebView)findViewById(R.id.webView01);
13. mWebView.getSettings().setJavaScriptEnabled(true);
14. mWebView.setWebChromeClient(new WebChromeClient());
15. mWebView.loadUrl("file:///android_asset/sample/index.html");
16. }
17. }
mobile doctor
mobile PhoneTools
disney mobile 在那里有售?
XHTML Mobile Profile文件
Flashing Mobile Phone Stickers
关于WINDOWS MOBILE 5.0
AMD Mobile Sempron 3300+
mobile phoneTools是什么?
什么是MSN?什么是MOBILE?
AMD Mobile Sempron 3000+
mobile PhoneTools连接问题!
Mobile shelters and facilities
mobile是什么操作系统呀
Mobile UMS的驱动
mobile sempron 功耗
HUAWEI Mobile Connect收费
ak mobile ak810
waiting to connect mobile
Windows Mobile Developer Samples
Make a mobile
SAMSUNG Mobile USB Modme
Mobile Ringtone Converter注册码
Mobile Media API
Avril 的mobile