33

I have an app which makes pretty heavy use of webview. My requirements are to be able to look at the html and to inject javascript into pages being loaded, even iframes. I've accomplished this with the webview that comes with android but it just isn't working great.

So are there other projects out there that provide the same html5 browsing experience but are a bit more developer friendly? Would it maybe be possible to take the open source web view code and build my own or is that just a crazy idea?

Thanks.

casolorz
  • 8,486
  • 19
  • 93
  • 200
  • @DerGolem zirco-browser seems to be derived from WebView. How is it the alternative to WebView that mntgoat desires? – WebViewer Mar 17 '15 at 01:05

4 Answers4

8

Take a look at Crosswalk. As described in its web site:

With the platform variations in the market you are forced to assume that every Android WebView works differently. There are differences in:

  • Which JavaScript APIs are available
  • Support and syntax for CSS properties
  • How your application's interface is rendered …and plenty

more. You want to support as many versions of Android as possible, but it’s frustrating and time consuming.

There’s a better way. What if the only WebView you had to worry about was up to date with the latest version of Google Chromium? With Crosswalk, you can:

  • Develop around device fragmentation
  • Provide a feature rich experience on all Android 4.x devices
  • Easily debug with Chrome DevTools Improve the performance of your HTML, CSS, and JavaScript
Community
  • 1
  • 1
Ali Behzadian Nejad
  • 8,804
  • 8
  • 56
  • 106
  • I agree that XwalkView is incredibly awesome with HTML5 and avoiding ridiculous WebView fragmentation across Android devices. However, it isn't without its problems... 1) offscreen rendering is non-existant 2) download of external resources (images) is single-threaded – Someone Somewhere Apr 23 '15 at 17:05
  • 4
    Hello, I really find Crosswalk webview such a pain in the arse just to set it up. I wanted to Embed XWalkView so I could use it on my project. It took me one month experimenting on various WebViews for – Neon Warge Jan 18 '16 at 15:08
  • I agree with Neon Warge. I manage to embed Crosswalk but when app goes background it loses it state. Restore state function doesn't work. – Olcay Ertaş Sep 26 '16 at 15:05
  • 13
    Note that Crosswalk is not maintained since Jan 2017 – Pavel Kuznetsov Dec 15 '17 at 09:56
8

I had a similar need to get an alternative to WebView.

Found GeckoView based on GeckoEngine by Mozilla.

Pros:

  • GeckoView is designed to expose the entire power of the Web to applications, and all that through a straightforward API.
  • Better Performance over WebView. Far Better with performance for Graphis Intensive WebApps.
  • Strong Mozilla Community behind the development.
  • Capable to let you make your own Web Browser for Android.

Cons:

  • Your App Size will get an additional 50MB or something, as the GeckoView comes loaded with GeckoEngine native to your app.

  • Fewer Examples and Tutorials on YT or Web.

Following Docs will help you get started.

Official Doc:

https://mozilla.github.io/geckoview/

101 Guide Blog :

https://www.raywenderlich.com/1381698-android-tutorial-for-geckoview-getting-started

Community Chat Forum: Ask your Questions and Join GeckoView Community.

https://chat.mozilla.org/#/room/#geckoview:mozilla.org

Rahul Shyokand
  • 1,255
  • 10
  • 17
0

In android 4.4, a new webview is introduced based off of chromium. However if you are developing for previous versions of android as well you can check out this library that is also based off of chromium https://github.com/mogoweb/chromium_webview with chromium, your webview will support HTML5, CSS3 and javascript

Sam Panagrosso
  • 163
  • 1
  • 9
  • Thanks for the reply, I'll take a look at that github project. In reality one of my biggest problems is the switch to chromium google made, there is one big issue with it relating to getting cookies during the intercept of a request which is heart of my app. – casolorz Mar 17 '14 at 17:07
  • 1
    I looked at that project. It says, do not use for product. I think this may be the issue, though, because I'm running my app on my phone and my friend's phone. I have a GS3 which is Android 4.3. He has a GS4 and doesn't see the issues that I do. – Gdalya Jun 15 '14 at 10:55
  • How is this experimental (!) chromium_webview better than the official [WebView for Android](https://developer.chrome.com/multidevice/webview/overview) that is also based on Chromium? – WebViewer Mar 17 '15 at 01:14
  • Looks like the project is dead. Last commit was a year old :/ – Neon Warge Jan 17 '16 at 09:32
  • Last commit was 2015.. worse than Crosswalk though. – c-an Oct 22 '21 at 12:25
-1

You can also use Chrome Custom Tabs as a best option for handling third party Website on same app. And off course it is feature loaded. Like sharing chrome cookies, data saving option as with chrome

samridhgupta
  • 1,695
  • 1
  • 18
  • 34
  • 4
    As far as I know you can not look at the html and/or inject javascript with Chrome Custom Tabs which is a main requirement I have listed on this post. – casolorz Jan 15 '16 at 14:32