{"action":"published","release":{"url":"https://api.github.com/repos/YouAreOnlyOne/AndroidHttp/releases/13265123","assets_url":"https://api.github.com/repos/YouAreOnlyOne/AndroidHttp/releases/13265123/assets","upload_url":"https://uploads.github.com/repos/YouAreOnlyOne/AndroidHttp/releases/13265123/assets{?name,label}","html_url":"https://github.com/YouAreOnlyOne/AndroidHttp/releases/tag/1.0.0.2","id":13265123,"node_id":"MDc6UmVsZWFzZTEzMjY1MTIz","tag_name":"1.0.0.2","target_commitish":"master","name":"1.0.0.2","draft":false,"author":{"login":"YouAreOnlyOne","id":18711902,"node_id":"MDQ6VXNlcjE4NzExOTAy","avatar_url":"https://avatars1.githubusercontent.com/u/18711902?v=4","gravatar_id":"","url":"https://api.github.com/users/YouAreOnlyOne","html_url":"https://github.com/YouAreOnlyOne","followers_url":"https://api.github.com/users/YouAreOnlyOne/followers","following_url":"https://api.github.com/users/YouAreOnlyOne/following{/other_user}","gists_url":"https://api.github.com/users/YouAreOnlyOne/gists{/gist_id}","starred_url":"https://api.github.com/users/YouAreOnlyOne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YouAreOnlyOne/subscriptions","organizations_url":"https://api.github.com/users/YouAreOnlyOne/orgs","repos_url":"https://api.github.com/users/YouAreOnlyOne/repos","events_url":"https://api.github.com/users/YouAreOnlyOne/events{/privacy}","received_events_url":"https://api.github.com/users/YouAreOnlyOne/received_events","type":"User","site_admin":false},"prerelease":false,"created_at":"2018-10-05T11:01:42Z","published_at":"2018-10-05T11:04:43Z","assets":[],"tarball_url":"https://api.github.com/repos/YouAreOnlyOne/AndroidHttp/tarball/1.0.0.2","zipball_url":"https://api.github.com/repos/YouAreOnlyOne/AndroidHttp/zipball/1.0.0.2","body":"# AndroidHttp\r\n\r\n一个整合OkHttp 、Retrofit 、Volley 、RxJava、Novate多种开源网络框架的项目，对网络请求框架和方法进行了高度的封装和集成，让网络请求更加简洁、简单，只需要一行代码就完成。\r\n\r\n本项目主要根据 GET 、POST 、UPLOAD 、DOWNLOAD 四个方面进行整合，集成了数据请求、数据解析、文件上传、文件下载、图片展示等方法。重载多样化参数的构造方法，大约有近 100 个左右的常用方法。\r\n\r\n每个方法都封装了需要参数，根据方法名结合自身需要传输的参数即可了解需要使用的方法，只需要一行代码进行调用和实现，重写逻辑处理代码即可。\r\n\r\n# 使用方法\r\n\r\n方法一：\r\n\r\n1.第一步，在项目的build.gradle下配置，注意是项目的build.gradle：\r\n\r\n       allprojects {\r\n\t      repositories {\r\n\t\t    ...\r\n\t\t   maven { url 'https://www.jitpack.io' }\r\n\t      }\r\n       }\r\n\r\n2.第二步,在app的build.gradle下添加如下依赖：\r\n\r\n      dependencies {\r\n                ...\r\n               implementation 'com.github.YouAreOnlyOne:AndroidHttp:版本号'\r\n               ...\r\n      }\r\n\r\n方法二：\r\n\r\n1.第一步，下载依赖的包：https://github.com/YouAreOnlyOne/AndroidHttp/blob/master/aar/networkrequest-release.aar  。并放到项目的 libs 目录下面。\r\n\r\n2.第二步,在app的build.gradle下添加如下依赖，注意，两个依赖是平级关系：\r\n\r\n        repositories {\r\n              flatDir {\r\n                   dirs 'libs'\r\n              }\r\n        }\r\n\r\n      dependencies {\r\n           ...\r\n          compile(name:'networkrequest-release', ext:'aar')\r\n          ...\r\n      }\r\n\r\n# 使用示例：\r\n\r\n由于每个框架集成和封装的方法有很对，这里只是随意挑选一个做演示，具体方法和目录见本文后面。使用总体策略：框架名称 . 方法名（如：OkhttpByPost . postFile() ）。\r\n\r\n1.Okhttp\r\n\r\n(1)输入这一行代码：\r\n\r\n        OkhttpByPost.postFile(\"http://www.baidu.com\",\"/mnt/TestFolder/test.doc\", new Callback()); \r\n\r\n然后按 Alt+Enter 键，选择 implement methods，自动生成如下代码：\r\n\r\n       OkhttpByPost.postFile(\"http://www.baidu.com\",\"/mnt/TestFolder/test.doc\", new Callback() {\r\n        @Override\r\n        public void onFailure(Call call, IOException e) {\r\n             ...\r\n             //请求失败的逻辑处理\r\n             ...\r\n        }\r\n        @Override\r\n        public void onResponse(Call call, Response response) throws IOException {\r\n              ...\r\n              //请求成功的逻辑处理\r\n              ...\r\n        }\r\n    });\r\n\r\n(2)输入这一行代码：\r\n\r\n        OkhttpByPost.postFileAddHeader(\"http://www.baidu.com\", headerName, headerValue, tokenName, tokenValue, \"/mnt/TestFolder/test.doc\", new Callback()); \r\n\r\n然后按 Alt+Enter 键，选择 implement methods，自动生成如下代码：\r\n\r\n       OkhttpByPost.postFileAddHeader(\"http://www.baidu.com\", headerName, headerValue, tokenName, tokenValue, \"/mnt/TestFolder/test.doc\", new Callback() {\r\n        @Override\r\n        public void onFailure(Call call, IOException e) {\r\n             ...\r\n             //请求失败的逻辑处理\r\n             ...\r\n        }\r\n        @Override\r\n        public void onResponse(Call call, Response response) throws IOException {\r\n              ...\r\n              //请求成功的逻辑处理\r\n              ...\r\n        }\r\n    });\r\n\r\n2.Volley\r\n\r\n输入这一行代码：\r\n\r\n        VolleyByImage.loadImageByImageRequest(this,\"http://baidu.com\", imageView,new Response.ErrorListener());\r\n\r\n然后按 Alt+Enter 键，选择 implement methods，自动生成如下代码：\r\n\r\n        VolleyByImage.loadImageByImageRequest(this, \"http://baidu.com\", imageView, new Response.ErrorListener() {\r\n                @Override\r\n                public void onErrorResponse(VolleyError error) {\r\n                     ...\r\n                     //图片加载错误的逻辑处理\r\n                     ...\r\n                }\r\n            });\r\n\r\n3.RxJava\r\n\r\n输入这一行代码：\r\n\r\n        RxJavaByPost.PostString(this, \"http://www.baidu.com/\", \"fanyi/china\", parameters, new RxStringCallback());\r\n\r\n然后按 Alt+Enter 键，选择 implement methods，自动生成如下代码：\r\n\r\n        RxJavaByPost.PostString(this, \"http://www.baidu.com/\", \"fanyi/china\", parameters, new RxStringCallback() {\r\n        @Override\r\n        public void onNext(Object tag, String response) {\r\n           ...\r\n           //网络请求成功返回的结果逻辑处理\r\n           ...\r\n        }\r\n\r\n        @Override\r\n        public void onError(Object tag, Throwable e) {\r\n           ...\r\n           //网络请求错误返回的结果逻辑处理\r\n          ...\r\n        }\r\n\r\n        @Override\r\n        public void onCancel(Object tag, Throwable e) {\r\n            ...\r\n            //网络请求取消返回的结果逻辑处理\r\n            ...\r\n        }\r\n    });\r\n\r\n# 项目用到的权限\r\n\r\n在manifest文件中添加访问的权限：\r\n\r\n        <uses-permission android:name=\"android.permission.INTERNET\"/>\r\n        <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>\r\n       <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\r\n       <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\r\n       <uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />\r\n       <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\r\n\r\n# 项目用到的三方依赖\r\n\r\n在app的build.gradle下添加如下依赖：\r\n\r\n       android {\r\n            packagingOptions {\r\n                  exclude 'META-INF/LICENSE'\r\n                  exclude 'META-INF/NOTICE'\r\n                  exclude 'META-INF/rxjava.properties'\r\n             }\r\n            ...\r\n            ...\r\n      }\r\n\r\n      dependencies {\r\n           ...\r\n          implementation 'com.squareup.okhttp3:okhttp:3.11.0'\r\n          testImplementation 'com.squareup.okhttp3:mockwebserver:3.11.0'\r\n          implementation 'com.squareup.retrofit2:retrofit:2.4.0'\r\n          implementation 'com.mcxiaoke.volley:library:1.0.19'\r\n          implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'\r\n          implementation 'io.reactivex.rxjava2:rxjava:2.1.0'\r\n          implementation 'com.tamic.novate:novate:1.5.2.3'\r\n          ...\r\n     }\r\n\r\n\r\n# 多样化工具类\r\n \r\n ## Ftp文件上传、文件下载、文件删除、进度监听\r\n \r\n Ftp文件上传、文件下载、文件删除、进度监听等功能是需要一行代码进行调用即可。\r\n \r\n ## 常用图片压缩及图片保存方法\r\n \r\n 包括质量压缩方法、比列压缩方法、分辨率压缩方法、图片存储等常用的方法，只需要一行代码就可以实现。\r\n \r\n ## 常用的加密算法\r\n \r\n 包括MD5加密算法、DES加密算法、MISC算法等等，已经封装好，只需要用类名点方法名（）即可调用实现。\r\n \r\n ## Strings工具类常用方法\r\n \r\n 包括字符编码的转换、时间格式的转换、非空的判断、输入流的转换等等，只需要调用即可使用。\r\n \r\n ## 日志输出管理\r\n \r\n 在任何一个文件中，不管是字符串日志还是数据列表日志，只要用L.e()或者L.g()或者L.a()等方法即可快速的打印日志。\r\n \r\n ## APP退出管理\r\n \r\n 包括App中Activity的加入和移除，状态监控及管理，彻底的退出应用程序的方法等等，一行代码调用方法即可完成操作。\r\n \r\n\r\n# 使用指南\r\n\r\n更新中……\r\n\r\n# 其它信息\r\n\r\n1.项目还有很多不完善的地方，欢迎大家指导。\r\n\r\n2.项目持续更新开源，有兴趣加入项目或者跟随项目的伙伴，可以邮件联系！\r\n\r\n3.关注或者喜欢或者尝试使用或者感兴趣的伙伴可以，点击 ~ star ~ 。\r\n\r\n# 作者邮箱\r\n\r\nycj52011@outlook.com\r\n"}}
{"actor":{"display_login":"YouAreOnlyOne"}}