All Projects → AweiLoveAndroid → Httprequestprocessor

AweiLoveAndroid / Httprequestprocessor

Licence: apache-2.0
网络请求隔离框架简单封装,有两种实现方式:一种是代理模式实现的,一种是工厂模式实现的。

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Httprequestprocessor

Zsbpads
Material design、MVC、OKHttp、Glide、greendao 设计的一款面试题题库的app完整项目
Stars: ✭ 25 (-67.11%)
Mutual labels:  okhttp
Hunter
A fast, incremental, concurrent framework to develop compile plugin for android project to manipulate bytecode
Stars: ✭ 999 (+1214.47%)
Mutual labels:  okhttp
Ticket Analysis
移动端的彩票开奖查询系统
Stars: ✭ 61 (-19.74%)
Mutual labels:  okhttp
Avenuenet
AvenueNet 是一个基于 Retrofit 二次封装的网络请求库,使用 Rxjava 的链式调用方式,二次封装的目的是为了对请求数据的正确性以及错误状态做统一的处理,对 Retrofit 对象做管理,有点为业务而生的味道,并非纯正的网络请求库
Stars: ✭ 10 (-86.84%)
Mutual labels:  okhttp
Tina
a powerful android network library base on okhttp
Stars: ✭ 32 (-57.89%)
Mutual labels:  okhttp
Weaponapp
一个尽量做到极致的集大成App,努力做到最好(开发阶段)——MVVM+Retrofit+RxJava+Small 插件化+单元测试+MD
Stars: ✭ 1,011 (+1230.26%)
Mutual labels:  okhttp
Mvvmhabit
goldze: 本人喜欢尝试新的技术,以后发现有好用的东西,我将会在企业项目中实战,没有问题了就会把它引入到MVVMHabit中,一直维护着这套框架,谢谢各位朋友的支持。如果觉得这套框架不错的话,麻烦点个 star,你的支持则是我前进的动力!
Stars: ✭ 6,789 (+8832.89%)
Mutual labels:  okhttp
Android Okgraphql
Reactive GraphQl client for Android
Stars: ✭ 64 (-15.79%)
Mutual labels:  okhttp
Communicator
A monix wrapper for OkHttp
Stars: ✭ 34 (-55.26%)
Mutual labels:  okhttp
Jetpackmvvm
🐔🏀一个Jetpack结合MVVM的快速开发框架,基于MVVM模式集成谷歌官方推荐的JetPack组件库:LiveData、ViewModel、Lifecycle、Navigation组件 使用Kotlin语言,添加大量拓展函数,简化代码 加入Retrofit网络请求,协程,帮你简化各种操作,让你快速开发项目
Stars: ✭ 1,100 (+1347.37%)
Mutual labels:  okhttp
Mvvmhabitcomponent
👕基于MVVMHabit框架,结合阿里ARouter打造的一套Android MVVM组件化开发方案
Stars: ✭ 857 (+1027.63%)
Mutual labels:  okhttp
Awesome Third Library Source Analysis
📖 Deep understanding of popular open source library source code (optimizing...)
Stars: ✭ 866 (+1039.47%)
Mutual labels:  okhttp
Meteorite
一个基于Android MVP的简单明了的指引性通用架构,目的是帮助更多的开发者去全面了解实践开发相关的各种技术,快速搭建属于自已的APP。这个项目涉及到如下技术的实际应用:1、MVP 2、网络请求(Novate基于rxjava,okhttp,retrofit封装架构)3、DbFlow(可保存文件入SD卡) 4、6.0权限申请 5、XRecyclerView 6、万能Adapter7、异常处理 8、日志打印 9、屏幕适配 10、代码混淆 11、多渠道打包 12、内存泄露检测 13、热修复 14、升级更新 15、极光推送 工程更新完善中……欢迎关注 @特别感谢ZJ.Y的Logo支持。
Stars: ✭ 49 (-35.53%)
Mutual labels:  okhttp
Androidall
Android 程序员需要掌握的技术栈:数据结构算法、程序架构、设计模式、性能优化、插件化、热更新、Kotlin、NDK、Jetpack,以及常用的开源框架源码分析如 Flutter、Router、RxJava、Glide、LeakCanary、Dagger2、Retrofit、OkHttp、ButterKnife 等
Stars: ✭ 849 (+1017.11%)
Mutual labels:  okhttp
Fetch
The best file downloader library for Android
Stars: ✭ 1,124 (+1378.95%)
Mutual labels:  okhttp
Okhttpparamsget
帮助你去获取params
Stars: ✭ 22 (-71.05%)
Mutual labels:  okhttp
Easygo
基于Kotlin、OkHttp的声明式网络框架,像写HTML界面一样写网络调用代码
Stars: ✭ 40 (-47.37%)
Mutual labels:  okhttp
Logginginterceptor
An OkHttp interceptor which has pretty logger for request and response. +Mock support
Stars: ✭ 1,149 (+1411.84%)
Mutual labels:  okhttp
Contentful.java
Java SDK for Contentful's Content Delivery API
Stars: ✭ 63 (-17.11%)
Mutual labels:  okhttp
Sttp
The Scala HTTP client you always wanted!
Stars: ✭ 1,078 (+1318.42%)
Mutual labels:  okhttp

HttpRequestProcessor

网络请求隔离框架,有两种实现方式:一种是代理模式实现的,一种是工厂模式实现的。

使用方式如下:

先来说说代理模式的使用方法:

一、首先在application里面声明使用哪个框架

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        //这里只需要一行代码切换网络框架,6不6!!!
        
        //初始化Volley方式网络请求代理
        HttpHelper.init(new VolleyProcessor(this));
            
        //初始化Okhttp方式网络请求代理
        //HttpHelper.init(new OkHttpProcessor());
    }
}

二、在代码里面具体使用

	public class MainActivity extends AppCompatActivity implements View.OnClickListener {

	private TextView textView;
	private Button button;
	
    //快递接口
	private String url2 = "http://www.kuaidi100.com/query?type=quanfengkuaidi&postid=300008026630";
	
    @Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		textView = (TextView) findViewById(R.id.textView);
		button = (Button) findViewById(R.id.button);
		button.setOnClickListener(this);

	}

	@Override
	public void onClick(View v) {
		if (v.getId() == R.id.button) {
			//访问网络
			HttpHelper.obtain().get(url2,
				null, new HttpCallback<ExpressBean>() {
					@Override
					public void onSuccess(ExpressBean expressBean) {
						StringBuffer sb = new StringBuffer();
						if(expressBean != null){
							ArrayList<ExpressBean.DataBean> datas = expressBean.data;
							for(ExpressBean.DataBean data : datas){
								sb.append("时间:")
									.append(data.time+"\r\n")
									.append("地点和跟踪进度:")
									.append(data.context+"\r\n"+"\r\n");
								textView.setText(sb.toString());
							}

						}
					}

					@Override
					public void onFailed(String string) {
						Toast.makeText(MainActivity.this,"请求失败了。。"+ string,Toast.LENGTH_SHORT).show();
					}
				});
		}
	}
}

是不是很简单?

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].