DEVELOPERS BLOG

WebViews in BlackBerry Dynamics Android Applications - Updated

This article was originally posted in April 2020. It has been updated to include BBWebView.

There are multiple views available that allow you to display web content within a BlackBerry Dynamics (BD) Android application.  Each has different capabilities, so it’s important to understand what they offer so you can choose the one that is most appropriate for your intended use.  It is important to note that not all WebViews are able to make use of BD networking technology and could be a key factor in choosing the appropriate one for your application.

BlackBerry Dynamics provides a secure method for an application to reach servers behind a corporate firewall.  This is illustrated in the diagram above.  For more information on how this works, refer to the BlackBerry Dynamics Architecture Overview.

Let’s look at the five options currently available and the capabilities they offer.

BlackBerry Access

Pros

⦁ Uses BlackBerry Dynamics Network Connectivity

⦁ Implements data leakage protection

⦁ Simple to use

⦁ Handles authentication methods supported by BlackBerry Access

Cons

⦁ Limited customization

⦁ Requires BlackBerry Access be installed

Your application can invoke BlackBerry Access using the Open HTTP URL Shared Service to either display the content in BlackBerry Access (in a separate app) or to display within your application as a full screen view of the web content rendered by BlackBerry Access.  The full screen view allows you to control whether the browser chrome (URL bar, etc) and Launcher are displayed.  This method makes use of BD Network Connectivity and will handle all authentication methods supported by BlackBerry Access.  The feature to have a BlackBerry Access screen view appear in your own app was added in the March 2020 release of BlackBerry Access for Android.

Native Android WebView

Pros

⦁ No code changes to your existing application

⦁ Customizable

Cons

⦁ Doesn’t use BlackBerry Dynamics Network Connectivity

⦁ Doesn’t implement data leakage protection

This option refers to the standard WebView widget that’s part of Android and is probably what your (non BD) application currently uses.  If you are displaying web content that is stored locally within your application, you could continue to use this method if the information shown is not confidential, such as a Help or About screen.  Any network requests will be made directly to the Internet and not use BD Network Connectivity.  This means your application will not be able to use BD technology to access resources behind a corporate firewall.  BD data leakage policies will also not be applied, so users will be able to copy data from within your application and paste it into any other app unless you implement the BD ClipboardManager into your app.

GDWebView

Pros

⦁ Minor code changes to your existing application

⦁ Implements data leakage protection

⦁ Customizable

Cons

⦁ Doesn’t use BlackBerry Dynamics Network Connectivity

The GDWebView extends the native Android WebView.  It implements data leakage protection by blocking copy and paste and prevents form data being saved when utilizing the Android autofill framework when these features are disabled in the policy configured on BlackBerry UEM.  It offers no additional functionality beyond data leakage prevention over the native Android WebView.

Open Source BD Android WebView

Pros

⦁ Uses BlackBerry Dynamics Network Connectivity

⦁ Implements data leakage protection

⦁ Highly Customizable

Cons

⦁ Higher complexity than other options

⦁ New features added to BDWebView may not be added to this project

The open source Android WebView created by BlackBerry is available in our Github repo here:  https://github.com/blackberry/BlackBerry-Dynamics-Android-Samples/tree/master/AndroidWebView.  This sample extends GDWebView and adds support for BD Network Connectivity, allowing access to content hosted within a corporate intranet.

BDWebView

Pros

⦁ Uses BlackBerry Dynamics Network Connectivity

⦁ Saves cookies in BlackBerry Dynamics Secure Storage

⦁ Implements data leakage protection

⦁ Easy to integrate into your project

⦁ Customizable

Cons

⦁ Not as customizable as the open-source variant

The BDWebView was added to version 9.2 of the BlackBerry Dynamics SDK and was based off of the Open Source BD Android WebView. BlackBerry took the Open Source BD Android WebView sample and built it into a library that can be easily added to your project. It extends android.webkit.WebView, making it easy to replace the native Android WebView with BBWebView in your app. You can see how in our WebView_BDSDK sample app.

Summary

After reading this post you should have a better understanding of the options available for displaying web content in your BD Android application.  The following table summarizes the key points covered for each field:

 

BD Network Connectivity

BD Data Leakage Prevention

Customizability

BlackBerry Access

YES

YES

LOW

Native Android WebView

NO

NO

HIGH

GDWebView

NO

YES

HIGH

Open Source BD Android WebView

YES

YES

HIGH

BDWebView

YES

YES

HIGH

 

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.