Mobile/GeckoView: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
m (→‎Bugs: List P1 GeckoView bugs)
(→‎Bugs: List [geckoview:klar] and [geckoview:crow] bugs)
Line 45: Line 45:
== Bugs ==
== Bugs ==


* P1 GeckoView bugs:
* Bugs with '''[geckoview:klar]''' whiteboard tag:
<bugzilla>
<bugzilla>
{
{
   "component": "GeckoView",
   "status_whiteboard": "[geckoview:klar]",
  "priority": "P1",
  "f2": "status_whiteboard",
  "o2": "nowords",
  "v2": "[geckoview",
   "resolution": "---",
   "resolution": "---",
   "include_fields": "id, priority, component, summary, keywords, whiteboard, assigned_to",
   "include_fields": "id, priority, summary, keywords, whiteboard, assigned_to",
   "order": "priority"
   "order": "priority"
}
}
</bugzilla>
</bugzilla>


* Bugs with [geckoview] whiteboard tag:
* Bugs with '''[geckoview:crow]''' whiteboard tag:
<bugzilla>
<bugzilla>
{
{
   "status_whiteboard": "[geckoview",
   "status_whiteboard": "[geckoview:crow]",
   "resolution": "---",
   "resolution": "---",
   "include_fields": "id, priority, summary, keywords, whiteboard, assigned_to",
   "include_fields": "id, priority, summary, keywords, whiteboard, assigned_to",
Line 69: Line 65:
</bugzilla>
</bugzilla>


* Bugs blocking [https://bugzil.la/1322573 geckoview_mvp meta bug 1322573]:
* [https://bugzilla.mozilla.org/buglist.cgi?component=GeckoView&priority=P1&resolution=---&include_fields=id&include_fields=priority&include_fields=component&include_fields=summary&include_fields=keywords&include_fields=whiteboard&include_fields=assigned_to&order=priority P1 GeckoView bugs]
<bugzilla>
* [https://bugzilla.mozilla.org/showdependencytree.cgi?hide_resolved=1&id=1322573 Bugs blocking geckoview_mvp meta bug 1322573]
{
  "blocks": "1322573",
  "f2": "status_whiteboard",
  "o2": "nowords",
  "v2": "[geckoview",
  "resolution": "---",
  "include_fields": "id, priority, component, summary, keywords, whiteboard, assigned_to",
  "order": "priority"
}
</bugzilla>

Revision as of 23:13, 12 February 2018

What is GeckoView

GeckoView is an Android library project that allows third-party developers to use Gecko as an Android View in their own applications. GeckoView is similar to Android's built in WebView, but it is not a drop in replacement for WebView.

Note that GeckoView is NOT ready to be used in a production environment. It is currently possible to load webpages, but that's about it. See bug 1322573.

Using GeckoView

  1. Download a recent GeckoView AAR from treeherder (mozilla-central tree). The AAR is available from the 'Android API16+ Gradle opt' job under the 'Bng' symbol. After clicking that, there is a link to 'geckoview-0.0.1.aar' in the bottom pane.
  2. Add the GeckoView AAR to your Gradle / Android Studio project. In Android Studio you can add the .aar as follows:
    1. Move the geckoview aar to your project's 'app/libs' folder.
    2. Use the 'New Module' option under the 'File' menu.
    3. Import the .aar file.
    4. Add the new GeckoView AAR module as a dependency to the application.

You can now use GeckoView your app by including the following in a layout XML file:

<org.mozilla.gecko.GeckoView
  android:id="@+id/geckoview"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content" />

You can then load a page in your code with:

// Find the GeckoView in our layout
GeckoView geckoView = (GeckoView) findViewById(R.id.geckoview);

// Attach the GeckoView to a new GeckoSession
GeckoSession session = new GeckoSession();
geckoView.setSession(session);

// Load a URL
session.loadUri("http://mozilla.com");

Example App

Firefox Focus has a build variant that uses Gecko. To build, check out the Focus code from https://github.com/mozilla-mobile/focus-android and follow the instructions. The only difference is you need to select one of the Gecko build variants from the Android Studio 'Build' menu.

The Gecko-related code for Focus lives in WebViewProvider.java

Bugs

  • Bugs with [geckoview:klar] whiteboard tag:

No results.

0 Total; 0 Open (0%); 0 Resolved (0%); 0 Verified (0%);


  • Bugs with [geckoview:crow] whiteboard tag:

No results.

0 Total; 0 Open (0%); 0 Resolved (0%); 0 Verified (0%);