Android Studio導入Retrofit

dependencies中添加
這裏是直接添加retrofit2.0版本
也可以按shift+ctrl+alt+s(as windows版)
搜索添加

compile 'com.squareup.retrofit2:retrofit:2.1.0'

//將網絡請求轉化成java bean對象 也可以自定義
compile 'com.squareup.retrofit2:converter-gson:2.1.0'  
compile 'com.squareup.retrofit2:converter-scalars:2.0.0'

//retrofit和rxandroid連接
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'

//將網絡請求轉化成java bean對象 也可以自定義

Gson - com.squareup.retrofit2:converter-gson  
Jackson - com.squareup.retrofit2:converter-jackson  
Moshi - com.squareup.retrofit2:converter-moshi  
Protobuf - com.squareup.retrofit2:converter-protobuf  
Wire - com.squareup.retrofit2:converter-wire  
Simple Framework - com.squareup.retrofit2:converter-simpleframework  
Scalars - com.squareup.retrofit2:converter-scalars  
LoganSquare - com.github.aurae.retrofit2:converter-logansquare  
FastJson - org.ligboy.retrofit2:converter-fastjson or org.ligboy.retrofit2:converter-fastjson-android  
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章