diff --git a/mad-location-manager b/mad-location-manager new file mode 160000 index 00000000..90312982 --- /dev/null +++ b/mad-location-manager @@ -0,0 +1 @@ +Subproject commit 903129821e9aab2f59e5fc5e473ffad8c1d0034d diff --git a/madlocationmanager/build.gradle b/madlocationmanager/build.gradle index c6abb99e..adb0f438 100644 --- a/madlocationmanager/build.gradle +++ b/madlocationmanager/build.gradle @@ -1,15 +1,5 @@ plugins { id 'com.android.library' - id 'maven-publish' - id "com.jfrog.bintray" version "1.8.5" - -} - -group='com.github.maddevsio' - -ext { - // if CI does not set RELEASE_VERSION use hardcoded one - releaseVersion = System.getenv('RELEASE_VERSION') ?: '0.1.14' } android { @@ -45,19 +35,20 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } -task sourceJar(type: Jar) { +tasks.register('sourceJar', Jar) { archiveClassifier = 'sources' from android.sourceSets.main.java.srcDirs } -tasks.withType(Javadoc) { +tasks.withType(Javadoc).configureEach { options.addStringOption('Xdoclint:none', '-quiet') } -task androidJavadocs(type: Javadoc, dependsOn: build) { +tasks.register('androidJavadocs', Javadoc) { + dependsOn build source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - android.libraryVariants.all { variant -> + android.libraryVariants.configureEach { variant -> if (variant.name == 'release') { owner.classpath += variant.javaCompileProvider.get().classpath } @@ -65,78 +56,8 @@ task androidJavadocs(type: Javadoc, dependsOn: build) { exclude '**/R.html', '**/R.*.html', '**/index.html' } -task javadocJar(type: Jar, dependsOn: androidJavadocs) { +tasks.register('javadocJar', Jar) { + dependsOn androidJavadocs archiveClassifier.set('javadoc') from androidJavadocs.destinationDir -} - -project.afterEvaluate { - publishing { - publications { - mavenPublication(MavenPublication) { - groupId = 'com.maddevsio.mad-location-manager' - artifactId = 'mad-location-manager' - version = releaseVersion - - from components.release - artifact sourceJar - artifact javadocJar - - pom { - packaging 'aar' - name = 'Mad Location Manager' - description = 'This is library for GPS and Accelerometer data "fusion" with Kalman filter' - url = 'https://github.com/maddevsio/mad-location-manager' - licenses { - license { - name = 'MIT' - url = 'https://opensource.org/licenses/MIT' - } - } - developers { - developer { - id = 'Lezh1k' - name = 'Oleg Katkov' - email = 'lezh1k.vohrer@gmail.com' - } - } - scm { - connection = 'scm:git:git://github.com/maddevsio/mad-location-manager.git' - developerConnection = 'scm:git:ssh://github.com/maddevsio/mad-location-manager.git' - url = 'https://github.com/maddevsio/mad-location-manager' - } - } - } - } - } -} -bintray { - dryRun = false - publish = true - override = true - user = System.getenv('BINTRAY_USER') ?: (project.hasProperty('bintrayUser') ? project.property('bintrayUser') : '') - key = System.getenv('BINTRAY_KEY') ?: (project.hasProperty('bintrayKey') ? project.property('bintrayKey') : '') - publications = ['mavenPublication'] - - pkg { - repo = 'maven' - name = 'mad-location-manager' - userOrg = 'Lezh1k' - description = 'This is library for GPS and Accelerometer data "fusion" with Kalman filter' - publications = ['mavenPublication'] - licenses = ['MIT'] - vcsUrl = 'https://github.com/maddevsio/mad-location-manager.git' - websiteUrl = 'https://github.com/maddevsio/mad-location-manager.git' - issueTrackerUrl = 'https://github.com/maddevsio/mad-location-manager/issues' - githubRepo = 'maddevsio/mad-location-manager' - githubReleaseNotesFile = 'README.md' - version { - name = releaseVersion - desc = 'Mad Location Manager v' + releaseVersion - released = new Date() - vcsTag = releaseVersion - } - } -} - - +} \ No newline at end of file diff --git a/madlocationmanager/src/main/java/mad/location/manager/lib/locationProviders/FusedLocationProvider.java b/madlocationmanager/src/main/java/mad/location/manager/lib/locationProviders/FusedLocationProvider.java index 3710cce9..def326c9 100644 --- a/madlocationmanager/src/main/java/mad/location/manager/lib/locationProviders/FusedLocationProvider.java +++ b/madlocationmanager/src/main/java/mad/location/manager/lib/locationProviders/FusedLocationProvider.java @@ -75,12 +75,17 @@ public FusedLocationProvider(Context context,LocationProviderCallback m_location anyOf = {"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"} ) public void startLocationUpdates(Settings m_settings, HandlerThread thread) { - m_locationRequest = LocationRequest.create(); - m_locationRequest.setInterval(m_settings.gpsMinTime); - m_locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); + m_locationRequest = new LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY) + .setIntervalMillis(m_settings) + .setMinUpdateIntervalMillis(2000) + .setMinUpdateDistanceMeters(20) + .build(); + // m_locationRequest = LocationRequest.create(); + // m_locationRequest.setInterval(m_settings.gpsMinTime); + // m_locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); m_fusedLocationProviderClient.requestLocationUpdates(m_locationRequest, - locationCallback, - thread.getLooper()); + locationCallback, + thread.getLooper()); }