https://github.com/itgoyo/android-lib
开发中常用的lib
https://github.com/itgoyo/android-lib
Last synced: 4 months ago
JSON representation
开发中常用的lib
- Host: GitHub
- URL: https://github.com/itgoyo/android-lib
- Owner: itgoyo
- Created: 2017-11-29T06:09:07.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-29T06:54:15.000Z (over 7 years ago)
- Last Synced: 2025-01-08T08:41:55.090Z (5 months ago)
- Size: 247 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
}```