在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:litesuits/android-lite-http开源软件地址:https://github.com/litesuits/android-lite-http开源编程语言:Java 100.0%开源软件介绍:Android network framework: LiteHttpTags : litehttp2.x-tutorials Website : http://litesuits.com 1. What‘s lite-http ?
2. Why choose lite-http ?Simple, powerful, make HTTP request with only one line of code: User user = liteHttp.get (url, User.class); asynchronous download a file(execute on sub-thread,listen on ui-thread): liteHttp.executeAsync(new FileRequest(url,path).setHttpListener(
new HttpListener<File>(true, true, true) {
@Override
public void onLoading(AbstractRequest<File> request, long total, long len) {
// loading notification
}
@Override
public void onSuccess(File file, Response<File> response) {
// successfully download
}
})
); configure an asynchronous login request by annotation: String loginUrl = "http://litesuits.com/mockdata/user_get";
// 1. URL : loginUrl
// 2. Parameter : name=value&password= value
// 3. Response : User
@HttpUri(loginUrl)
class LoginParam extends HttpRichParamModel<User> {
private String name;
private String password;
public LoginParam(String name, String password) {
this.name = name;
this.password = password;
}
}
liteHttp.executeAsync(new LoginParam("lucy", "123456")); will be built as http://xxx?name=lucy&password=123456 more details, you can see lite-http introduction: LiteHttp Introduction: Why should developers choose LiteHttp ? 3. What are the fetures ?
4. Overall architecture of lite-httpAbout App architecture, see my other article: [How to take high-quality Android project framework, the framework of the structure described in detail? ] 7 5. tutorials and analysis (◕‸◕)Good ◝‿◜, huh: [1. Initialization and preliminary usage] 8 [2. Simplified requests and non-safe method of use] 9 [3. Automatic model conversion] 10 [4. Custom DataParser and Json serialization library Replace] 11 [5. Files, bitmap upload and download] 12 [6. Disable network and traffic statistics] 13 [7. Retries and redirect] 14 [8. Exceptions handling and cancellation request] 15 [9. Multiple data transmission via POST(PUT)] 16 [10. Asynchronous concurrency and scheduling strategy] 17 [11. Global configuration and parameter settings Detailed] 18 [12. Annotation-Based request] 19 [13. Multilayer cache mechanism and usage] 20 [14. Detailed of callback listener] 21 [15. SmartExecutor: concurrent scheduler] 22 LiteHttp: Android网络通信框架中文版 换个语种,再来一次 标签: litehttp2.x版本系列教程 QQ群: 大群 47357508 , 二群 42960650 本系列文章面向android开发者,展示开源网络通信框架LiteHttp的主要用法,并讲解其关键功能的运作原理,同时传达了一些框架作者在日常开发中的一些最佳实践和经验。 LiteHttp之开篇简介和大纲目录1. lite-http是什么? (・̆⍛・̆)
2. 为什么选lite-http? (•́ ₃ •̀)简单、强大,线程无关,一行代码搞定API请求和数据转化: User user = liteHttp.get(url, User.class); 当然也可以开启线程异步下载文件: liteHttp.executeAsync(new FileRequest(url,path).setHttpListener(
new HttpListener<File>(true, true, true) {
@Override
public void onLoading(AbstractRequest<File> request, long total, long len) {
// loading notification
}
@Override
public void onSuccess(File file, Response<File> response) {
// successfully download
}
})
); 通过注解约定完成异步请求: @HttpUri(loginUrl)
class LoginParam extends HttpRichParamModel<User> {
private String name;
private String password;
public LoginParam(String name, String password) {
this.name = name;
this.password = password;
}
}
liteHttp.executeAsync(new LoginParam("lucy", "123456")); 将构建类似下面请求:http://xxx?name=lucy&password=123456 案例详情可见我另一篇lite-http引言文章:LiteHttp 引言:开发者为什么要选LiteHttp?? 3. lite-http有什么特点? (´ڡ`)
4. lite-http的整体架构是怎样的呀? (´ڡ`)关于App架构,请看我另一篇文章分享: 怎样搭高质量的Android项目框架,框架的结构具体描述? 5. 老湿,来点教学和分析带我飞呗? (◕‸◕)好的 ◝‿◜ ,下面直接给你看,疗效好记得联系我,呵呵哒: |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论