[Android] Use the Chromium web view to replace the default android webview (<4.4)

13,981 views
Skip to first unread message

Erwan Pinault

unread,
Feb 17, 2014, 9:24:09 AM2/17/14
to chromi...@chromium.org
Hi,

I have a specific tablet running on android 4.0.3 which only display a browser (it's like chrome OS but on Android)  and due to hardware restriction I cannot update my device to the 4.4 version. The native (old) android web view has crappy performance and because all our applications are web apps I want to use the new android web view based on chromium engine to have a better reactivity and efficiency for our web apps.  
I did successfully embed the chrome engine in my application 3 month ago by using this project  https://github.com/examplecode/chromium_android_webview and everything work's quite fine, but because this project was based on august sources, I had a lot of seg fault, I wasn't able to display the keyboard on HTML form, I couldn't use hardware acceleration and preload the web pages, which was quite annoying. So I decide last week to use the last android chromium sources to fix my problems.

I followed the google instruction here to get and compile the chromium sources for android

I used this project : https://github.com/mlasak/android-content-view to retrieve the libraries (so, jar, java sources dependencies) and integrate those files in my project. 
I was able to compile and run properly the content_shell_apk. But the java sources changed a lot and I had to work on the top of the ShellManager to manage the integration of the new sources.
I don't know if I don't use the source well or if this is a new feature but each time I am displaying a web view a sub process is created and a new application instance is creating. 

My 2 questions are :
- do you know a project maybe easier than those to use the chromium web view as we used the old android webview
- Could I avoid the creation of many application instance even if I use the ShellManager

Thank's for your replies.


Ron Waldon

unread,
Feb 17, 2014, 8:22:45 PM2/17/14
to chromi...@chromium.org
I'm interested in the replies to this question as well.

Note: the upstream Chromium developers have expressed no interest in solving problems with old Android https://code.google.com/p/chromium/issues/detail?id=234907 and we could certainly agree that it is out of scope for them.

Alexandre Elias

unread,
Feb 17, 2014, 10:29:21 PM2/17/14
to erwan....@gmail.com, Chromium-dev
The WebView code in android_webview/ directory of Chromium is designed to be used in conjunction with some private Android features that aren't exposed to normal APK apps.  That's why we only support it as part of KitKat distribution.  That implementation is designed to support the full set of Java APIs described in http://developer.android.com/reference/android/webkit/WebView.html .  But if you don't use those and your application is pure HTML/Javascript, then using a variant of Chromium content shell is a reasonable option and should work on ICS.  I think the recently announced Cordova workflow uses Chromium content shell in some form (http://blog.chromium.org/2014/01/run-chrome-apps-on-mobile-using-apache.html ), if you want to avoid rolling your own.


On Mon, Feb 17, 2014 at 6:24 AM, Erwan Pinault <erwan....@gmail.com> wrote:
- Could I avoid the creation of many application instance even if I use the ShellManager

That is Chromium multi-process support in action.  If you don't care about the security benefits of multiprocess (maybe because you run all private HTML), you can try setting the --single-process flag.
 

Thank's for your replies.


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

Erwan Pinault

unread,
Feb 18, 2014, 4:11:07 AM2/18/14
to Alexandre Elias, Chromium-dev
Thank's a lot for your replies. I am gonna check the cordova project as well, did this project allow to use  chrome client even on a older version than kitkat?. @Alexandre : you said android_webview must be used in conjunction with other features, my application is a system app could I use those features or is it licence restriction ? Do you know if not having the virtual keyboard (my main problem) when I used the android_webview is normal ? I red on the first link you gave me than : "if your goal is only to display some HTML as a part of your UI, this is probably fine; the user won't need to interact with the web page beyond reading it, and the web page won't need to interact with the user", does it gave me answer about the keyboard missing problem ?
And do you know a way (without using the content_shell project, which are too different to be easy to integrate) to display the keyboard  on Android Forms ?


Thank's in advance for your help.

Erwan Pinault

unread,
Feb 18, 2014, 4:29:07 AM2/18/14
to Alexandre Elias, Chromium-dev
Sorry I did a mistake, I wan to say at the end :
And do you know a way (without using the content_shell project, which are too different to be easy to integrate) to display the keyboard  on HTML Forms on the android_webview ?

Martin Kosiba

unread,
Feb 18, 2014, 5:22:30 AM2/18/14
to erwan....@gmail.com, Alexandre Elias, Chromium-dev
On Tue, Feb 18, 2014 at 9:11 AM, Erwan Pinault <erwan....@gmail.com> wrote:
Thank's a lot for your replies. I am gonna check the cordova project as well, did this project allow to use  chrome client even on a older version than kitkat?. @Alexandre : you said android_webview must be used in conjunction with other features, my application is a system app could I use those features or is it licence restriction ? Do you know if not having the virtual keyboard

It's not a license restriction, it's simply won't work for technical reasons. See https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/Z2_a_fFm19M
 
(my main problem) when I used the android_webview is normal ? I red on the first link you gave me than : "if your goal is only to display some HTML as a part of your UI, this is probably fine; the user won't need to interact with the web page beyond reading it, and the web page won't need to interact with the user", does it gave me answer about the keyboard missing problem ?
And do you know a way (without using the content_shell project, which are too different to be easy to integrate) to display the keyboard  on Android Forms ?

The keyboard should work in the android_webview_shell_apk. Did you try loading the same HTML in the android_webview_shell_apk? If it doesn't work there then that's a bug.

Erwan Pinault

unread,
Feb 18, 2014, 5:55:43 AM2/18/14
to Martin Kosiba, Alexandre Elias, Chromium-dev
I try to load the google.com url and when I clicked on the search form I don't have any keyboard showing. I tried on my tablet (4.0.3) and on two phones 4.1.2

Martin Kosiba

unread,
Feb 18, 2014, 7:40:48 AM2/18/14
to Erwan Pinault, Alexandre Elias, Chromium-dev

Erwan Pinault

unread,
Feb 18, 2014, 8:00:22 AM2/18/14
to Martin Kosiba, Alexandre Elias, Chromium-dev
Thank's to open this issue

Erwan Pinault

unread,
Feb 20, 2014, 10:16:27 AM2/20/14
to Martin Kosiba, Alexandre Elias, Chromium-dev
To you think it is possible to integrate the Shell class from the Content Shell project directly in the ContentShellActivity without using the ShellManager class. Because when I use the content shell (I am just using one shell in fullscreen) it takes times (5s) before the web view is created.
Reply all
Reply to author
Forward
0 new messages