最近才刚刚接触到retrofit 然后就自己的理解对其进行简单的叙述
首先是将retrofit+rxjava+rxLifeCycle等库导入。我这个地方就一下子导入了包含其他的库如果你能够用到就可以直接使用如果不能用到可以去除掉
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
/*RxAndroid*/
compile 'com.trello.rxlifecycle2:rxlifecycle:2.1.0'
compile 'com.trello.rxlifecycle2:rxlifecycle-components:2.1.0'
/*Rx生命周期管理*/
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.0'
/*网络请求框架*/
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.jakewharton:butterknife:8.6.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'