-11 ol-11"> 46
				}) 
47
				/* $.get("data?name=zhangsan001",function(data){
48
					alert(data);
49
				}); */
50
				/* for(var i in XMLHttpRequest){
51
					console.log(i + "---" + XMLHttpRequest[i]);
52
				} */
42
				//创建XMLHttpRequest对象
43
				xhr = new XMLHttpRequest();
44
				//注册回调函数
45
				xhr.onreadystatechange=callback;
46
				//第一个参数设置成post,第二个写url地址,第三个为是否采用异步方式
47
				xhr.open("POST","../data",true);
48
				//post请求需要自己设置请求头
49
				xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
50
				//post请求
51
				xhr.send("name=lisi");
52
			}
53
			function callback(){
54
				//接收响应数据
55
				//判断对象状态是否交互完成,如果为4则交互完成
56
				if(xhr.readyState == 4){
57
					//判断对象状态是否交互成功,如果成功则为200
58
					if(xhr.status == 200){
59
						//接收数据,得到服务器输出的纯属文本数据
60
						var response = xhr.responseText;
61
						alert("返回的数据为:" + response);
62
					}
63
				}
64
			}
65
		</script>
66
		<br /><br />
67
		<button style="width:200px;height:100px;" id="hrefBaidu">跳转到百度(href)</button>
68
		<script type="text/javascript">
69
			var btn = document.getElementById("hrefBaidu");
70
			btn.onclick = function(){
71
				window.location.href="http://3g.baidu.com";
53 72
			}
54 73
		</script>
55 74
	</body>

+ 51 - 0
general-web-server/web/res/java/MainActivity.java.net

@ -0,0 +1,51 @@
1
package com.ai.mobile.display;
2

3
import android.content.pm.ActivityInfo;
4
import android.os.Bundle;
5

6
import com.wade.mobile.app.MobileAppInfo;
7
import com.wade.mobile.app.MobileOperation;
8
import com.wade.mobile.frame.activity.NetMobileActivity;
9
import com.wade.mobile.frame.net.NetWebView;
10
import com.wade.mobile.ui.comp.dialog.ConfirmBlockDialog;
11
import com.wade.mobile.util.Messages;
12

13
public class MainActivity extends NetMobileActivity {
14
	@Override
15
	public void onCreate(Bundle savedInstanceState) {
16
		setTheme(R.style.Theme_Sherlock_Light);
17
		MobileAppInfo appInfo = MobileAppInfo.getInstance(this);
18
		if(appInfo.isTablet()){
19
			setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
20
		}else{
21
			setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
22
		}
23
		super.onCreate(savedInstanceState);
24
	}
25
	
26
	@Override
27
	public void onBackPressed() {
28
		getWadeMobileClient().shutdownByConfirm(Messages.CONFIRM_CLOSE);
29
	}
30
	
31
	@Override
32
	public void loadingError(final NetWebView webView, final int errorCode,
33
			final String description, final String failingUrl) {
34
		MainActivity.this.runOnUiThread(new Runnable() {
35
			@Override
36
			public void run() {
37
				try {
38
					webView.loadAssetHtml("html/welcome.html");
39
				} catch (Exception e) {
40
					e.printStackTrace();
41
				}finally{
42
					ConfirmBlockDialog dialog = new ConfirmBlockDialog(MainActivity.this, "异常", "资源加载异常,请检查网络与防火墙设置。即将退出应用……" , "确定" , null);
43
					dialog.show();
44
					if(dialog.getResult() == ConfirmBlockDialog.Result.OK ){
45
						MobileOperation.exitApp();
46
					}
47
				}
48
			}
49
		});
50
	}
51
}

+ 2 - 0
general-web-server/web/res/js/expand-mobile.js

@ -173,6 +173,8 @@ window.ExpandMobile = (function() {
173 173
				execute("cleanResource",[type],err);
174 174
			},shareByBluetooth:function(err){
175 175
				execute("shareByBluetooth", [],err);
176
			},openBrowser:function(url,err){
177
				execute("openBrowser",[url],err);
176 178
			},setSmsListener:function(callback,telString,isEscape,err){
177 179
				if(isEscape == undefined ){
178 180
					isEscape = true;

+ 16 - 0
wade-mobile-func/src/com/wade/mobile/func/MobileNetWork.java

@ -10,6 +10,7 @@ import org.json.JSONArray;
10 10

11 11
import android.bluetooth.BluetoothAdapter;
12 12
import android.content.Intent;
13
import android.net.Uri;
13 14
import android.os.AsyncTask;
14 15
import android.os.Build;
15 16
import android.widget.Toast;
@ -303,6 +304,21 @@ public class MobileNetWork extends Plugin {
303 304
			}
304 305
		}
305 306
	}
307
	/**
308
	 * 打开浏览器
309
	 */
310
	public void openBrowser(JSONArray param) throws Exception {
311
		String url = param.getString(0);
312
		openBrowser(url);
313
	}
314
	/**
315
	 * 打开浏览器
316
	 */
317
	public void openBrowser(String url) {
318
		Uri uri = Uri.parse(url);
319
		Intent intent = new Intent(Intent.ACTION_VIEW, uri);
320
		context.startActivity(intent);
321
	}
306 322
	
307 323
	public void uploadWithServlet(JSONArray param) throws Exception {
308 324
		JSONArray filePaths = param.getJSONArray(0);

配置文件处理:插件管理 · 7bf291197e - Nuosi Git Service
Browse Source

配置文件处理:插件管理

huangbo 8 years ago
parent
commit
7bf291197e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      display-client/assets/mobile-config.xml

+ 1 - 1
display-client/assets/mobile-config.xml

@ -26,5 +26,5 @@
26 26
	<config name="remote_url" value="http://10.0.2.2:8080/g/html/myindex.html" />
27 27
	
28 28
	<!-- 插件管理平台 -->
29
	<config name="plugin_manager_url" value="http://www.aiipu.com/plugin-manager/wlwdata"/>
29
	<config name="plugin_manager_url" value="http://www.aiipu.com/plugin-manager"/>
30 30
</configs>