Browse Source

修改HttpGet请求方法,解决Android Studio编译报错的问题

zhanglong7 4 years ago
parent
commit
ee7b5bab9f

+ 6 - 4
ipu-plugin-basic/build.gradle

@ -1,7 +1,7 @@
1 1
apply plugin: 'java'
2 2
3 3
group = 'com.ai.ipu.mobile'
4
version = '3.0-SNAPSHOT'
4
version = '3.1-SNAPSHOT'
5 5
6 6
tasks.withType(JavaCompile) {
7 7
	options.encoding = 'UTF-8'
@ -13,12 +13,14 @@ repositories {
13 13
14 14
dependencies {
15 15
	compileOnly group: 'junit', name: 'junit', version:'4.12'
16
	compileOnly group: 'android', name: 'android', version:'22'
16
	compileOnly "android:android:22"
17 17
	compileOnly group: 'com.ai.wade', name: 'wade-mobile-data', version:'1.0'
18 18
	compileOnly "android:android-lite-http:1.0"
19 19
	compileOnly "com.ai.ipu:ipu-basic:${IPU_VERSION}"
20 20
	compileOnly "com.ai.ipu.mobile:ipu-mobile-basic:${IPU_VERSION}"
21 21
	compileOnly "com.ai.ipu.mobile:ipu-mobile-framework:${IPU_VERSION}"
22
    compileOnly "com.ai.ipu.mobile:ipu-plugin-extend:${IPU_VERSION}"
23
    compileOnly "com.ai.ipu.mobile:ipu-mobile-ui:${IPU_VERSION}"
22
	compileOnly "com.ai.ipu.mobile:ipu-plugin-extend:${IPU_VERSION}"
23
	compileOnly "com.ai.ipu.mobile:ipu-mobile-ui:${IPU_VERSION}"
24
	compileOnly "com.ai.ipu.mobile:ipu-mobile-rn:3.0-SNAPSHOT"
25
	compileOnly "com.facebook.react:react-native-jar:0.52.2"
24 26
}

+ 1 - 1
ipu-plugin-basic/gradle.properties

@ -14,5 +14,5 @@
14 14
# org.gradle.parallel=true
15 15
#
16 16
android_support_v4=1.0
17
IPU_VERSION=3.0-SNAPSHOT
17
IPU_VERSION=3.1-SNAPSHOT
18 18

+ 3 - 3
ipu-plugin-basic/src/main/java/com/ai/ipu/mobile/commonfunc/MobileNetworkFunc.java

@ -118,11 +118,11 @@ public class MobileNetworkFunc extends ComFunc{
118 118
119 119
		try {
120 120
			/* 方式1 */
121
			/*result = httpGet(requestUrl,encode);*/
121
			result = httpGet1(requestUrl,encode);
122 122
			/* 方式2 */
123
			LiteHttpClient client = LiteHttpClient.getInstance(context);
123
			/*LiteHttpClient client = LiteHttpClient.getInstance(context);
124 124
			Response res = client.execute(new Request(requestUrl));
125
			result = res.getString();
125
			result = res.getString();*/
126 126
		} catch (Exception e) {
127 127
			result = e.getMessage();
128 128
		}

+ 3 - 3
ipu-plugin-basic/src/main/java/com/ai/ipu/mobile/plugin/MobileNetWork.java

@ -138,11 +138,11 @@ public class MobileNetWork extends Plugin {
138 138
139 139
		try {
140 140
			/* 方式1 */
141
			/*result = httpGet(requestUrl,encode);*/
141
			result = httpGet(requestUrl,encode);
142 142
			/* 方式2 */
143
			LiteHttpClient client = LiteHttpClient.getInstance(context);
143
			/*LiteHttpClient client = LiteHttpClient.getInstance(context);
144 144
			Response res = client.execute(new Request(requestUrl));
145
			result = res.getString();
145
			result = res.getString();*/
146 146
		} catch (Exception e) {
147 147
			result = e.getMessage();
148 148
		}