DEVELOPERS BLOG

Switch to the BlackBerry Dynamics Maven Repository

ANNOUNCEMENTS / 01.25.22 / Mark Sohm

The release of BlackBerry Dynamics SDK for Android version 10.0 brought along with it a new capability that will simplify the build process for Android projects. BlackBerry is now providing a Maven repository to access this SDK. This simplifies previous methods of either manually downloading the SDK or using the Android Update Site and directly referencing the SDK’s location on your hard drive. Making this change will allow your projects to be more portable and built on different systems without requiring changes related to the SDK’s location. It should also make it easier to switch between versions of the BlackBerry Dynamics SDK.

Note that version 10.0 and higher are available in the BlackBerry Maven repository, so the previous method of integration will still need to be used for projects that are using older versions.

Let’s walk through what you need to do to make this switch in your Android Studio Project. You’ll be able to accomplish this in 2 quick and easy steps.

Step 1 – Remove Direct Reference to the BlackBerry Dynamics AAR File

Open the build.gradle for your project and locate the direct reference to the BlackBerry Dynamics AAR file. It will look something like this:



allprojects { repositories { google() jcenter() def localProperties = new File(rootDir, "local.properties") Properties properties = new Properties() localProperties.withInputStream { instr -> properties.load(instr) } def sdkDir = properties.getProperty('sdk.dir') maven { url sdkDir+'/extras/blackberry/dynamics_sdk/m2repository' } } }

The code after jcenter() can be deleted and replaced as shown by the code shown in step 2.

Step 2 – Add the BlackBerry Maven Repository

Open the build.gradle for your project and add in the BlackBerry Maven repository in the allprojects section. This will be added in the same location where the code from step 1 was deleted.  The highlighted region is the code that needs to be added.

 



allprojects { repositories { google() jcenter() maven { url "https://software.download.blackberry.com/repository/maven/" } } }

That’s It!

After making this simple change you can safely delete the BlackBerry Dynamics update site from your Android Studio SDK Manager and any copies of the SDK you manually downloaded. Android Studio will now download the appropriate version of the BlackBerry Dynamics library from our Maven repository.

Mark Sohm

About Mark Sohm

Senior Technical Solutions Manager on the Solution Architects team.

Mark Sohm joined BlackBerry in 2003 and currently works as a Senior Technical Solutions Manager on the Solutions Architects team. Mark Sohm has been helping developers create applications using BlackBerry technologies for over 15 years, starting way back with the very first BlackBerry JDK on BlackBerry OS 3.6 through to BlackBerry 10 and now Android with BlackBerry Dynamics and Android Enterprise.