huangbo 9 anni fa
parent
commit
317efee125

+ 69 - 2
multiple-client/AndroidManifest.xml

@ -36,7 +36,9 @@
36 36
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
37 37
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
38 38
    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
39
    <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
39
    <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
40
    <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
41
    <uses-permission android:name="android.permission.WAKE_LOCK" />
40 42

41 43
    <application
42 44
        android:allowBackup="true"
@ -56,7 +58,72 @@
56 58
                <action android:name="android.intent.action.MAIN" />
57 59
                <category android:name="android.intent.category.LAUNCHER" />
58 60
            </intent-filter>
59
        </activity>
61
        </activity>
62
        
63
         <activity
64
            android:name="com.ai.mobile.multiple.SubAppActivity"
65
            android:label="@string/app_name" 
66
            android:configChanges="orientation|keyboardHidden"
67
            android:screenOrientation="portrait"
68
            android:windowSoftInputMode="stateHidden|adjustResize" >
69
        </activity>
70
        
71
         <!-- 对话框 -->
72
        <activity
73
            android:name="com.wade.mobile.ui.activity.CustomDialogActivity"
74
            android:theme="@style/CustomDialogTheme" >
75
        </activity>
76
        <!-- 窗口 -->
77
        <activity
78
            android:name="com.wade.mobile.ui.activity.CustomWindowActivity">
79
        </activity>
80
        <!-- 侧滑菜单 -->
81
        <activity android:name="com.wade.mobile.ui.activity.SlidingMenuActivity"
82
            android:theme="@style/SlidingMenuTheme" >
83
        </activity>
84
        <!-- 蓝牙分享 -->
85
        <activity
86
            android:name="com.wade.mobile.common.bluetooth.activity.ShareByBluetoothActivity"
87
            android:theme="@style/ShareApkDialogTheme" >
88
        </activity>
89
        <!-- 二维码扫描 -->
90
        <activity
91
            android:name="com.wade.mobile.common.scan.activity.CaptureActivity"
92
            android:configChanges="orientation|keyboardHidden"   
93
            android:screenOrientation="portrait" >
94
        </activity>
95
        <!-- 音乐播放服务 -->
96
        <service android:name="com.wade.mobile.common.audio.play.AudioPlayerService" />
97
        <!-- 录制声音
98
        <activity
99
            android:name="com.wade.mobile.common.audio.activity.AudioRecorderActivity"
100
            android:theme="@style/AudioDialogTheme" >
101
        </activity> -->
102
         <activity
103
            android:name="com.wade.mobile.common.simplemedia.activity.SARecorder"
104
            android:theme="@style/AudioDialogTheme" >
105
        </activity>
106
		<!-- 播放音乐 -->
107
        <activity
108
            android:name="com.wade.mobile.common.audio.activity.AudioPlayerActivity"
109
            android:theme="@style/AudioDialogTheme" >
110
        </activity>
111
        <activity
112
            android:name="com.wade.mobile.common.simplemedia.activity.SARecorder"
113
            android:theme="@style/AudioDialogTheme" >
114
        </activity>
115
        <!-- 标记地图 -->
116
        <activity android:name="com.wade.mobile.common.map.activity.MarkMapActivity">
117
        </activity>
118
        <!-- 通讯录UI -->
119
        <activity android:name="com.wade.mobile.common.contacts.activity.ContactsActivity">
120
        </activity>
121
        <!-- 设定位置 -->
122
        <activity
123
            android:name="com.wade.mobile.common.map.activity.SelectLocationActivity"
124
            android:screenOrientation="portrait" >
125
        </activity>
126
        
60 127
    </application>
61 128

62 129
</manifest>

+ 2 - 1
multiple-client/assets/mobile-action.xml

@ -1,5 +1,7 @@
1 1
<?xml version="1.0" encoding="UTF-8"?>
2 2
<actions>
3
    <action name="openIpuApp" class="com.ai.mobile.multiple.func.AppManagePlugin" method="openIpuApp"/>
4
    
3 5
    <!-- MobileBasic -->
4 6
	<action name="call" class="com.wade.mobile.func.MobileBasic" method="call"/>
5 7
	<action name="beep" class="com.wade.mobile.func.MobileBasic" method="beep"/>
@ -7,7 +9,6 @@
7 9
	<action name="shock" class="com.wade.mobile.func.MobileBasic" method="shock"/>
8 10
	<!-- MobileApp -->
9 11
	<action name="close" class="com.wade.mobile.func.MobileApp" method="close"/>
10
	<action name="openIpuApp" class="com.wade.mobile.func.MobileApp" method="openIpuApp"/>
11 12
	<!-- MobileNetWork -->
12 13
	<action name="httpGet" class="com.wade.mobile.func.MobileNetWork" method="httpGet"></action>
13 14
	<action name="dataRequest" class="com.wade.mobile.func.MobileNetWork" method="dataRequest"/>

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

@ -9,7 +9,7 @@
9 9
	<!-- 必须。数据接口的servlet路径 -->
10 10
	<config name="request_servlet" value="/mobiledata"/>
11 11
	<!-- 非必须,默认应用名。sd卡上的应用根目录名字,解决应用中文名的问题 -->
12
	<config name="app_path" value="display-client"/>
12
	<config name="app_path" value="multiple-client"/>
13 13
	<!-- 非必须,默认UTF-8。 应用需要用到的编码 -->
14 14
	<config name="encode" value="UTF-8"/>
15 15
	<!-- 非必须, 默认false。是否开启多WebView模式 -->

+ 16 - 15
multiple-client/project.properties

@ -1,15 +1,16 @@
1
# This file is automatically generated by Android Tools.
2
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3
#
4
# This file must be checked in Version Control Systems.
5
#
6
# To customize properties used by the Ant build system edit
7
# "ant.properties", and override values to adapt the script to your
8
# project structure.
9
#
10
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12

13
# Project target.
14
target=android-15
15
android.library.reference.1=..\\wade-mobile-lib
1
# This file is automatically generated by Android Tools.
2
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3
#
4
# This file must be checked in Version Control Systems.
5
#
6
# To customize properties used by the Ant build system edit
7
# "ant.properties", and override values to adapt the script to your
8
# project structure.
9
#
10
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12
13
# Project target.
14
target=android-15
15
android.library.reference.1=..\\wade-mobile-lib
16
android.library.reference.2=../../android/wade-mobile-com

+ 0 - 14
multiple-client/src/com/ai/mobile/multiple/MainActivity.java

@ -49,19 +49,5 @@ public class MainActivity extends TemplateMainActivity {
49 49
		}
50 50
		getWadeMobileClient().shutdownByConfirm(Messages.CONFIRM_CLOSE);
51 51
	}
52

53
	// 重写 setWelcomePage 方法 解决2.3版本中 welcome界面右边空白
54
	protected boolean setLoadingPage() {
55
		String welcome = MobileConfig.getInstance().getLoadingPage();
56
		if (welcome != null) {
57
			TemplateWebView templateWebView = new TemplateWebView(this);
58
			templateWebView.loadUrl(welcome);
59
			templateWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
60
			setContentView(templateWebView);
61
			return true;
62
		} else {
63
			return false;
64
		}
65
	}
66 52
}
67 53


+ 26 - 34
multiple-client/src/com/ai/mobile/multiple/func/AppManagePlugin.java

@ -1,20 +1,19 @@
1 1
package com.ai.mobile.multiple.func;
2 2

3
import java.util.HashMap;
4
import java.util.Map;
5

6 3
import org.json.JSONArray;
7 4

8 5
import android.content.ComponentName;
9 6
import android.content.Intent;
10 7

8
import com.ai.mobile.multiple.SubAppActivity;
9
import com.wade.mobile.common.MobileCache;
11 10
import com.wade.mobile.frame.IWadeMobile;
12 11
import com.wade.mobile.frame.multiple.MultipleAppConfig;
12
import com.wade.mobile.frame.multiple.MultipleManager;
13 13
import com.wade.mobile.frame.plugin.Plugin;
14
import com.wade.mobile.frame.template.TemplateManager;
15
import com.wade.mobile.func.MobileUI;
16 14

17 15
public class AppManagePlugin extends Plugin{
16
	private int OPEN_IPU_APP = 1;
18 17

19 18
	public AppManagePlugin(IWadeMobile wademobile) {
20 19
		super(wademobile);
@ -38,36 +37,29 @@ public class AppManagePlugin extends Plugin{
38 37
			/*如果应用不存在则需要下载,配置需要提供下载的url*/
39 38
		}
40 39
	}
41
	
42
	public void openIpuApp(JSONArray param) throws Exception{
43
		Map<String,Map> multipleAppConfigs = new HashMap<String,Map>();
44
		Map multipleAppConfig = new HashMap();
45
		multipleAppConfig.put("requestHost", "10.0.2.2");
46
		multipleAppConfig.put("requestPath", "display");
47
		multipleAppConfig.put("requestServlet", "mobiledata");
48
		multipleAppConfig.put("appPath", "display-client");
49
		multipleAppConfigs.put("display", multipleAppConfig);
50
		
51
		multipleAppConfig = new HashMap();
52
		multipleAppConfig.put("requestHost", "10.0.2.2");
53
		multipleAppConfig.put("requestPath", "ioo");
54
		multipleAppConfig.put("requestServlet", "mobiledata");
55
		multipleAppConfig.put("appPath", "ioo-client");
56
		multipleAppConfigs.put("ioo", multipleAppConfig);
40
	/**初始化*/
41
	static {
42
		MultipleAppConfig multipleAppConfig = new MultipleAppConfig("http://114.215.100.48:8080",
43
				"/display", "/mobiledata", "display-client");
44
		MultipleManager.putAppConfig("display", multipleAppConfig);
45
		multipleAppConfig = new MultipleAppConfig("http://10.0.2.2:8080",
46
				"/mult", "/mobiledata", "mult-client");
47
		MultipleManager.putAppConfig("ioo", multipleAppConfig);
57 48
		
49
	}
50
	public void openIpuApp(JSONArray param) throws Exception{
58 51
		String appName = param.getString(0);
59
		String requestHost = multipleAppConfigs.get(appName).get("requestHost").toString();
60
		String requestPath = multipleAppConfigs.get(appName).get("requestPath").toString();
61
		String requestServlet = multipleAppConfigs.get(appName).get("requestServlet").toString();
62
		String appPath = multipleAppConfigs.get(appName).get("appPath").toString();
63
		
64
		MultipleAppConfig.setRequestHost(requestHost);
65
		MultipleAppConfig.setRequestPath(requestPath);
66
		MultipleAppConfig.setRequestServlet(requestServlet);
67
		MultipleAppConfig.setAppPath(appPath);
68
		
69
		TemplateManager.downloadResource();
70
		
71
		wademobile.getPluginManager().getPlugin(MobileUI.class).openPage("", null);
52
		MultipleManager.setCurrAppName(appName);
53
		MultipleManager.setMultiple(true);
54
		Intent intent = new Intent(wademobile.getActivity(), SubAppActivity.class);
55
		startActivityForResult(intent, OPEN_IPU_APP);
56
	}
57
	
58
	@Override
59
	public void onActivityResult(int requestCode, int resultCode, Intent intent) {
60
		// TODO Auto-generated method stub
61
		if(requestCode==OPEN_IPU_APP){
62
			MultipleManager.setMultiple(false);
63
		}
72 64
	}
73 65
}