Mobile/GeckoView: Difference between revisions

Line 7: Line 7:
== Using GeckoView ==
== Using GeckoView ==


# Download and unzip geckoview_library.zip and geckoview_assets.zip from [http://ftp.mozilla.org/pub/mobile/nightly/latest-mozilla-central-android-api-15/ here].
# Download a recent GeckoView AAR from treeherder (mozilla-central tree). The AAR is available from the 'Android API15+ Gradle opt' job under the 'Bg' symbol. After clicking that, there is a link to 'geckoview-0.0.1.aar' in the bottom pane.
# Open Eclipse and import the GeckoView library project by doing File > Import.
# Add the GeckoView AAR to your Gradle / Android Studio project. In Android Studio you can add the .aar as follows:
# Set the imported GeckoView library project as a dependency in your app by adding it in the Android section of your project's properties as seen in the screenshot below. [[File:Geckoview settings.png|800px]]
## Move the geckoview aar to your project's 'libs' folder.
# Copy the assets folder from the geckoview_assets.zip to your app's assets folder.
## Use the 'New Module' option under the 'File' menu.
# Add "manifestmerger.enabled=true" to your project's project.properties file.
## Import the .aar file.
 
Your directory structure should look like the following:
 
[[File:Geckoview project structure.png|250px]]


You can now use GeckoView your app by including the following in a layout XML file:
You can now use GeckoView your app by including the following in a layout XML file:
Line 30: Line 26:
<pre>
<pre>
GeckoView geckoView = (GeckoView) findViewById(R.id.geckoview);
GeckoView geckoView = (GeckoView) findViewById(R.id.geckoview);
geckoView.add("http://mozilla.com");
geckoView.loadUri("http://mozilla.com");
</pre>
</pre>


Confirmed users
414

edits