DEVELOPERS BLOG

WebViews in BlackBerry Dynamics Android Applications

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 four 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 an About screen. Any network requests will be made directly to the Internet and will 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
  • Customizable

Cons

  • Higher complexity than other options

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.

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


Let us know if you have any questions about these options in the Android BlackBerry Dynamics Developer Forum.

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.