You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-11Lines changed: 26 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ This project was inspired by [pwnall's chromeview](https://github.com/pwnall/chr
26
26
27
27
## Why
28
28
29
-
* Android WebView does not have the same performance characteristics as Chromium (the latter is faster)
29
+
* Android WebView (pre-KitKat) does not have the same performance characteristics as Chromium (the latter is faster)
30
30
* Android WebView lacks feature parity with Chromium. The Chromium team moves fast, it is usually one of the first browsers to receive new W3C features, etc.
31
31
* Android WebView is embedded and tied to the platform -- updating it therefore becomes problematic since you have to update the whole platform to update the browser
32
32
@@ -39,7 +39,16 @@ This project was inspired by [pwnall's chromeview](https://github.com/pwnall/chr
39
39
## What Is The Difference Between This & ChromeView
40
40
The [chromeview](https://github.com/pwnall/chromeview) project was an awesome start to solving this problem, and I started there, but henceforth, the author has stated that he lacks the time to dedicate to it. So, I originally [forked](http://github.com/davisford/chromeview) it, and updated Chromium to a newer build. Then I looked into the [scrolling issues](https://github.com/pwnall/chromeview/pull/6) and after some digging, decided that there was a separate build artifact (`Content Shell`) out of Chromium that would provide a better base than the one chromeview was currently using. The code was different enough that I felt it just warranted a separate repo -- so that's what you have here. Scrolling does work great here. There are some quirks, so check the [issues](https://github.com/davisford/android-chromium/issues?state=open) to figure out what isn't quite working (yet).
41
41
42
-
Later, I realized that the Chromium TestShell was another build artifact that includes everying in Content Shell, and also includes various Google Chrome features like sync, autofill, infobar, tabs, cache invalidation, etc. So, I decided to add a target for Chromium Test Shell and allow you to choose to build one or both, at your convenience. I also re-factored the whole thing to use Gradle with the [Android Gradle plugin](http://tools.android.com/tech-docs/new-build-system/user-guide). It works happily with [Android Studio](https://developer.android.com/sdk/installing/studio.html).
42
+
Later, I realized that the Chromium TestShell was another build artifact that includes everying in Content Shell, and also includes various Google Chrome features like sync, autofill, infobar, tabs, cache invalidation, etc. So, I decided to add a target for Chromium Test Shell and allow you to choose to build one or both, at your convenience.
43
+
44
+
Finally, after Google announced support from Chromium in Android WebView, it seems like the `AndroidWebView` apk target out of the Chromium source tree was ready to use, so I added that as well.
45
+
46
+
You can choose to build and install one or all of the following apk targets and use any of the as the base of your project:
47
+
* Chromium `content-shell` - the core browser underpinnings with a very simple Android UI that you can tune
48
+
* Chromium `testshell` - everything in `content-shell` but includes some Chrome features like sync, autofill, tab support (but you have to build your own UI for tabs currently), and a few other features
49
+
* Chromium `android-webview` - implements the [WebView](xhttps://developer.android.com/reference/android/webkit/WebView.html) API with Chromium underneath.
50
+
51
+
I also re-factored the whole thing to use Gradle with the [Android Gradle plugin](http://tools.android.com/tech-docs/new-build-system/user-guide). It works happily with [Android Studio](https://developer.android.com/sdk/installing/studio.html).
Run `gradlew build` (Mac / Linux) or `gradlew.bat build` (Windows)
73
+
Use the [gradle wrapper](http://www.gradle.org/docs/current/userguide/gradle_wrapper.html). Run `gradlew build` (Mac / Linux) or `gradlew.bat build` (Windows) -- either command will build *everything* in the whole project space. Alternatively, you can [install gradle yourself, if you'd prefer to not use the wrapper](http://www.gradle.org/installation) (it is painless).
65
74
66
-
Artifacts are found under `${projectDir}/build/apk`. Note that only `content-shell`and `testshell` will build an apk. The rest are defined as library projects.
75
+
Artifacts are found under `${projectDir}/build/apk`. Note that only `content-shell`, `testshell`and `android-webview` will build an apk. The rest are defined as library projects.
67
76
68
77
You can also use Gradle to build and install the app with adb. Connect a device or emulator and run:
69
78
70
79
For Content Shell:
71
80
72
81
```sh
73
-
$ ./gradlew installDebug chromium:content-shell
82
+
$ cdchromium/content-shell&& gradle installDebug
74
83
```
75
84
76
85
For Test Shell:
77
86
78
87
```sh
79
-
$ ./gradlew installDebug chromium:testshell
88
+
$ cd chromium/testshell && gradle installDebug
89
+
```
90
+
91
+
For Android WebView:
92
+
93
+
```sh
94
+
$ cd chromium/android-webview && gradle installDebug
80
95
```
81
96
82
-
Both apps provide a very basic stock browser shell with only an address bar and a back/forward button, but take solace in the fact that the underpinnings are full Chromium. You can use this as a baseline to build a new browser, or an app that uses the browser, or something more interesting.
97
+
Each apk provides a very basic stock browser shell with only an address bar and maybe a back/forward button, but take solace in the fact that the underpinnings are full Chromium. You can use this as a baseline to build a new browser, or an app that uses the browser, or something more interesting.
83
98
84
99
I have checked in the Intellij `.iml` files, so you can just import the project directly into Android Studio.
85
100
86
101
## Artifacts: Assets & Libraries
87
-
The main Chromium artifact is a native shared library `.so`. It also depends on a number of `.pak` files in the `/assets` folder (you'll find these in the `content-shell`and `testshell` apps). As built, these need to be included in your `/libs` and `/assets` folder of your project, and they *will* add a good 30-40MB of binary goodness to the size of your app. However, if you're savvy, you could figure out a way to load those from a central location on the platform, so they don't have to be included in `.apk` file. This will require code modifications.
102
+
The main Chromium artifact is a native shared library `.so`. It also depends on a number of `.pak` files in the `/assets` folder (you'll find these in the `content-shell`, `testshell`and `android-webview` apps). As built, these need to be included in your `/libs` and `/assets` folder of your project, and they *will* add a good 30-40MB of binary goodness to the size of your app. However, if you're savvy, you could figure out a way to load those from a central location on the platform, so they don't have to be included in `.apk` file. This will require code modifications.
88
103
89
104
This project contains a snapshot in time binary build of Chromium for Android -- the specific version that was built is captured in the [VERSION file](https://github.com/davisford/android-chromium/blob/master/chromium/VERSION). Instructions below if you want to update Chromium.
90
105
@@ -94,7 +109,7 @@ The rest of the projects include java source and Android assets that were author
94
109
95
110
Build the latest Chromium for Android (see instructions below). A shell script is included under `chromium/update-chromium` that can be used to copy over new Chromium source and build artifacts. Very minor modifications were made to the source in order to re-structure it into the new build or get around minor issues. Modifications are kept in each project's `modified` directory (if it doesn't have one, nothing was modified). If you run the shell scripts, *beware it will delete and replace your source*. If you don't want this, don't run it blindly -- edit it to suit your needs. My workflow (which isn't ideal) is to run the script, and then hand-merge the couple of files in the `modified` directory.
96
111
97
-
Google updates this code constantly, so if you `git pull`(or`gclient sync`in Chromium-ese) on Chromium repo and rebuild, then copy the stuff over here, there's no guarantee that all of this won't break. Note that the Java source is pretty tightly coupled to the native code -- so if you build a new shared object, chances are you'll need all the latest `.java` too, or it will blow up at runtime.
112
+
Google updates this code constantly, so if you `git pull`and`gclient sync`on the Chromium repo and rebuild, then copy the stuff over here, there's no guarantee that all of this won't break. Note that the Java source is pretty tightly coupled to the native code -- so if you build a new shared object, chances are you'll need all the latest `.java` too, or it will blow up at runtime.
98
113
99
114
## License
100
115
Nearly all of the source in here is copied from the Chromium project and thus subject to Chromium license(s) -- `LICENSE` files are found w/in each project. Anything else is licensed under BSD, found in the root project dir `LICENSE` file.
@@ -113,13 +128,13 @@ If you have a spare machine to setup a build machine, I suppose that would be ev
113
128
# Debugging
114
129
115
130
## Java
116
-
You can debug `content-shell`or `testshell` Java straight from Android Studio by running one of the gradle tasks in debug mode.
131
+
You can debug `content-shell`, `testshell`or `android-webview` Java straight from Android Studio by running one of the gradle tasks in debug mode.
117
132
118
133
## Remote Chrome DevTools
119
134
120
135
Yes, you can :) You need a fairly recent copy of Google Chrome running on your dev machine along with the ADT bundle.
121
136
122
-
*TODO*: these instructions work for `content-shell`, but `testshell` is going to be slightly different; need to add section on how to debug `testshell`.
137
+
*TODO*: these instructions work for `content-shell`, but `testshell`and `android-webview`is going to be slightly different; need to add section on how to debug `testshell` and `android-webview`.
123
138
124
139
First, remote shell into the device and add the command line switch to enable remote debug over USB:
0 commit comments