Using the BBWebView library
BlackBerry Dynamics SDKcontains the BBWebView library that you can use to integrate the
AndroidWebView component with a
BlackBerry Dynamicsapp. The BBWebView code is available under the com.blackberry.bbwebview package name. The library is located at sdk/libs/handheld/bb_webview in the SDK package.
The BBWebView library supports secure HTTP request interception for an internal network (URL loading, XML, and fetch HTTP requests), data leakage protection for cut, copy, and paste, page history navigation, and a secure cookies store.
The BBWebView library contains the following APIs:
Note that BBWebView does not currently support:
- HTTP authentication (Basic, Digest, NTLM)
- File downloading or uploading into the secure container
- URL schemes (mailto:, geo:, and so on)
- Web worker (Service worker)
- Pasting content from aBlackBerry Dynamicsapp to WebView using drag and drop
- Resource caches
- Secure database
- Local storage (HTML5)
- Session storage
- Secure drag-and-drop data movement between applications
To load files from the local assets folder, you must use the web-like URL format
file:///android_asset/. For example, the following code will load the index.html page from the assets folder in BBWebView:
// Initialize BBWebView instance BBWebView webView = ... // Provide url with file name which is located in your application's assets folder webView.loadUrl("https://appassets.androidplatform.net/assets/index.html");
This method is compatible with the Same-Origin policy and recommended by Google. For more information, see WebViewAssetLoader.