fune/mobile/android/android-components/components/browser/engine-system
Sebastian Kaspari 9afa3a75f7 [components] Revert Gradle, Android Gradle Plugin and Kotlin upgrade. (PR https://github.com/mozilla-mobile/android-components/pull/8360)
Revert "Address even more lint errors."

This reverts commit e98ee991b34d318e671c644d63daec53902e68ff.

Revert "Update to Gradle 6.6.1."

This reverts commit cdda701c8f2be6c0486ddf1494885accf78aab00.

Revert "Address lint errors."

This reverts commit 26cb5b27bc2be672c89e7e0c63eeeda9f64c0d08.

Revert "Move JNA configuration to root project."

This reverts commit 694ef37cc30e727f3ec5d275c0e9583385980a43.

Revert "Issue https://github.com/mozilla-mobile/android-components/issues/8319: Update to Kotlin 1.4, Coroutines 1.3.9 and Android lint 27.0.1."

This reverts commit ad675c35e794050dbf8514a2d2fe7506ce0c546c.

Revert "Update Glean to 33.0.4."

This reverts commit 4731c4e2fa52d40f4062a47f02078ca0c85de632.

Revert "Update Glean to 33.0.0."

This reverts commit 352cf88a4d4bad64330d0ec997814fd8b13928c2.

Revert "Update Gradle to 6.1.1."

This reverts commit 18e88aa1a2528b10f7d81ff9dbf1df094071b6ce.

Revert "Update Android Gradle Plugin to 4.0.1."

This reverts commit f915a3b47b0f5584889ff62a80c9642bccfa36ce.
2020-10-06 14:57:11 +02:00
..
src [components] Revert Gradle, Android Gradle Plugin and Kotlin upgrade. (PR https://github.com/mozilla-mobile/android-components/pull/8360) 2020-10-06 14:57:11 +02:00
build.gradle [components] Replace String.toUri with Android KTX 2019-07-08 14:25:18 -04:00
proguard-rules.pro [components] Issue https://github.com/mozilla-mobile/android-components/issues/49: New module engine-system: Engine implementation based on the system's WebView. 2018-04-13 17:28:57 +02:00
README.md [components] Update repository information in README files. 2018-10-25 15:37:46 +02:00

Android Components > Browser > Engine-System

Engine implementation based on the system's WebView.

Usage

See concept-engine for a documentation of the abstract engine API this component implements.

Setting up the dependency

Use Gradle to download the library from maven.mozilla.org (Setup repository):

implementation "org.mozilla.components:browser-engine-system:{latest-version}"

Initializing

It is recommended t create only one SystemEngine instance per app.

// Create default settings (optional) and enable tracking protection for all future sessions.
val defaultSettings = DefaultSettings().apply {
    trackingProtectionPolicy = EngineSession.TrackingProtectionPolicy.all()
}

// Create an engine instance to be used by other components.
val engine = SystemEngine(defaultSettings)

Integration

Usually it is not needed to interact with the Engine component directly. The browser-session component will take care of making the state accessible and link a Session to an EngineSession internally. The feature-session component will provide "use cases" to perform actions like loading URLs and takes care of rendering the selected Session on an EngineView.

View

SystemEngineView is the Gecko-based implementation of EngineView in order to render web content.

<mozilla.components.browser.engine.system.SystemEngineView
    android:id="@+id/engineView"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

SystemEngineView can render any SystemEngineSession using the render() method.

val engineSession = engine.createSession()
val engineView = view.findViewById<SystemEngineView>(R.id.engineView)
engineView.render(engineSession)

License

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/