Skip to content

Commit e56d7f1

Browse files
authored
Merge pull request #96 from NordicSemiconductor/develop
Version 1.4.4
2 parents 8f4907e + d0572c3 commit e56d7f1

File tree

10 files changed

+185
-181
lines changed

10 files changed

+185
-181
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Android BLE Scanner Compat library
22

3-
[ ![Download](https://api.bintray.com/packages/nordic/android/no.nordicsemi.android.support.v18%3Ascanner/images/download.svg) ](https://bintray.com/nordic/android/no.nordicsemi.android.support.v18%3Ascanner/_latestVersion)
3+
[ ![Download](https://maven-badges.herokuapp.com/maven-central/no.nordicsemi.android.support.v18/scanner/badge.svg?style=plastic) ](https://search.maven.org/artifact/no.nordicsemi.android.support.v18/scanner)
44

55
The Scanner Compat library solves the problem with scanning for Bluetooth Low Energy devices on Android.
66
The scanner API, initially created in Android 4.3, has changed in Android 5.0 and has been extended in 6.0 and 8.0.
@@ -24,15 +24,30 @@ for more details.
2424

2525
## Usage
2626

27-
The compat library may be found on jcenter repository. Add it to your project by adding the
27+
The compat library may be found on Maven Central repository. Add it to your project by adding the
2828
following dependency:
2929

3030
```Groovy
31-
implementation 'no.nordicsemi.android.support.v18:scanner:1.4.2'
31+
implementation 'no.nordicsemi.android.support.v18:scanner:1.4.4'
3232
```
3333

3434
Projects not migrated to Android Jetpack should use version 1.3.1, which is feature-equal to 1.4.0.
3535

36+
As JCenter has shut down, starting from version 1.4.4 the library is available only on Maven Central.
37+
Make sure you have `mavenCentral()` in your main *build.gradle* file:
38+
```gradle
39+
buildscript {
40+
repositories {
41+
mavenCentral()
42+
}
43+
}
44+
allprojects {
45+
repositories {
46+
mavenCentral()
47+
}
48+
}
49+
```
50+
3651
## API
3752

3853
The Scanner Compat API is very similar to the original one, known from Android Oreo.
@@ -59,7 +74,7 @@ To start scanning use (example):
5974
ScanSettings settings = new ScanSettings.Builder()
6075
.setLegacy(false)
6176
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
62-
.setReportDelay(1000)
77+
.setReportDelay(5000)
6378
.setUseHardwareBatchingIfSupported(true)
6479
.build();
6580
List<ScanFilter> filters = new ArrayList<>();

build.gradle

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4+
// https://plugins.gradle.org/plugin/io.github.gradle-nexus.publish-plugin
5+
ext.gradle_nexus_publish_plugin = '1.1.0'
6+
47
repositories {
58
google()
6-
jcenter()
9+
mavenCentral()
10+
maven { url "https://plugins.gradle.org/m2/" }
711
}
812
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.5.2'
10-
11-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
12-
// NOTE: Do not place your application dependencies here; they belong
13-
// in the individual module build.gradle files
13+
classpath 'com.android.tools.build:gradle:4.2.1'
14+
classpath "io.github.gradle-nexus:publish-plugin:$gradle_nexus_publish_plugin"
1415
}
1516
}
1617

1718
allprojects {
1819
repositories {
1920
google()
20-
jcenter()
21+
mavenCentral()
2122
}
22-
}
23+
}
24+
25+
task clean(type: Delete) {
26+
delete rootProject.buildDir
27+
}
28+
29+
// Maven Central publishing
30+
apply plugin: 'io.github.gradle-nexus.publish-plugin'
31+
apply from: rootProject.file('gradle/publish-root.gradle')

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
19-
android.enableJetifier=true
2019
android.useAndroidX=true
2120

22-
VERSION_NAME=1.4.3
21+
VERSION_NAME=1.4.4
2322
GROUP=no.nordicsemi.android.support.v18
2423

2524
POM_DESCRIPTION=Android Bluetooth LE Scanner Compat library
@@ -30,5 +29,6 @@ POM_SCM_DEV_CONNECTION=scm:[email protected]:NordicSemiconductor/Android-Scanner-Co
3029
POM_LICENCE=BSD 3-Clause
3130
POM_LICENCE_NAME=The BSD 3-Clause License
3231
POM_LICENCE_URL=http://opensource.org/licenses/BSD-3-Clause
33-
POM_DEVELOPER_ID=nordic
34-
POM_DEVELOPER_NAME=Nordic Semiconductor ASA
32+
POM_DEVELOPER_ID=philips77
33+
POM_DEVELOPER_NAME=Aleksander Nowakowski
34+
POM_DEVELOPER_EMAIL=[email protected]

gradle/gradle-bintray-push.gradle

Lines changed: 0 additions & 127 deletions
This file was deleted.

gradle/publish-module.gradle

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'signing'
3+
4+
group = GROUP
5+
version = VERSION_NAME
6+
7+
task androidSourcesJar(type: Jar) {
8+
archiveClassifier.set('sources')
9+
from android.sourceSets.main.java.srcDirs
10+
// from android.sourceSets.main.kotlin.srcDirs
11+
}
12+
13+
artifacts {
14+
archives androidSourcesJar
15+
}
16+
17+
afterEvaluate {
18+
publishing {
19+
publications {
20+
release(MavenPublication) {
21+
from components.release
22+
23+
artifact androidSourcesJar
24+
25+
groupId = GROUP
26+
artifactId = POM_ARTIFACT_ID
27+
version = VERSION_NAME
28+
29+
pom {
30+
name = POM_NAME
31+
packaging = POM_PACKAGING
32+
description = POM_DESCRIPTION
33+
url = POM_URL
34+
35+
scm {
36+
url = POM_SCM_URL
37+
connection = POM_SCM_CONNECTION
38+
developerConnection = POM_SCM_DEV_CONNECTION
39+
}
40+
41+
licenses {
42+
license {
43+
name = POM_LICENCE_NAME
44+
url = POM_LICENCE_URL
45+
}
46+
}
47+
48+
developers {
49+
developer {
50+
id = POM_DEVELOPER_ID
51+
name = POM_DEVELOPER_NAME
52+
email = POM_DEVELOPER_EMAIL
53+
}
54+
}
55+
}
56+
}
57+
}
58+
}
59+
}
60+
61+
ext["signing.keyId"] = rootProject.ext["signing.keyId"]
62+
ext["signing.password"] = rootProject.ext["signing.password"]
63+
ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]
64+
65+
signing {
66+
sign publishing.publications
67+
}

gradle/publish-root.gradle

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Create variables with empty default values
2+
File secretPropsFile = project.rootProject.file('local.properties')
3+
if (secretPropsFile.exists()) {
4+
// Read local.properties file first if it exists
5+
Properties p = new Properties()
6+
new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) }
7+
p.each { name, value -> ext[name] = value }
8+
}
9+
10+
// Set up Sonatype repository
11+
12+
nexusPublishing {
13+
14+
repositories {
15+
sonatype {
16+
stagingProfileId = sonatypeStagingProfileId
17+
username = ossrhUsername
18+
password = ossrhPassword
19+
}
20+
}
21+
22+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Nov 15 09:17:12 CET 2019
1+
#Thu Jun 03 15:02:51 CEST 2021
22
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
34
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
6+
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)