Skip to content

Commit b1ee780

Browse files
authored
Merge pull request #400 from YangSen-qn/master
change readme
2 parents 0cd3551 + ef89f9f commit b1ee780

File tree

5 files changed

+37
-25
lines changed

5 files changed

+37
-25
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jdk:
99
android:
1010
components:
1111
#- tools
12-
#- platform-tools
13-
#- tools
12+
- platform-tools
13+
- tools
1414

1515
# The BuildTools version used by your project
1616
- build-tools-29.0.2
@@ -37,7 +37,7 @@ before_script:
3737
script:
3838
- ./gradlew build
3939
- ./gradlew :library:createDebugAndroidTestCoverageReport --info --stacktrace
40-
- ./gradlew connectedAndroidTest --info
40+
- ./gradlew connectedAndroidTest --info --stacktrace
4141

4242
after_success:
4343
- bash <(curl -s https://codecov.io/bash)

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ https://github.com/qiniudemo/qiniu-lab-android
2525
| 7.0.7 | Android 2.2+ | android-async-http 1.4.8 |
2626

2727
### 注意
28-
* 推荐使用最新版:7.6.4,7.6.3使用okhttp4.2.2
28+
* 推荐使用最新版:7.6.4
2929
* 7.4.6是在7.6.4版本上降低okhttp版本,其他功能不变,AndroidNetwork.getMobileDbm()可以获取手机信号强度,需要如下权限(API>=18时生效)
3030
```
3131
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
@@ -41,12 +41,23 @@ https://github.com/qiniudemo/qiniu-lab-android
4141
[happy-dns下载地址](https://repo1.maven.org/maven2/com/qiniu/happy-dns/)
4242

4343
### 通过maven
44-
* 如果在Adroid Studio中使用,添加dependencies `compile 'com.qiniu:qiniu-android-sdk:7.2.+'` 或在项目中添加maven依赖
44+
* Adroid Studio中添加dependencies 或者 在项目中添加maven依赖
45+
```
46+
// 1. 直接导入
47+
implementation 'com.qiniu:qiniu-android-sdk:7.6.+'
48+
49+
// 2. 如果要修改okhttp依赖的版本,可采用以下方式(强烈建议使用七牛库依赖的okhttp版本)
50+
implementation ('com.qiniu:qiniu-android-sdk:7.6.+'){
51+
exclude (group: 'com.squareup.okhttp3', module: 'okhttp')
52+
}
53+
implementation 'com.squareup.okhttp3:okhttp:4.2.2'
54+
55+
```
4556
* 如果是eclipse, 也可以直接添加依赖来处理。
4657

4758
## 使用方法
4859
UploadManager 可以创建一次,一直使用。
49-
7.6.2调用AndroidNetwork.getMobileDbm可以获取网络信号强度
60+
7.6.2开始调用AndroidNetwork.getMobileDbm可以获取网络信号强度
5061
需要Manifest.permission.ACCESS_FINE_LOCATION和Manifest.permission.ACCESS_COARSE_LOCATION权限
5162
```java
5263
import com.qiniu.android.storage.UploadManager;
@@ -80,7 +91,7 @@ dependencies {
8091
compile fileTree(dir: 'libs', include: ['*.jar'])
8192
testCompile 'junit:junit:4.12'
8293
compile 'com.android.support:appcompat-v7:23.1.1'
83-
compile 'com.qiniu:qiniu-android-sdk:7.2.+'
94+
compile 'com.qiniu:qiniu-android-sdk:7.6.+'
8495
}
8596
```
8697
当然也可以将jar包下载到本地导入到项目中
@@ -607,11 +618,6 @@ import com.qiniu.android.bigdata.pipeline.Pipeline;
607618
...
608619
```
609620

610-
611-
## 运行环境
612-
613-
Android 最低要求 2.3
614-
615621
## 代码贡献
616622

617623
详情参考[代码提交指南](https://github.com/qiniu/android-sdk/blob/master/CONTRIBUTING.md)

library/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ dependencies {
5757
// for javax.annotation.Nullable use in custom MultipartBody and Headers implements.
5858
// implementation 'com.google.code.findbugs:jsr305:3.0.2'
5959
implementation fileTree(include: ['*.jar'], dir: 'libs')
60-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
6160
implementation 'com.google.code.gson:gson:2.8.6'
61+
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
62+
testImplementation 'junit:junit:4.13'
6263
}
6364

6465
task releaseJar(type: Jar, dependsOn: 'build') {

library/src/androidTest/java/com/qiniu/android/TestConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ public final class TestConfig {
1010
// TODO: 2020-05-09 bad token for testPutBytesWithFixedZoneUseBackupDomains
1111
//华东上传凭证
1212
public static final String bucket_z0 = "sdk-z0";
13-
public static final String token_z0 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:7MhcqtMD-_D1ADDRkMA1w0okmlE=:eyJzY29wZSI6InNkay16MCIsImRlYWRsaW5lIjoxNTk1MDU4MzEyfQ==";
13+
public static final String token_z0 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:fO65e-s-sRrcNiWkZ3qcrCLM3pM=:eyJzY29wZSI6InNkay16MCIsImRlYWRsaW5lIjoxNTk3MjAyMDYwfQ==";
1414
//华北上传凭证
1515
public static final String bucket_z1 = "sdk-z1";
16-
public static final String token_z1 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:R3WxmBCVotZkVoI0NNZgNDEqcTY=:eyJzY29wZSI6InNkay16MSIsImRlYWRsaW5lIjoxNTk1MDU4MzUwfQ==";
16+
public static final String token_z1 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:KHpcWxGAAut9zJjGaHEqEbjlf-c=:eyJzY29wZSI6InNkay16MSIsImRlYWRsaW5lIjoxNTk3MjAyMDgzfQ==";
1717
//华南上传凭证
1818
public static final String bucket_z2 = "sdk-z2";
19-
public static final String token_z2 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:S9V-5ttyKKfzH59Ncs7wooEOpc4=:eyJzY29wZSI6InNkay16MiIsImRlYWRsaW5lIjoxNTk1MDU4MzY0fQ==";
19+
public static final String token_z2 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:yt7nub2-FOkK2zwodXSgxinpboE=:eyJzY29wZSI6InNkay16MiIsImRlYWRsaW5lIjoxNTk3MjAyMTAwfQ==";
2020
//北美上传凭证
2121
public static final String bucket_na0 = "sdk-na0";
22-
public static final String token_na0 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:hNobj3oBf2OxjafAlH6przLDAOs=:eyJzY29wZSI6InNkay1uYTAiLCJkZWFkbGluZSI6MTU5NTMxNDIyN30=";
22+
public static final String token_na0 = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW:J9AbA4jVl4BtsAFg9XooZaa2Iyk=:eyJzY29wZSI6InNkay1uYTAiLCJkZWFkbGluZSI6MTU5NzIwMjExNX0=";
2323
public static final String ak = "bjtWBQXrcxgo7HWwlC_bgHg81j352_GhgBGZPeOW";
2424

2525

library/src/androidTest/java/com/qiniu/android/common/AutoZoneTest.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,21 @@ public void onFailure(int reason) {
9090
fail(reason + "");
9191
}
9292
});
93-
try {
94-
countDownLatch.await();
95-
} catch (InterruptedException e) {
96-
e.printStackTrace();
97-
}
98-
ZoneInfo info = autoZone.zoneInfo(ak, bkt);
9993

100-
ZoneInfo info2 = autoZone.zoneInfo(ak, bkt);
101-
Assert.assertSame(info, info2);
94+
boolean wait = true;
95+
while (wait){
96+
97+
wait = false;
98+
99+
try {
100+
countDownLatch.await();
101+
} catch (InterruptedException e) {
102+
e.printStackTrace();
103+
wait = true;
104+
}
105+
}
102106

107+
assertTrue(autoZone != null);
103108
}
104109

105110
}

0 commit comments

Comments
 (0)