diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0d08e26 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/CHANGELOG.md b/CHANGELOG.md index 66496c4..981936c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,35 @@ # Changelog +## v0.13.0 + +### Vision +- Add video recording for custom `VideoSource` implementation +- Update Vision, Vision AR and Vision Safety to Android SDK 10 +- Add all required permissions to Vision SDK manifest +- Change default resolution of Camera2VideoSourceImpl to 960*540 +- Add optional parameter to Camera2VideoSourceImpl constructor to enable\disable autofocus +- Add support of reverse landscape orientation +- Integrated new rendering engine for VisionView and VisionArView with better performance +- Add `VisionManager.setCameraHeight` +- Add `aspectRatio`, `roll`, `pitch`, `yaw`, `height` properties to `Camera` +- Improve lane detection +- Stop sending some inaccurate events until the camera is calibrated +- Introduce automatic camera recalibration +- Expand Japan region to include Okinawa +- Fix bug with speed estimation when a vehicle is stopped +- Fix bug that prevented new China users authorization +- Remove deprecated code for 0.12.0: + - `VisionManager.setModelPerformanceConfig` + - `VisionReplayManager.setModelPerformanceConfig` + - `SystemInfoUtils.getSnpeSupportedBoard` + - `SystemInfoUtils.getSystemProperty` + - `enum class SupportedSnapdragonBoards` + - `class ModelPerformanceConfig` + +### AR + +- Deprecate `ARCamera` class in favor of utilization of `Camera` class + ## v0.12.0 ### Device support diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..91e5620 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @mapbox/vision-android diff --git a/Examples/build.gradle b/Examples/build.gradle index b599b3e..a7b3c77 100644 --- a/Examples/build.gradle +++ b/Examples/build.gradle @@ -9,7 +9,7 @@ apply from: "../gradle/versions.gradle" apply from: "../gradle/ktlint.gradle" android { - compileSdkVersion 28 + compileSdkVersion compile_sdk_version compileOptions { sourceCompatibility 1.8 @@ -18,8 +18,8 @@ android { defaultConfig { applicationId "com.mapbox.vision.examples" - minSdkVersion 23 - targetSdkVersion 28 + minSdkVersion min_sdk_version + targetSdkVersion target_sdk_version versionCode 1 versionName "1.0" diff --git a/Examples/src/main/java/com/mapbox/vision/examples/BaseActivity.java b/Examples/src/main/java/com/mapbox/vision/examples/BaseActivity.java index b68d9fb..76648d2 100644 --- a/Examples/src/main/java/com/mapbox/vision/examples/BaseActivity.java +++ b/Examples/src/main/java/com/mapbox/vision/examples/BaseActivity.java @@ -4,16 +4,14 @@ import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; -import android.text.Html; -import android.text.Spanned; -import android.widget.Toast; - +import android.text.method.LinkMovementMethod; +import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.ContextCompat; - +import androidx.core.text.HtmlCompat; import com.mapbox.vision.mobile.core.utils.SystemInfoUtils; -import com.mapbox.vision.mobile.core.utils.snapdragon.SupportedSnapdragonBoards; import com.mapbox.vision.utils.VisionLogger; public abstract class BaseActivity extends AppCompatActivity { @@ -29,17 +27,28 @@ public abstract class BaseActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - String board = SystemInfoUtils.INSTANCE.getSnpeSupportedBoard(); - if (!SupportedSnapdragonBoards.isBoardSupported(board)) { - Spanned text = - Html.fromHtml("The device is not supported, you need Snapdragon-powered device with OpenCL support, more details at https://www.mapbox.com/android-docs/vision/overview/"); - Toast.makeText(this, text, Toast.LENGTH_LONG).show(); + if (!SystemInfoUtils.INSTANCE.isVisionSupported()) { + final TextView textView = new TextView(this); + final int padding = (int) dpToPx(20f); + textView.setPadding(padding, padding, padding, padding); + textView.setMovementMethod(LinkMovementMethod.getInstance()); + textView.setClickable(true); + textView.setText( + HtmlCompat.fromHtml( + getString(R.string.vision_not_supported_message), + HtmlCompat.FROM_HTML_MODE_LEGACY + ) + ); + new AlertDialog.Builder(this) + .setTitle(R.string.vision_not_supported_title) + .setView(textView) + .setCancelable(false) + .show(); + VisionLogger.Companion.e( - "NotSupportedBoard", - "Current board is " + board + ", Supported Boards: [ " + getSupportedBoardNames() + " ]; System Info: [ " + SystemInfoUtils.INSTANCE.obtainSystemInfo() + " ]" + "BoardNotSupported", + "System Info: [" + SystemInfoUtils.INSTANCE.obtainSystemInfo() + "]" ); - finish(); - return; } initViews(); @@ -53,15 +62,6 @@ protected void onCreate(Bundle savedInstanceState) { } } - private String getSupportedBoardNames() { - StringBuilder sb = new StringBuilder(); - for (SupportedSnapdragonBoards board : SupportedSnapdragonBoards.values()) { - sb.append(board.name()); - } - - return sb.toString(); - } - protected boolean allPermissionsGranted() { for (String permission : getRequiredPermissions()) { if (ContextCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) { @@ -94,6 +94,10 @@ private String[] getRequiredPermissions() { return permissions; } + private float dpToPx(final float dp) { + return dp * getApplicationContext().getResources().getDisplayMetrics().density; + } + @Override public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); diff --git a/Examples/src/main/res/values/strings.xml b/Examples/src/main/res/values/strings.xml index ab89add..b8a1c8d 100644 --- a/Examples/src/main/res/values/strings.xml +++ b/Examples/src/main/res/values/strings.xml @@ -8,4 +8,6 @@ POI Example Camera calibration: %1$d %% Usb Camera Example + Device is not supported + Vision SDK does not support this device yet, check more details at <a href=\"https://docs.mapbox.com/android/vision/overview/#requirements\">docs.mapbox.com</a> diff --git a/build.gradle b/build.gradle index d480346..8407785 100644 --- a/build.gradle +++ b/build.gradle @@ -18,18 +18,18 @@ allprojects { google() jcenter() - maven { url "https://mapbox.bintray.com/mapbox" } - maven { - credentials { - username mapboxMavenUser - password mapboxMavenToken - } + url 'https://api.mapbox.com/downloads/v2/releases/maven' authentication { basic(BasicAuthentication) } - - url 'https://api.mapbox.com/downloads/v1/vision/android/maven' + credentials { + // Do not change the username below. + // This should always be `mapbox` (not your username). + username = 'mapbox' + // Use the secret token you stored in gradle.properties as the password + password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: System.getenv("MAPBOX_DOWNLOADS_TOKEN") ?: "" + } } maven { url 'http://raw.github.com/saki4510t/libcommon/master/repository/' } diff --git a/gradle/versions.gradle b/gradle/versions.gradle index 923a45e..57c2cc5 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -1,15 +1,15 @@ ext { - gradle_plugin ='3.6.1' - kotlin_version = '1.3.61' + gradle_plugin ='3.6.3' + kotlin_version = '1.3.72' min_sdk_version = 23 - target_sdk_version = 28 - compile_sdk_version = 28 - build_tools_version = '28.0.3' + target_sdk_version = 29 + compile_sdk_version = 29 + build_tools_version = '29.0.2' android_x_appcompat = '1.1.0' - vision = '0.12.0' + vision = '0.13.0' mapbox_core = '1.4.1' mapbox_navigation = '0.42.5'