java.lang.Object | |
↳ | com.amazon.android.webkit.AmazonWebKitFactories |
Selects which AmazonWebKitFactory implementation to use.
The currently supported factory implementations are:
EMBEDDED_FACTORY
ANDROID_FACTORY
The factory implementation to use at runtime is selected in the following order:
setDefaultFactory(String)
method.EMBEDDED_FACTORY
ANDROID_FACTORY
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ANDROID_FACTORY | Specifies that the Android WebKit implementation is used as the backing implementation of the web view. | |||||||||
String | EMBEDDED_FACTORY | Specifies that the Chromium-based implementation is used as the backing implementation of the web view. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Retrieves an object containing the default factory implementation.
| |||||||||||
Get the maximum API level support provided by the default factory.
| |||||||||||
Set the factory implementation to use by default.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Specifies that the Android WebKit implementation is used as the backing implementation of the web view.
Specifies that the Chromium-based implementation is used as the backing implementation of the web view.
Retrieves an object containing the default factory implementation.
An EMBEDDED_FACTORY will only be returned when the method is called on third-generation Kindle Fire tablets. ANDROID_FACTORY is only available if the awv_android_factory.jar is included with the compiled application.
If your application calls the method on an Android device, and you have not included the awv_android_factory.jar, getDefaultFactory() throws a RuntimeException.
Get the maximum API level support provided by the default factory.
This method can be invoked before the factory object is created.
If you find that the max API Level is lower than the API Level that your application
is targeted for, you have one of two choices:
1. Conditionally invoke newer APIs based the API Level available on the device. See documentation
getApiLevel()
for a sample code on how to accomplish this.
2. Exit your application. See code snippet below.
The following sample code gets the available API Level and quits if it doesn't
find the API Level that the application is compiled for.
if (AmazonWebKitFactories.getDefaultFactoryMaxApiLevelSupported() < AmazonApiLevels.AWV_LEVEL_MAX) {
// Let the user know that you can't run
// Quit the app
RuntimeException | if API level couldn't be determined. |
---|
Set the factory implementation to use by default. To set the default factory, this method
must be called before the first call to the getDefaultFactory()
method. Once the getDefaultFactory()
is called, subsequent calls to the setDefaultFactory(String) method result in an IllegalStateException
being thrown.
factory | Fully qualified class name for the factory. For example, com.amazon.android.webkit.android.AndroidWebKitFactory |
---|
java.lang.IllegalStateException | |
IllegalStateException |