环境:Android 2.3.3 , xutils-3.3.36 ,fastjson-1.2.7.jar
下载xutils-3.3.36.jar 包放在app 下的libs目录下,然后右键jar包 选择 add as library ;好像也可以直接在build.gradle里添加依赖;
新建application 初始化xutil
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
//全局初始化
x.Ext.init(this);
}
}
注意点:
问题1:java.net.connetException:fail to connect to localhost:8080 after 15000ms :is connected failed:ECONNREFUSED(conection refused)
或 java.net.socketTimeOutException:filed to connect to /10.0.2.2 (port:8080) after 15000ms
参考:java.net.SocketTimeoutException: failed to connect to /10.0..2.2 (port 8080) afte