An open API service indexing awesome lists of open source software.

https://github.com/itgoyo/android-lib

开发中常用的lib
https://github.com/itgoyo/android-lib

Last synced: 4 months ago
JSON representation

开发中常用的lib

Awesome Lists containing this project

README

        

# Android-Lib
开发中常用的lib

### xUtils(网络请求框架)

接口请求数据格式

```
http://111.222.111.56:8080/serviceProxy/edu_plat/servlet/?json={"SERVICE_CODE":"xxx.edu.xxx.service.UserLogin","CONSUMER_ID":"itgoyo","input":"[email protected]","password":"abc123456"}
```

```
//JsonObject 是com.google.gson的包

HttpUtils httpUtils = new HttpUtils();
RequestParams requestParams = new RequestParams();
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("SERVICE_CODE","xxx.UploadCrashLog");
jsonObject.addProperty("CONSUMER_ID",app.getToken());
jsonObject.addProperty("log_url",logurl);
jsonObject.addProperty("os_type","1");

requestParams.addBodyParameter("json",jsonObject.toString());
httpUtils.send(HttpRequest.HttpMethod.POST, BASE_URL, requestParams, new RequestCallBack() {
@Override
public void onSuccess(ResponseInfo responseInfo) {

logFile.delete();

}

@Override
public void onFailure(HttpException e, String s) {
//失败重新上传
// upLoadLog();
}
});
```

### ButterKnife(依赖注入)

配合AS插件Android Butterknife Zelezny来使用

```
compile'com.jakewharton:butterknife:8.2.1'
compile'com.jakewharton:butterknife-compiler:8.2.1'
```

### Debug模式下也签名

这样子即便是开发环境下运行也会是正式包,遇到需要签名测试才能测试的时候,比如微信支付,分享。

```

signingConfigs {
apptag {
keyAlias 'itgoyotalk'
keyPassword 'xxxx'
storeFile file('C:\\Users\\admin\\Desktop\\android.keystore')
storePassword 'xxxx'
}
}

debug {
// jniDebuggable true
signingConfig signingConfigs.talk915
}

```