Mobile/GeckoView: Difference between revisions

Jump to navigation Jump to search
→‎Documentation and Examples: GeckoView Lite now requires Android 5.0 (API 21) or later.
m (Fix section indentation)
(→‎Documentation and Examples: GeckoView Lite now requires Android 5.0 (API 21) or later.)
 
(15 intermediate revisions by 8 users not shown)
Line 1: Line 1:
'''GeckoView is [https://www.mozilla.org/firefox/ Firefox Quantum's] engine, packaged as a reusable Android library.'''
'''GeckoView''' wraps Mozilla's [https://wikipedia.org/wiki/Gecko_(software) Gecko browser engine] in a reusable Android library for applications that wish to use Mozilla’s JavaScript, HTML layout, and rendering engines (generally referred to as SpiderMonkey and Gecko).


Mozilla uses GeckoView to power [https://blog.mozilla.org/blog/2018/09/18/firefox-reality-now-available/ Firefox Reality], [https://www.mozilla.org/firefox/mobile/#focus Firefox Focus], and more.
Mozilla uses GeckoView to power [https://www.mozilla.org/en-US/firefox/browsers/mobile/android/ Firefox for Android], [https://blog.mozilla.org/blog/2018/09/18/firefox-reality-now-available/ Firefox Reality], [https://www.mozilla.org/firefox/mobile/#focus Firefox Focus], and other Android apps. GeckoView serves a similar purpose to Android's built-in WebView, but it has its own APIs and is ''not'' a drop in replacement.
 
GeckoView serves a similar purpose to Android's built-in WebView, but it has its own APIs and is ''not'' a drop in replacement.


== Why GeckoView? ==
== Why GeckoView? ==
Line 14: Line 12:
* '''Self-Contained''': Because GeckoView is a standalone library that you bundle with your application, you can be confident that the code you test is the code that will actually run.
* '''Self-Contained''': Because GeckoView is a standalone library that you bundle with your application, you can be confident that the code you test is the code that will actually run.
* '''Standards Compliant''': Like Firefox, GeckoView offers excellent support for modern Web standards.
* '''Standards Compliant''': Like Firefox, GeckoView offers excellent support for modern Web standards.
== About GeckoView ==
Mozilla provides a GeckoView package and a [https://maven.mozilla.org/?prefix=maven2/org/mozilla/geckoview/ Maven Repo] along with [https://mozilla.github.io/geckoview/javadoc/mozilla-central/org/mozilla/geckoview/package-summary.html package documentation]. GeckoView has Stable, Beta, and Nightly channels that follow the [https://wiki.mozilla.org/Release_Management/Calendar Firefox browser’s Release Calendar] which typically ships a new major version to the Stable channel every 4 weeks and the maven repository is updated accordingly.
When a new version is released to the Stable channel, any relevant security fixes will be published to the [https://www.mozilla.org/en-US/security/advisories/ Mozilla Security Advisories page]. While GeckoView is not explicitly called out in the advisories, most but not strictly all vulnerabilities will affect GeckoView. Exceptions would be vulnerabilities that occur in user-facing components excluded from GeckoView (such as the address bar) or desktop-platform-specific vulnerabilities. Keeping the GeckoView dependency up-to-date is the most effective way to incorporate security fixes.


== Getting Help ==
== Getting Help ==
Line 19: Line 23:
Interested in GeckoView? We're here to help!
Interested in GeckoView? We're here to help!


If you have questions or need assistance, please reach out by:
If you have questions or need assistance, please reach out to us in the [https://chat.mozilla.org/#/room/#geckoview:mozilla.org #geckoview] Matrix room.


* Talking to us in the [ircs://irc.mozilla.org:6697/#mobile #mobile] IRC channel on [[Irc|Mozilla's IRC server "irc.mozilla.org"]]
The overall Mozilla security team can be reached at security@mozilla.org. If you ship GeckoView in your application you are encouraged to let us know at that address.
* Sending questions to the [https://mail.mozilla.org/listinfo/mobile-firefox-dev mobile-firefox-dev] mailing list


== Get Started ==
== Get Started ==
Line 29: Line 32:


=== Configure Gradle ===
=== Configure Gradle ===
You need to add or edit four stanzas inside your module's <code>build.gradle</code> file.


'''1. Set the GeckoView version'''
'''1. Set the GeckoView version'''
Line 38: Line 39:
ext {
ext {
     geckoviewChannel = "nightly"
     geckoviewChannel = "nightly"
     geckoviewVersion = "64.0.20180927100037"
     geckoviewVersion = "70.0.20190712095934"
}
}
</syntaxhighlight>
</syntaxhighlight>
Line 51: Line 52:
</syntaxhighlight>
</syntaxhighlight>


'''3. Configure build flavors'''
'''3. Configure Java 8 support'''
 
''Note: Until we resolve [https://bugzilla.mozilla.org/show_bug.cgi?id=1485045 Bug 1485045], you must configure a separate build variant for each CPU architecture.''


<syntaxhighlight lang="Groovy">
<syntaxhighlight lang="Groovy">
Line 63: Line 62:
         sourceCompatibility JavaVersion.VERSION_1_8
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8
    }
    flavorDimensions "abi"
    productFlavors {
        x86    { dimension "abi" }
        x86_64  { dimension "abi" }
        arm    { dimension "abi" }
        aarch64 { dimension "abi" }
     }
     }
}
}
Line 80: Line 70:
dependencies {
dependencies {
     // ...
     // ...
 
     implementation "org.mozilla.geckoview:geckoview-${geckoviewChannel}:${geckoviewVersion}"  
     x86Implementation    "org.mozilla.geckoview:geckoview-${geckoviewChannel}-x86:${geckoviewVersion}"
    x86_64Implementation  "org.mozilla.geckoview:geckoview-${geckoviewChannel}-x86_64:${geckoviewVersion}"
    armImplementation    "org.mozilla.geckoview:geckoview-${geckoviewChannel}-armeabi-v7a:${geckoviewVersion}"
    aarch64Implementation "org.mozilla.geckoview:geckoview-${geckoviewChannel}-arm64-v8a:${geckoviewVersion}"
}
}
</syntaxhighlight>
</syntaxhighlight>
Line 127: Line 113:


'''APIs'''
'''APIs'''
* [https://mozilla.github.io/geckoview/javadoc/mozilla-central/ JavaDoc API Documentation]
* [https://mozilla.github.io/geckoview/javadoc/mozilla-central/ GeckoView API Documentation] (JavaDoc format)
* [https://mozilla-mobile.github.io/android-components/reference/ Android Components APIs]
* [https://mozilla-mobile.github.io/android-components/reference/ Android Components APIs]


'''Building / Contributing'''
'''Building / Contributing'''


* [https://mozilla.github.io/geckoview/tutorials/geckoview-quick-start.html GeckoView Contributor Quick Start Guide].
* [https://mozilla.github.io/geckoview/contributor/geckoview-quick-start GeckoView Contributor Quick Start Guide].
* [[Mobile/Get_Involved]]
* [[Mobile/Get_Involved]]
* [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Introduction Mozilla Developer Guide]
* [https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Introduction Mozilla Developer Guide]
Line 138: Line 124:
'''Bugs'''
'''Bugs'''


* [https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox%20for%20Android&component=GeckoView File a new GeckoView bug]
* [https://bugzilla.mozilla.org/enter_bug.cgi?product=GeckoView&component=General File a new GeckoView bug]
* [https://bugzilla.mozilla.org/buglist.cgi?product=GeckoView&component=General&resolution=---&list_id=14532935 All GeckoView Bugs]
* [https://bugzilla.mozilla.org/buglist.cgi?product=GeckoView&component=General&resolution=---&list_id=14532935 All GeckoView Bugs]
* [[Mobile/GeckoView/Bugs|GeckoView Bug Dashboard]] 🐛
* [[Mobile/GeckoView/Bugs|GeckoView Bug Dashboard]] 🐛


'''Products / Examples'''
'''Products / Examples'''
* [https://blog.mozilla.org/futurereleases/2019/06/27/reinventing-firefox-for-android-a-preview/ Firefox Preview] ([https://github.com/mozilla-mobile/fenix GitHub])
* [https://blog.mozilla.org/blog/2018/09/18/firefox-reality-now-available/ Firefox Reality] ([https://github.com/mozillareality/firefoxreality GitHub])
* [https://blog.mozilla.org/blog/2018/09/18/firefox-reality-now-available/ Firefox Reality] ([https://github.com/mozillareality/firefoxreality GitHub])
* [https://www.mozilla.org/firefox/mobile/#focus Firefox Focus] ([https://github.com/mozilla-mobile/focus-android/ GitHub])
* [https://www.mozilla.org/firefox/mobile/#focus Firefox Focus] ([https://github.com/mozilla-mobile/focus-android/ GitHub])
Line 149: Line 136:
'''Minimum System Requirements'''
'''Minimum System Requirements'''


* Android OS version 4.3 (Jelly Bean, API Level 18) or later. (For comparison, Firefox for Android supports 4.1 and later and Firefox Focus supports 5.0 and later.)
* GeckoView, Fenix, and Focus all require Android 5.0 (API 21) or later.
* 32-bit ARMv7-A, 64-bit ARMv8-A (aka ARM64), 32-bit x86, or x86_64 CPU
* 32-bit ARMv7-A, 64-bit ARMv8-A (aka ARM64), 32-bit x86, or x86_64 CPU
* Mozilla tests GeckoView on a [https://en.wikipedia.org/wiki/Moto_G5 Moto G5] with a 1.4 GHz CPU and 2 GB RAM, but GeckoView can run on lower hardware specs.
* Minimum device specs are quad-core 1.2 GHz and 2 GB RAM (like the [https://www.gsmarena.com/compare.php3?&idPhone3=8104&idPhone2=8721&idPhone1=9008 Moto G4 Play, E4, or E5]), though Mozilla's GeckoView test devices are the [https://en.wikipedia.org/wiki/Moto_G5 Moto G5] with an octa-core 1.4 GHz CPU and 2 GB RAM and the [https://en.wikipedia.org/wiki/Pixel_2 Google Pixel 2] with an octa-core 1.9 GHz CPU and 4 GB RAM.
Confirmed users
3,339

edits

Navigation menu