• BlackBerry Dynamics
  • Runtime library for Android applications
  • 10.2.0.79
BBWebViewClient Class Reference

Class for loading URLs via BlackBerry Dynamics SDK.

Inherits BBWebViewClientImpl.

Public Member Functions

void onPageCommitVisible (WebView view, String url)
 Notify the host application that WebView content left over from previous page navigations will no longer be drawn. More...
 
WebResourceResponse shouldInterceptRequest (final WebView webView, final WebResourceRequest request)
 Notify the host application of a resource request and allow the application to return the data. More...
 
void onReceivedError (WebView webView, WebResourceRequest request, WebResourceError error)
 Report web resource loading error to the host application. More...
 
void onReceivedHttpError (WebView view, WebResourceRequest request, WebResourceResponse errorResponse)
 Notify the host application that an HTTP error has been received from the server while loading a resource. More...
 
void onFormResubmission (WebView view, Message dontResend, Message resend)
 Ask the host application if the browser should resend data as the requested page was an objectCondition of a POST. More...
 
void doUpdateVisitedHistory (WebView view, String url, boolean isReload)
 Notify the host application to update its visited links database. More...
 
void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error)
 This function currently is not supported.
 
void onReceivedClientCertRequest (WebView view, ClientCertRequest request)
 This function currently is not supported.
 
void onReceivedHttpAuthRequest (WebView view, HttpAuthHandler handler, String host, String realm)
 This function currently is not supported.
 
void onReceivedBBHttpAuthRequest (WebView view, BBHttpAuthHandler handler, String host, String realm)
 Notifies the host application that the WebView received an HTTP authentication request. More...
 
boolean shouldOverrideKeyEvent (WebView view, KeyEvent event)
 Give the host application a chance to handle the key event synchronously. More...
 
void onUnhandledKeyEvent (WebView view, KeyEvent event)
 Notify the host application that a key was not handled by the WebView. More...
 
void onScaleChanged (WebView view, float oldScale, float newScale)
 Notify the host application that the scale applied to the WebView has changed. More...
 
void onReceivedLoginRequest (WebView view, String realm, String account, String args)
 Notify the host application that a request to automatically log in the user has been processed. More...
 
boolean onRenderProcessGone (WebView view, RenderProcessGoneDetail detail)
 Notify host application that the given WebView's render process has exited. More...
 
boolean shouldOverrideUrlLoading (WebView view, WebResourceRequest request)
 Give the host application a chance to take control when a URL is about to be loaded in the current WebView. More...
 
void onPageStarted (WebView view, String url, Bitmap favicon)
 Notify the host application that a page has started loading. More...
 
void onPageFinished (WebView view, String url)
 Notify the host application that a page has finished loading. More...
 
void onLoadResource (WebView view, String url)
 Notify the host application that the WebView will load the resource specified by the given URL. More...
 
void onSafeBrowsingHit (WebView view, WebResourceRequest request, int threatType, SafeBrowsingResponse callback)
 Notify the host application that a loading URL has been flagged by Safe Browsing. More...
 
WebClientObserver getObserver ()
 Returns WebClientObserver. More...
 

Static Public Attributes

static final String WEBVIEW_ASSET_LOCATION_URL = DEFAULT_WEBVIEW_ASSET_DOMAIN + WEBVIEW_ASSET_DIRECTORY
 Constant value "https://appassets.androidplatform.net/assets/" for loading local files in BBWebView.
 

Member Function Documentation

◆ onPageCommitVisible()

void onPageCommitVisible ( WebView  view,
String  url 
)

Notify the host application that WebView content left over from previous page navigations will no longer be drawn.

Refer to the equivalent method onPageCommitVisible() in the API Guide on the develos site.

◆ shouldInterceptRequest()

WebResourceResponse shouldInterceptRequest ( final WebView  webView,
final WebResourceRequest  request 
)

Notify the host application of a resource request and allow the application to return the data.

Refer to the equivalent method shouldInterceptRequest in the API Guide on the developer.android.com site.

◆ onReceivedError()

void onReceivedError ( WebView  webView,
WebResourceRequest  request,
WebResourceError  error 
)

Report web resource loading error to the host application.

Refer to the equivalent method onReceivedError in the API Guide on the developer.android.com site.

◆ onReceivedHttpError()

void onReceivedHttpError ( WebView  view,
WebResourceRequest  request,
WebResourceResponse  errorResponse 
)

Notify the host application that an HTTP error has been received from the server while loading a resource.

Refer to the equivalent method onReceivedHttpError in the API Guide on the developer.android.com site.

◆ onFormResubmission()

void onFormResubmission ( WebView  view,
Message  dontResend,
Message  resend 
)

Ask the host application if the browser should resend data as the requested page was an objectCondition of a POST. The default is to not resend the data.

Parameters
viewThe WebView that is initiating the callback.
dontResendThe message to send if the browser should not resend
resendThe message to send if the browser should resend data

◆ doUpdateVisitedHistory()

void doUpdateVisitedHistory ( WebView  view,
String  url,
boolean  isReload 
)

Notify the host application to update its visited links database.

Parameters
viewThe WebView that is initiating the callback.
urlThe URL being visited.
isReloadtrue if this URL is being reloaded.

◆ onReceivedBBHttpAuthRequest()

void onReceivedBBHttpAuthRequest ( WebView  view,
BBHttpAuthHandler  handler,
String  host,
String  realm 
)

Notifies the host application that the WebView received an HTTP authentication request. The host application can use the supplied BBHttpAuthHandler to set the WebView's response to the request. The default behavior is to cancel the request.

Parameters
viewThe WebView that is initiating the callback
handlerThe BBHttpAuthHandler used to make authentication decision
hostThe host requiring authentication
realmThe realm for which authentication is required

The following snippet shows the example of providing credentials to the authorization request:

webView.setWebViewClient(new BBWebViewClient () {
@Override
public void onReceivedBBHttpAuthRequest(WebView view, BBHttpAuthHandler handler, String host, String realm) {
if (host.equals("com.example")) {
// Provide the authorization credentials
handler.proceed("user_name", "user_password");
} else {
// Cancel the authorization request
handler.cancel();
}
}
});

◆ shouldOverrideKeyEvent()

boolean shouldOverrideKeyEvent ( WebView  view,
KeyEvent  event 
)

e.g. menu shortcut key events need to be filtered this way. If return true, WebView will not handle the key event. If return

false

, WebView will always handle the key event, so none of the super in the view chain will see the key event. The default behavior returns

false

.

Parameters
viewThe WebView that is initiating the callback.
eventThe key event.
Returns
true
if the host application wants to handle the key event itself, otherwise return
false

◆ onUnhandledKeyEvent()

void onUnhandledKeyEvent ( WebView  view,
KeyEvent  event 
)

Notify the host application that a key was not handled by the WebView. Except system keys, WebView always consumes the keys in the normal flow or if shouldOverrideKeyEvent returns true. This is called asynchronously from where the key is dispatched. It gives the host application a chance to handle the unhandled key events.

Parameters
viewThe WebView that is initiating the callback.
eventThe key event.

◆ onScaleChanged()

void onScaleChanged ( WebView  view,
float  oldScale,
float  newScale 
)

Notify the host application that the scale applied to the WebView has changed

Refer to the equivalent method onScaleChanged in the API Guide on the developer.android.com site.

◆ onReceivedLoginRequest()

void onReceivedLoginRequest ( WebView  view,
String  realm,
String  account,
String  args 
)

Notify the host application that a request to automatically log in the user has been processed.

Parameters
viewThe WebView requesting the login.
realmThe account realm used to look up accounts.
accountAn optional account. If not null, the account should be checked against accounts on the device. If it is a valid account, it should be used to log in the user.
argsAuthenticator specific arguments used to log in the user.

◆ onRenderProcessGone()

boolean onRenderProcessGone ( WebView  view,
RenderProcessGoneDetail  detail 
)

Notify host application that the given WebView's render process has exited.

Refer to the equivalent method onRenderProcessGone in the API Guide on the developer.android.com site.

◆ shouldOverrideUrlLoading()

boolean shouldOverrideUrlLoading ( WebView  view,
WebResourceRequest  request 
)

Give the host application a chance to take control when a URL is about to be loaded in the current WebView.

Refer to the equivalent method shouldOverrideUrlLoading in the API Guide on the developer.android.com site.

◆ onPageStarted()

void onPageStarted ( WebView  view,
String  url,
Bitmap  favicon 
)

Notify the host application that a page has started loading.

Refer to the equivalent method onPageStarted in the API Guide on the developer.android.com site.

◆ onPageFinished()

void onPageFinished ( WebView  view,
String  url 
)

Notify the host application that a page has finished loading.

Refer to the equivalent method onPageFinished in the API Guide on the developer.android.com site.

◆ onLoadResource()

void onLoadResource ( WebView  view,
String  url 
)

Notify the host application that the WebView will load the resource specified by the given URL.

Refer to the equivalent method onLoadResource in the API Guide on the developer.android.com site.

◆ onSafeBrowsingHit()

void onSafeBrowsingHit ( WebView  view,
WebResourceRequest  request,
int  threatType,
SafeBrowsingResponse  callback 
)

Notify the host application that a loading URL has been flagged by Safe Browsing.

Refer to the equivalent method onSafeBrowsingHit in the API Guide on the developer.android.com site.

◆ getObserver()

WebClientObserver getObserver ( )
Deprecated:
Will be removed in a future release. Please extend BBWebViewClient, BBWebView and BBWebChromeClient for needed methods (official Android WebView approach).

returns WebClientObserver

com.blackberry.bbwebview.BBWebViewClient.onReceivedBBHttpAuthRequest
void onReceivedBBHttpAuthRequest(WebView view, BBHttpAuthHandler handler, String host, String realm)
Notifies the host application that the WebView received an HTTP authentication request.
Definition: BBWebViewClient.java:228