Retrofit——下载

今天讲Retrofit下载,包括jar形式、Maven形式、Gradle形式。另外,提供Retrofit的GitHub地址,再讲下Retrofit的混淆。


Retrofit jar下载及配置:

Retrofit 的jar(V2.3.0)下载地址,点这里

Retrofit的Maven配置:

<dependency>
  <groupId>com.squareup.retrofit2</groupId>
  <artifactId>retrofit</artifactId>
  <version>2.3.0</version>
</dependency>

Retrofit的Gradle配置:

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

Retrofit要求在java 7和android2.3以上运行。


Retrofit的Github地址:

https://github.com/square/retrofit



Retrofit混淆:

如果你在你的工程中使用ProGuard来混淆,你需要添加下面的这些配置。

# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions

Retrofit使用 OKio作为网络请求引擎,因此,你还需要了解它的ProGuard规则。见参考网址:

https://github.com/square/okio#proguard


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值