How to build a native library to support both chrome and android webview

575 views
Skip to first unread message

Jiadong Zhu

unread,
Sep 26, 2016, 6:48:06 AM9/26/16
to Chromium-dev
Hi

We are android manufacturer. We want to support both android webview and chrome on low-space device. To reduce the foot print, my plan is to build one native library combining libchrome.so and libwebviewchromium.so, Then, build webview.apk and chrome.apk with pure java code included.

I find there are lots of dependencies on these two libraries according to GN files. Is there any existing GN target I could use for this situation?


Thanks,
Jiadong

Torne (Richard Coles)

unread,
Sep 26, 2016, 8:12:42 AM9/26/16
to jiado...@linaro.org, Chromium-dev
For the Android N release, we already combined Chrome and WebView into "Monochrome", which is a single APK. There's no public build target for this yet, however.

Due to WebView's complex loading mechanism, it's difficult to do this in the way you describe (separate APKs), and it saves much more space to combine everything anyway, but the mechanisms in the framework to enable this to work are new in N and will not work on earlier Android releases.

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

Jiadong Zhu

unread,
Sep 27, 2016, 12:01:15 AM9/27/16
to Chromium-dev, jiado...@linaro.org
Thanks for the reply. we are working on Android N and we can modify some framework code related with the webview.

From chromium project. I find the monochrome in GN files, but I dont find any code using it . Is there any hint about how to use the libmonochrome.so?

Torne (Richard Coles)

unread,
Sep 27, 2016, 6:59:09 AM9/27/16
to jiado...@linaro.org, Chromium-dev
We haven't yet released a public version of the APK target for monochrome, so there's not really any documentation about this. I've asked the engineer who was looking at this to file a bug and link it here so you can track it. You can't use libmonochrome.so by itself; you need the corresponding build targets to assemble the java code and other assets into a working single APK.

Torne (Richard Coles)

unread,
Sep 28, 2016, 8:18:47 AM9/28/16
to jiado...@linaro.org, Chromium-dev
See https://crbug.com/650927 for the bug to track making this public.
Reply all
Reply to author
Forward
0 new messages