Alternatives for not using Webview

Asked

Viewed 988 times

3

There are alternatives other than webview android to use? I’m having a problem that from what it seems, a lot of people have that is to run videos on the tag video of Html5.

Many people say that the solution is simply to use the webchromeclient and the magic would happen without any effort, well, it doesn’t work. Apparently, in version 4.4+ android this component would become native and at the bottom we have to arrow it this way: webView.setWebChromeClient(new WebChromeClient());

I did several tests and the result has been very frustrating. Despite the time that Html5 is already in our midst, many mobile browsers cannot implement much of the features, or at least implement them well. What best ran the video functionality was Mozilla firefox. Having this in mind, I researched how he did this and saw that he used another webview for android, which is the geckoview.

Has anyone ever been able to use this geckoview? How did?

1 answer

3

crosswalk

In accordance with this answer there is a project called crosswalk (requires Android 4.0+)

To install: https://crosswalk-project.org/documentation/android.html

Support:

Webrtc, Webgl, Vibration API, Presentation API and Webview updates

The difference is that it uses Webapps, see how to create an application (which I think would already be your case):

https://crosswalk-project.org/documentation/android/build_an_application.html

Geckoview

To use Geckoview do the following:

  • Download the geckoview_library.zip and geckoview_assets.zip at the address https://ftp.mozilla.org/pub/mobile/releases/

  • Extract the content

  • Open Eclipse (if using Eclipse) and go to File > Import and the Geckoview lib project.

  • Define Geckoview in your project as dependency, just like this in the image:

    Library

  • Copy the folder asset of geckoview_assets.zip to the folder asset of your app.

  • Add manifestmerger.enabled=true in your project archive project.properties, the folder structure should look something like:

    inserir a descrição da imagem aqui

  • Go to your file layout and add the following:

    <org.mozilla.gecko.GeckoView
    android:id="@+id/geckoview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />
    
  • And within the mainActivity add:

    GeckoView geckoView = (GeckoView) findViewById(R.id.geckoview);
    geckoView.add("http://answall.com");
    

If you want a pre-ready example:

Browser other questions tagged

You are not signed in. Login or sign up in order to post.