1. Home
  2. SDK Android
  3. Migrate to BEAR SDK 3.0.0

Migrate to BEAR SDK 3.0.0

BEAR SDK release 3.0.0 brings many improvements and better practices to make your integration smoother. This section describes what steps you need to follow to update your application with the version 3.0.0 of the BEAR SDK.

Update dependency version

First update the version of the BEAR SDK dependency to 3.0.0 in your application’s build.gradle file:

dependencies {
     …
     implementation(‘com.bear:bearsdk:3.0.0@aar’) {
          transitive = true
     }
}

Support 64-bit architectures

This update introduces support for 64-bit architectures to meet
Google Play requirements.

This will require change on your side if you use ABI splits
at your application. If so, your application’s build.gradle file
should include both armeabi-v7a and arm64-v8a for target ABIs.
Like below:

android {
  …
  splits {
    abi {
      enable true
      reset()
      include "armeabi-v7a", "arm64-v8a"
      universalApk false
    }
  }
}

Minimum Android API Level

Due to constantly decreasing number of devices running Android 4.4 the
minSdkVersion has been increased from API Level 19 to API Level 21.
This means that application released with SDK version 3.0.0 will be
compatible with devices running Android 5.0 and more.

To apply this change, you have to update your minSdkVersion
to at least 21 at your application’s build.gradle file.

Secret Key

Secret key has been improved to be more secure and robust.
This means that previously provided secret keys will no longer be
working with SDK version 3.0.0 and new one must be provided by BEAR.

Bear Handler

BearHandler class was renamed to IBearHandler class.
You will have to change import statements and references to this class.

Also getHandler() method from ArActivity has been renamed to
getBearHandler().

InitStatusListener and Bear Callback

InitStatusListener class has been removed together with
addArViewInitListener(InitStatusListener listener)),
removeArViewInitListener(InitStatusListener listener) and
isArViewInitialized() methods from ArActivity class.
To listen for initialization of the augmented reality view,
new callback onArViewInitialized() has been added to BearCallback class.

Also onError(Throwable error, boolean isMarkerFromScan) callback
from BearCallback has been changed to onError(Throwable error).
Additionally BearErrorException class has been added to provide
more detailed errors specific to BEAR SDK.

Screenshot

New onCancel() callback has been added to ScreenshotCallback class
to handle case when screenshot task may be cancelled.

Network Listener

NetworkStatusListener and NetworkStatus classes have been removed
together with addNetworkListener(NetworkStatusListener listener)
and removeNetworkListener(NetworkStatusListener listener) methods
from IBearHandler class.

ScanStatus

States from ScanStatus class have been updated to be more complete.

Was this article helpful to you? Yes No

How can we help?