Quellcode durchsuchen

修改依赖包后代码及依赖的修改

leijie vor 9 Jahren
Ursprung
Commit
3350264405

+ 6 - 3
display-client/AndroidManifest.xml

@ -48,8 +48,11 @@
48 48
    
49 49
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
50 50

51

52
    <!-- 
53
        android:name="com.wade.mobile.frame.IpuBasicApplication"
54
     -->
51 55
    <application
52
        android:name="com.wade.mobile.frame.MobileApplication"
53 56
        android:allowBackup="false"
54 57
        android:icon="@drawable/ic_launcher"
55 58
        android:label="@string/app_name"
@ -126,13 +129,13 @@
126 129
        -->
127 130
        <!-- 单个扫码 -->
128 131
        <activity
129
            android:name="com.ipu.scan.activity.CaptureSingleActivity"
132
            android:name="com.ai.ipu.scan.activity.CaptureSingleActivity"
130 133
            android:configChanges="orientation|keyboardHidden"   
131 134
            android:screenOrientation="portrait" >
132 135
        </activity>
133 136
        <!-- 多个扫码 -->
134 137
        <activity
135
            android:name="com.ipu.scan.activity.CaptureMultipleActivity"
138
            android:name="com.ai.ipu.scan.activity.CaptureMultipleActivity"
136 139
            android:configChanges="orientation|keyboardHidden"   
137 140
            android:screenOrientation="portrait" >
138 141
        </activity>

+ 4 - 4
display-client/assets/mobile-action.xml

@ -134,10 +134,10 @@
134 134
	<action name="openNative" class="com.ai.ipu.func.MobileOpenApp" method="openNative"></action>
135 135
	
136 136
	<!--ScanQR -->
137
	<action name="scanQrCode" class="com.ipu.scan.func.IpuScan" method="scanSingle"></action>
138
	<action name="scanSingle" class="com.ipu.scan.func.IpuScan" method="scanSingle"></action>
139
	<action name="scanMultiple" class="com.ipu.scan.func.IpuScan" method="scanMultiple"></action>
140
	<action name="createQrCode" class="com.ipu.scan.func.IpuScan" method="createQrCode"></action>
137
	<action name="scanQrCode" class="com.ai.ipu.scan.func.IpuScan" method="scanSingle"></action>
138
	<action name="scanSingle" class="com.ai.ipu.scan.func.IpuScan" method="scanSingle"></action>
139
	<action name="scanMultiple" class="com.ai.ipu.scan.func.IpuScan" method="scanMultiple"></action>
140
	<action name="createQrCode" class="com.ai.ipu.scan.func.IpuScan" method="createQrCode"></action>
141 141
	
142 142
	<!-- Voice -->
143 143
	<action name="startListen" class="com.ai.ipu.voice.IpuVoicePlugin" method="startListen"></action>

+ 1 - 1
display-client/src/com/ai/ipu/display/MainActivity.java

@ -21,7 +21,7 @@ public class MainActivity extends TemplateMainActivity {
21 21
			setTheme(android.R.style.Theme_Light);
22 22
		}
23 23
24
		if (AppRecord.isFirst(this) && !MobileCheck.checkWifiActive()) {
24
		if (AppRecord.isFirst() && !MobileCheck.checkWifiActive()) {
25 25
			ConfirmBlockDialog dialog = new ConfirmBlockDialog(this, "下载提醒",
26 26
					"即将下载应用资源,连接wifi将为您节省流量,是否继续下载");
27 27
			dialog.show();

+ 2 - 2
display-client/src/com/ai/ipu/func/MobileOpenApp.java

@ -7,13 +7,13 @@ import android.content.Intent;
7 7
8 8
import com.ai.ipu.mobile.app.MobileCheck;
9 9
import com.ai.ipu.mobile.app.SimpleUpdate;
10
import com.ai.ipu.mobile.ui.HintUtil;
10 11
import com.ailk.common.data.IData;
11 12
import com.ailk.common.data.impl.DataMap;
12 13
import com.umeng.analytics.MobclickAgent;
13 14
import com.umeng.analytics.MobclickAgent.EScenarioType;
14 15
import com.wade.mobile.frame.IWadeMobile;
15 16
import com.wade.mobile.frame.plugin.Plugin;
16
import com.wade.mobile.ui.helper.HintHelper;
17 17
18 18
public class MobileOpenApp extends Plugin {
19 19
@ -37,7 +37,7 @@ public class MobileOpenApp extends Plugin {
37 37
			intent.setComponent(cn);
38 38
			startActivityForResult(intent, 0);
39 39
		} else {
40
			HintHelper.tip(context, "正在下载,请稍后...", 1);
40
			HintUtil.tip(context, "正在下载,请稍后...", 1);
41 41
42 42
			/* 如果应用不存在则需要下载,配置需要下载应用 */
43 43
			SimpleUpdate simpleUpdate = new SimpleUpdate(context, downloadUrl);

+ 3 - 2
ipu-bluetooth/src/com/ai/ipu/bluetooth/activity/BluetoothPicker.java

@ -1,11 +1,12 @@
1 1
package com.ai.ipu.bluetooth.activity;
2 2

3
import com.ai.ipu.mobile.ui.HintUtil;
4

3 5
import android.app.Activity;
4 6
import android.bluetooth.BluetoothDevice;
5 7
import android.content.Intent;
6 8
import android.os.Bundle;
7 9

8
import com.wade.mobile.ui.helper.HintHelper;
9 10

10 11
/**
11 12
 * @author huangbo
@ -41,7 +42,7 @@ public class BluetoothPicker extends Activity {
41 42
	public void onCreate(Bundle savedInstanceState) {
42 43
		super.onCreate(savedInstanceState);
43 44
		if (device == null) {
44
			HintHelper.alert(this, "Failed to get selected bluetooth device!");
45
			HintUtil.alert(this, "Failed to get selected bluetooth device!");
45 46
			finish();
46 47
			return;
47 48
		}

+ 3 - 3
ipu-bluetooth/src/com/ai/ipu/bluetooth/activity/ShareByBluetoothActivity.java

@ -30,7 +30,7 @@ import com.ai.ipu.bluetooth.util.BluetoothConstant;
30 30
import com.ai.ipu.bluetooth.util.BluetoothTool;
31 31
import com.ai.ipu.mobile.app.ApkUtil;
32 32
import com.ai.ipu.mobile.app.AppInfoUtil;
33
import com.wade.mobile.ui.helper.HintHelper;
33
import com.ai.ipu.mobile.ui.HintUtil;
34 34

35 35

36 36
/**
@ -82,7 +82,7 @@ public class ShareByBluetoothActivity extends Activity {
82 82
								setResult(BluetoothConstant.SUC_REQ_SEND_FILE);
83 83
							} catch (Exception e) {
84 84
								setResult(BluetoothConstant.ERR_REQ_SEND_FILE);
85
								HintHelper.alert(ShareByBluetoothActivity.this, "文件分享异常:"+e.getMessage());
85
								HintUtil.alert(ShareByBluetoothActivity.this, "文件分享异常:"+e.getMessage());
86 86
								e.printStackTrace();
87 87
							}
88 88
						}
@ -170,7 +170,7 @@ public class ShareByBluetoothActivity extends Activity {
170 170
		} catch (Exception e) {
171 171
			closeDialog();
172 172
			setResult(BluetoothConstant.ERR_REQ_SEARCH);
173
			HintHelper.alert(ShareByBluetoothActivity.this, "搜索蓝牙设备异常:"+e.getMessage());
173
			HintUtil.alert(ShareByBluetoothActivity.this, "搜索蓝牙设备异常:"+e.getMessage());
174 174
			e.printStackTrace();
175 175
		}
176 176
	}

+ 19 - 355
ipu-bluetooth/src/com/ai/ipu/bluetooth/func/MobileNetWork.java

@ -1,250 +1,26 @@
1 1
package com.ai.ipu.bluetooth.func;
2 2

3
import java.io.File;
4
import java.io.InputStream;
5
import java.util.HashMap;
6
import java.util.HashSet;
7
import java.util.Map;
8

9 3
import org.json.JSONArray;
10 4

11
import android.bluetooth.BluetoothAdapter;
12
import android.content.Intent;
13
import android.net.Uri;
14
import android.os.AsyncTask;
15
import android.os.Build;
16
import android.widget.Toast;
17

18
import com.ai.ipu.basic.net.http.HttpTool;
19
import com.ai.ipu.basic.string.StringUtil;
20
import com.ai.ipu.basic.thread.IpuThread;
21 5
import com.ai.ipu.bluetooth.activity.ShareByBluetoothActivity;
22 6
import com.ai.ipu.bluetooth.listener.OnOpenBluetoothListener;
23 7
import com.ai.ipu.bluetooth.util.BluetoothTool;
24 8
import com.ai.ipu.mobile.app.ApkUtil;
25 9
import com.ai.ipu.mobile.app.AppInfoUtil;
26
import com.ailk.common.data.IData;
27
import com.ailk.common.data.impl.DataMap;
28
import com.litesuits.http.LiteHttpClient;
29
import com.litesuits.http.request.Request;
30
import com.litesuits.http.response.Response;
31
import com.wade.mobile.common.sms.listener.OnSmsReceiveListener;
32
import com.wade.mobile.common.sms.util.SmsTool;
10
import com.ai.ipu.mobile.ui.HintUtil;
33 11
import com.wade.mobile.frame.IWadeMobile;
34
import com.wade.mobile.frame.config.MobileConfig;
35
import com.wade.mobile.frame.config.ServerDataConfig;
36 12
import com.wade.mobile.frame.plugin.Plugin;
37
import com.wade.mobile.safe.MobileSecurity;
38
import com.wade.mobile.util.BusinessCache;
39
import com.wade.mobile.util.Constant;
40
import com.wade.mobile.util.DirectionUtil;
41
import com.wade.mobile.util.FileUtil;
42
import com.wade.mobile.util.FuncConstant;
43
import com.wade.mobile.util.Messages;
44
import com.wade.mobile.util.Utility;
45
import com.wade.mobile.util.http.UnirestUtil;
13

14
import android.bluetooth.BluetoothAdapter;
15
import android.content.Intent;
16
import android.os.Build;
17
import android.util.Log;
18
import android.widget.Toast;
46 19

47 20
public class MobileNetWork extends Plugin {
48
	private boolean hasSetSmsListener;
49
	private DirectionUtil directionUtil;
50 21

51 22
	public MobileNetWork(IWadeMobile wademobile) {
52 23
		super(wademobile);
53
		directionUtil = DirectionUtil.getInstance(context);
54
	}
55

56
	public void setSmsListener(JSONArray param) throws Exception {
57
		String telString = param.getString(0);
58
		setSmsListener(telString);
59
	}
60

61
	public void setSmsListener(String telString) throws Exception {
62
		HashSet<String> telSet = null;
63
		if(!isNull(telString)){
64
			telSet = new HashSet<String>();
65
			if(StringUtil.isJSONArray(telString)) {
66
				JSONArray teles = new JSONArray(telString);
67
				for(int i=0; i <teles.length() ; i++){
68
					telSet.add(teles.getString(i));
69
				}
70
			} else {
71
				telSet.add(telString);
72
			}
73
		}
74
		
75
		final HashSet<String> _telSet = telSet;
76
		if (!hasSetSmsListener) {
77
			SmsTool.setSmsListener(context, new OnSmsReceiveListener() {
78
				@Override
79
				public boolean onSmsReceive(String content, String sender, long time) {
80
					if (_telSet == null || _telSet.contains(sender)) {// 没有滤号码或者存在过滤号码均处理
81
						IData resultData = new DataMap();
82
						resultData.put(FuncConstant.CONTENT, content);
83
						resultData.put(FuncConstant.SENDER, sender);
84
						resultData.put(FuncConstant.TIME, time);
85
						String result = resultData.toString();
86
						callback(result, true);
87
						hasSetSmsListener = false;
88
						return true;
89
					} else {
90
						return false;
91
					}
92
				}
93
			});
94
			hasSetSmsListener = true;
95
		}
96
	}
97

98
	public void httpRequest(JSONArray param) throws Exception {
99
		String requestUrl = param.getString(0);
100
		String encode = param.getString(1);
101
		if (isNull(encode)) {
102
			encode = MobileConfig.getInstance().getEncode();
103
		}
104
		String result;
105
		try {
106
			result = httpRequest(requestUrl, encode);
107
		} catch (Exception e) {
108
			result = "{\"X_RESULTCODE\":\"-1\",\"X_RESULTINFO\":\"" + e.getMessage() + "\"}";
109
		}
110
		callback(result, true);
111
	}
112

113
	public String httpRequest(String requestUrl, String encode) throws Exception {
114
		// TODO Auto-generated method stub
115
		MobileConfig config = MobileConfig.getInstance();
116
		// 预处理
117
		if (!requestUrl.startsWith(Constant.HTTP)) {
118
			if (!requestUrl.startsWith("/"))
119
				requestUrl = "/" + requestUrl;
120
			requestUrl = config.getRequestHost() + requestUrl;
121
		}
122

123
		requestUrl = HttpTool.urlEncode(requestUrl, encode);
124
		return HttpTool.httpRequest(requestUrl, null, Constant.HTTP_POST, encode);
125
	}
126

127
	public void httpGet(JSONArray param) throws Exception {
128
		String requestUrl = param.getString(0);
129
		String encode = param.getString(1);
130
		if (isNull(encode)) {
131
			encode = MobileConfig.getInstance().getEncode();// UTF-8
132
		}
133
		String result;
134

135
		try {
136
			/* 方式1 */
137
			/*result = httpGet(requestUrl,encode);*/
138
			/* 方式2 */
139
			LiteHttpClient client = LiteHttpClient.getInstance(context);
140
			Response res = client.execute(new Request(requestUrl));
141
			result = res.getString();
142
		} catch (Exception e) {
143
			result = e.getMessage();
144
		}
145
		callback(result, true);
146
	}
147

148
	public String httpGet(String requestUrl, String encode) throws Exception {
149
		MobileConfig config = MobileConfig.getInstance();
150
		/* 预处理 */
151
		if (!requestUrl.startsWith(Constant.HTTP)) {
152
			if (!requestUrl.startsWith("/"))
153
				requestUrl = "/" + requestUrl;
154
			requestUrl = config.getRequestHost() + requestUrl;
155
		}
156

157
		requestUrl = HttpTool.urlEncode(requestUrl, encode);
158
		return HttpTool.httpRequest(requestUrl, null, Constant.HTTP_GET, encode);
159
	}
160

161
	public void dataRequest(JSONArray param) throws Exception {
162
		String dataAction = param.getString(0);
163
		String data = param.getString(1);
164
		String result = dataRequest(dataAction, isNull(data) ? null : new DataMap(data));
165
		callback(result, true);
166
	}
167

168
	/**
169
	 * @param dataAction
170
	 * @param param
171
	 * @param isMustEncrypt
172
	 *            是否一定加密传输
173
	 * @return
174
	 * @throws Exception
175
	 */
176
	public String dataRequest(String dataAction, IData param) throws Exception {
177
		synchronized (dataAction) {
178
			String result = (String) BusinessCache.getInstance().get(dataAction);
179
			if (result != null) {
180
				BusinessCache.getInstance().remove(dataAction);
181
			} else {
182
				result = requestBizData(dataAction, param);
183
			}
184
			return result;
185
		}
186
	}
187

188
	private String requestBizData(String dataAction, IData param) throws Exception {
189
		Map<String,String> postData = transPostData(dataAction, param);
190
		String dataUrl = HttpTool.toQueryStringWithEncode(postData);
191
		String result = HttpTool.httpRequest(MobileConfig.getInstance().getRequestUrl(),
192
				dataUrl, Constant.HTTP_POST);
193
		if (ServerDataConfig.isEncrypt(dataAction)) {
194
			result = MobileSecurity.responseDecrypt(result);
195
		}
196
		return result;
197
	}
198
	
199
	public Map<String, String> transPostData(String dataAction, IData dataParam) throws Exception {
200
		// TODO Auto-generated method stub
201
		Map<String, String> postData = new HashMap<String, String>();
202
		postData.put(Constant.Server.ACTION, dataAction);
203
		if (ServerDataConfig.isEncrypt(dataAction)) {
204
			MobileSecurity.init();
205
			/* 参数加密处理 */
206
			String key = MobileSecurity.getDesKey();
207
			postData.put(Constant.Server.KEY, key);
208
			
209
			if(dataParam!=null){
210
				String encryptData = MobileSecurity.requestEncrypt(dataParam.toString());
211
				postData.put(Constant.Server.DATA, encryptData);
212
			}
213
		} else {
214
			if (dataParam != null) {
215
				postData.put(Constant.Server.DATA, dataParam.toString());
216
			}
217
		}
218
		return postData;
219
	}
220

221
	public void storageDataByThread(JSONArray param) throws Exception {
222
		String dataAction = param.getString(0);
223
		String data = param.getString(1);
224
		boolean isEncrypt = false;
225
		if (param.length() > 2) {
226
			isEncrypt = "true".equals(param.getString(2)) ? true : false;
227
		}
228

229
		int waitoutTime = 5;
230
		if (param.length() > 3) {
231
			waitoutTime = param.getInt(3);
232
		}
233
		storageDataByThread(dataAction, isNull(data) ? null : new DataMap(data), isEncrypt, waitoutTime);
234
	}
235

236
	public void storageDataByThread(final String dataAction, final IData param,
237
			final boolean isEncrypt, long waitoutTime) throws Exception {
238
		waitoutTime = (waitoutTime < 3 || waitoutTime > 10) ? 5 : waitoutTime;// 修正waitoutTime,确保在一定范围
239
		new IpuThread(dataAction, waitoutTime) {
240
			@Override
241
			protected void execute() throws Exception {
242
				String result = requestBizData(dataAction, param);
243
				synchronized (dataAction) {
244
					BusinessCache.getInstance().put(dataAction, result);
245
				}
246
			}
247
		}.start();
248 24
	}
249 25

250 26
	public void shareByBluetooth(JSONArray param) throws Exception {
@ -277,139 +53,27 @@ public class MobileNetWork extends Plugin {
277 53
					public void OnOpened(BluetoothAdapter adapter) {
278 54
						// 开始查找设备。
279 55
						try {
56
							HintUtil.tip(context, "蓝牙已启动...");
280 57
							bluetoothTools.sendFile(ApkUtil.getCurrApk());
281 58
						} catch (Exception e) {
282 59
							e.printStackTrace();
283 60
						}
284 61
					}
285
				});
286
			}
287
		}
288
	}
289
	/**
290
	 * 打开浏览器
291
	 */
292
	public void openBrowser(JSONArray param) throws Exception {
293
		String url = param.getString(0);
294
		openBrowser(url);
295
	}
296
	/**
297
	 * 打开浏览器
298
	 */
299
	public void openBrowser(String url) {
300
		Uri uri = Uri.parse(url);
301
		Intent intent = new Intent(Intent.ACTION_VIEW, uri);
302
		context.startActivity(intent);
303
	}
304
	
305
	public void uploadWithServlet(JSONArray param) throws Exception {
306
		JSONArray filePaths = param.getJSONArray(0);
307
		String dataAction = param.getString(1);
308
		IData dataParam = isNull(param.getString(2))?new DataMap():new DataMap(param.getString(2));
309
		uploadWithServlet(filePaths, dataAction, dataParam);
310
	}
311
	
312
	@SuppressWarnings("unchecked")
313
	public void uploadWithServlet(final JSONArray filePaths, final String dataAction, IData dataParam) throws Exception {
314
		// TODO Auto-generated method stub
315
		Map<String, String> postData = transPostData(dataAction, dataParam);
316
		new AsyncTask<Map<String, String>, Integer, String>() {
317
			@Override
318
			protected String doInBackground(Map<String, String>... args) {
319
				Map<String, String> postData = args[0];
320
				Map<String, Object> fileData = new HashMap<String, Object>();
321
				// TODO Auto-generated method stub
322
				String result = null;
323
				try{
324
					String filePath = null;
325
					File file;
326
					for(int i=0;i<filePaths.length();i++){
327
						filePath = filePaths.getString(i);
328
						file = new File(filePath);
329
						if(!file.exists()){
330
							Utility.error(Messages.FILE_NOT_EXIST+":"+filePath);
331
						}
332
						fileData.put("UPLOAD_FILE"+i, file);//装载文件
62
					@Override
63
					public void OnOpen(BluetoothAdapter adapter) {
64
						HintUtil.tip(context, "蓝牙启动中...");
333 65
					}
334
					fileData.put("UPLOAD_FILE_COUNT", filePaths.length());//装载文件数量
335
					
336
					String encode = MobileConfig.getInstance().getEncode();
337
					String dataUrl = HttpTool.urlEncode(HttpTool.toQueryString(postData), encode);
338
					String url = MobileConfig.getInstance().getRequestUrl() + "?" + dataUrl;
339
					result = UnirestUtil.uploadByPost(HttpTool.urlEscape(url).toString(), fileData);
340
					if (ServerDataConfig.isEncrypt(dataAction)) {
341
						result = MobileSecurity.responseDecrypt(result);
66
					@Override
67
					public void OnClose(BluetoothAdapter adapter) {
68
						HintUtil.tip(context, "蓝牙关闭中...");
342 69
					}
343
				}catch(Exception e){
344
					MobileNetWork.this.error(e.getMessage());// 报错回调
345
					Utility.error(e);
346
				}
347
				return result;
348
			}
349
			
350
			@Override
351
			protected void onPostExecute(String result) {
352
				// TODO Auto-generated method stub
353
				super.onPostExecute(result);
354
				if (result != null) {
355
					MobileNetWork.this.callback(result, true);// 正常回调
356
				}
357
			}
358
		}.execute(postData);
359
	}
360
	
361
	public void downloadWithServlet(JSONArray param) throws Exception {
362
		String savePath = param.getString(0);
363
		String dataAction = param.getString(1);
364
		IData dataParam = param.getString(2) == null ? new DataMap() : new DataMap(param.getString(2));
365
		downloadWithServlet(savePath, dataAction, dataParam);
366
	}
367
	
368
	public void downloadWithServlet(final String _savePath, String dataAction, IData dataParam) throws Exception {
369
		// TODO Auto-generated method stub
370
		Map<String, String> tempPostData = transPostData(dataAction, dataParam);
371
		final Map<String, Object> postData = new HashMap<String, Object>();
372
		postData.putAll(tempPostData);
373
		new AsyncTask<String, Integer, String>() {
374
			@Override
375
			protected String doInBackground(String... arg0) {
376
				// TODO Auto-generated method stub
377
				String savePath = _savePath;
378
				try {
379
					InputStream in = UnirestUtil.downloadByPost(MobileConfig.getInstance().getRequestUrl(), postData);
380
					if (!savePath.startsWith(File.separator)) {
381
						savePath = directionUtil.getDirection(savePath, true);
382
					}
383
					File file = new File(savePath).getParentFile();
384
					if (!file.exists() && !file.mkdirs()) {
385
						Utility.error("创建下载文件夹失败!");
70
					@Override
71
					public void OnClosed(BluetoothAdapter adapter) {
72
						HintUtil.tip(context, "蓝牙已关闭...");
386 73
					}
387

388
					FileUtil.writeFile(in, savePath);
389
				} catch (Exception e) {
390
					MobileNetWork.this.error("[" + savePath + "]异常:" + e.getMessage());// 报错回调
391
				}
392
				return savePath;
393
			}
394
			
395
			@Override
396
			protected void onPostExecute(String savePath) {
397
				// TODO Auto-generated method stub
398
				super.onPostExecute(savePath);
399
				if (savePath != null) {
400
					MobileNetWork.this.callback(savePath, true);// 正常回调
401
				}
74
				});
402 75
			}
403
		}.execute();
404
	}
405

406
	public void uploadFile(JSONArray param) throws Exception {
407
		String path = param.getString(0);
408
		uploadFile(path);
76
		}
409 77
	}
410 78

411
	public void uploadFile(String path) throws Exception {
412
		// TODO Auto-generated method stub
413
		
414
	}
415 79
}

+ 3 - 3
ipu-bluetooth/src/com/ai/ipu/bluetooth/util/BluetoothTool.java

@ -22,7 +22,7 @@ import com.ai.ipu.bluetooth.listener.OnSearchDeviceListener;
22 22
import com.ai.ipu.bluetooth.receiver.BondBluetoothReceiver;
23 23
import com.ai.ipu.bluetooth.receiver.OpenBluetoothReceiver;
24 24
import com.ai.ipu.bluetooth.receiver.ScanBluetoothReceiver;
25
import com.wade.mobile.util.Utility;
25
import com.ai.ipu.mobile.util.IpuMobileUtility;
26 26

27 27
public class BluetoothTool {
28 28
	// 用于保存传入的上下文
@ -307,7 +307,7 @@ public class BluetoothTool {
307 307
					Uri.parse("content://com.android.bluetooth.opp/btopp"),
308 308
					cv);
309 309
		} else {
310
			Utility.error("The file "+file.getName()+" does not exist.");
310
			IpuMobileUtility.error("The file "+file.getName()+" does not exist.");
311 311
		}
312 312
	}
313 313
	
@ -327,7 +327,7 @@ public class BluetoothTool {
327 327
			sharingIntent.putExtra(Intent.EXTRA_STREAM, uri);
328 328
			mActivity.startActivity(sharingIntent);
329 329
		} else {
330
			Utility.error("The file "+file.getName()+" does not exist.");
330
			IpuMobileUtility.error("The file "+file.getName()+" does not exist.");
331 331
		}
332 332
	}
333 333
}

+ 1 - 1
ipu-client/src/com/ipu/client/MainActivity.java

@ -21,7 +21,7 @@ public class MainActivity extends TemplateMainActivity {
21 21
			setTheme(android.R.style.Theme_Light);
22 22
		}
23 23

24
		if (AppRecord.isFirst(this) && !MobileCheck.checkWifiActive()) {
24
		if (AppRecord.isFirst() && !MobileCheck.checkWifiActive()) {
25 25
			ConfirmBlockDialog dialog = new ConfirmBlockDialog(this, "下载提醒", "即将下载应用资源,连接wifi将为您节省流量,是否继续下载");
26 26
			dialog.show();
27 27
			if (dialog.getResult() == ConfirmBlockDialog.Result.OK) {