• This repository has been archived on 07/Jan/2018
  • Stars
    star
    1,690
  • Rank 27,610 (Top 0.6 %)
  • Language
    Java
  • Created over 11 years ago
  • Updated about 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Proof of concept Android WebView implementation based on Chromium code

Deprecation Notice

This project is un-maintained. The recommended alternative is the Crosswalk Project.

I did not have the time to keep the project up to date. In the mean time, the fine folks at Intel did a great job of embedding Chromium using the Content Shell API, which is what Chromium's developers intended. Therefore, I cannot justify spending any time on this. The original README and the code are here for historical purposes.

I think that the Crosswalk Project will meet all your embedding needs, and I'm contributing to it.

ChromeView

ChormeView works like Android's WebView, but is backed by the latest Chromium code.

Why ChromeView

ChromeView lets you ship your own Chromium code, instead of using whatever version comes with your user's Android image. This gives your application early access to the newest features in Chromium, and removes the variability due to different WebView implementations in different versions of Android.

Setting Up

This section explains how to set up your Android project to use ChromeView.

Get the Code

Check out the repository in your Eclipse workspace, and make your project use ChromeView as a library. In Eclipse, right-click your project directory, select Properties, choose the Android category, and click on the Add button in the Library section.

Copy Data

Copy assets/webviewchromium.pak to your project's assets directory. Star this bug if you agree that this is annoying.

In your Application subclass, call ChromeView.initialize and pass it the application's context. For example,

Initialize Chromium

import us.costan.chrome.ChromeView;
import android.app.Application;

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ChromeView.initialize(this);
    }
}

Now you can use ChromeView in the same contexts as you would use WebView.

Star some bugs

If you use this project and want to help move it along, please star the following bugs.

Usage

To access ChromeView in the graphical layout editor, go to the Palette, expand the Custom and Library Views section, and click the Refresh button.

ChromeView supports most of the WebView methods. For example,

ChromeView chromeView = (ChromeView)findViewById(R.id.gameUiView);
chromeView.getSettings().setJavaScriptEnabled(true);
chromeView.loadUrl("http://www.google.com");

JavaScript

ChromeView's addJavaScriptInterface exposes public methods that are annotated with @ChromeJavascriptInterface. This is because WebView's @JavascriptInterface is only available on Android 4.2 and above, but ChromeView targets 4.0 and 4.1 as well.

import us.costan.chrome.ChromeJavascriptInterface;

public class JsBindings {
    @ChromeJavascriptInterface
    public String getHello() {
        return "Hello world";
    }
}

chromeView.addJavascriptInterface(new JsBindings(), "AndroidBindings");

Cookies

ChromeCookieManager is ChromeView's equivalent of CookieManager.

ChromeCookieManager.getInstance().getCookie("https://www.google.com");

Faster Development

To speed up the application launch on real devices, remove the libs/x86 directory. When developing on Atom devices, remove the ARM directory instead.

Remember to git checkout -- . and get the library back before building a release APK.

Internet Access

If your application manifest doesn't specify the INTERNET permission, the Chromium code behind ChromeView silentely blocks all network requests. This is mentioned here because it can be hard to debug.

Building

The bulk of this project is Chromium source code and build products. With the appropriate infrastructure, the Chromium bits can be easily updated.

crbuild/vm-build.md contains step-by-step instructions for setting up a VM and building the Chromium for Android components used by ChromeView.

Once Chromium has been successfully built, running crbuild/update.sh will copy the relevant bits from the build VM into the ChromeView source tree.

Issues

Attempting to scroll the view (by swiping a finger across the screen) does not update the displayed image. However, internally, the view is scrolled. This can be seen by displaying a stack of buttons and trying to click on the topmost one. This issue makes ChromeView mostly unusable in production.

The core issue is that the integration is done via AwContent in the android_webview directory of the Chromium source tree, which is experimental and not intended for embedding use. The "right" way of doing this is to embed a ContentView from the content directory, or a Shell in content/shell. Unfortunately, these components' APIs don't match WebView nearly as well as AwContent, and they're much harder to integrate. Pull requests or a fork would be welcome.

This repository is rebased often, because the large files in lib/ would result in a huge repository if new commits were created for each build. The large files are Chromium build products.

Contributing

Please don't hesitate to send your Pull Requests!

Please don't send pull requests including the binary assets or code extracted from Android (assets/, libs/, src/com/googlecode/ and src/org/android). If your Pull Request requires updated Android bits, mention that in the PR description, and I will rebuild the Android bits.

Copyright and License

The directories below contain code from the The Chromium Project, which is subject to the copyright and license on the project site.

  • assets/
  • libs/
  • src/com/googlecode
  • src/org/chromium

Some of the source code in src/us/costan/chrome has been derived from the Android source code, and is therefore covered by the Android project licenses.

The rest of the code is Copyright 2013, Victor Costan, and available under the MIT license.

More Repositories

1

node-open

open a file or uri with the users preferred application (browser, editor, etc), cross platform
JavaScript
560
star
2

node-xhr2

XMLHttpRequest emulator for node.js
CoffeeScript
102
star
3

sanctum

Minimal RISC Extensions for Isolated Execution
C++
50
star
4

dropship-chrome

The source code for the "Download to Dropbox" Chrome extension, before it makes it to dropbox.js/samples
CoffeeScript
40
star
5

chromeview-src

Android WebView implementation that uses the latest Chromium code
Java
37
star
6

node-parse-database-url

Database configuration URL parser for node.js
JavaScript
22
star
7

gitty

Private git repository manager
Ruby
20
star
8

daemonz

Automatically starts and stops the daemons in a Rails application.
Ruby
19
star
9

vbox

Golang wrapper for VirtualBox's XPCOM API
Go
18
star
10

webkit_remote

Client for the Webkit Remote Debugging server
Ruby
17
star
11

sphero-notes

Notes on reverse-engineering sphero
16
star
12

igor

Course homework submission site
Ruby
14
star
13

virtual_box

VirtualBox API for Ruby
Ruby
14
star
14

tfrecord

Reader and writer for the TensorFlow Record file format
TypeScript
14
star
15

rbtree-pure

Pure-ruby implementation of the rbtree gem
Ruby
13
star
16

rtunnel

reverse tunnel server and client
Ruby
12
star
17

wenlin_db_scanner

Extracts the data from the Wenlin dictionary program
Assembly
11
star
18

html5-app-container

HTML5 application container for Android and iOS
Shell
8
star
19

sgx-explained

Source code for the "SGX Explained" paper
TeX
7
star
20

x_do

Ruby FFI bindings to libxdo
Ruby
7
star
21

node-sphero-pwn

Driver for Sphero robots
CoffeeScript
6
star
22

anki_importer

Importer for Anki deck databases
Ruby
6
star
23

fbgraph_rails

Rails plug-in integrating the fbgraph gem
Ruby
6
star
24

authpwn_rails

User authentication for Rails 3 applications.
Ruby
6
star
25

dropbox-chrome

Prototype Chrome extension for Dropbox
CoffeeScript
5
star
26

pwnalytics_js

Open-source Web analytics
JavaScript
4
star
27

pwnalytics

Open-source Web analytics
Ruby
4
star
28

zerg_support

Support libraries used by Zergling.Net deployment code.
Ruby
4
star
29

w3hear-js

Infrastructure for speech recognition in JavaScript
CoffeeScript
3
star
30

chromembed_rails

Rails Engine for applications that are strongly coupled to Chrome extensions.
Ruby
3
star
31

zhangmen

What does this button do?
Ruby
3
star
32

chatty

IM Web app using WebSockets, with a MongoDB backing store
CSS
3
star
33

configvars_rails

Global configuration variables for Rails 3 applications.
Ruby
3
star
34

w3gram-server

Push notifications (W3gram) server in node.js
CoffeeScript
3
star
35

xilinx-provision

Deploys bitfiles to Xilinx FPGAs
Ruby
2
star
36

file_blobs_rails

Database-backed file storage for Rails 5 applications
Ruby
2
star
37

vulkan_tutorial

C++
2
star
38

ether_shell

IRB shell tweaked for testing Ethernet devices
Ruby
2
star
39

mapreduced

Golang service for running Map-Reduce jobs using Docker containers
Go
2
star
40

julius4

Git mirror of julius4 in :pserver:[email protected]:/cvsroot/julius
C
2
star
41

sushi

Victor's programming language
C++
2
star
42

opinion_map

Rails application demo for MIT 6.470 2012 guest lecture
Ruby
2
star
43

cubox

Build setup for cubox-i
Shell
2
star
44

scancodes

Golang library that produces the keyboard scancodes needed to type in a string
Go
2
star
45

w3gram-js

Push Notifications (W3gram) JavaScript Client Library
CoffeeScript
2
star
46

battlecode-server

Java
2
star
47

rails_pwnerer

Rails deployment hack.
Ruby
2
star
48

pwnalytics_client

Ruby gem for pulling data from a Pwnalytics server
Ruby
2
star
49

pwnstyles_rails

Non-trivial default styling for Rails applications.
CSS
2
star
50

script-digest

W3C proposal for a <script> content integrity check
2
star
51

exec_sandbox

Run foreign binaries using POSIX sandboxing features
Ruby
2
star
52

codo-theme-yaml

YAML theme for the codo documentation generator
CoffeeScript
2
star
53

ql-config

My Quake Live configuration file
2
star
54

cudainfo

CLI tool that shows the properties of installed CUDA GPUs
Cuda
2
star
55

sphero_pwn

Wrapper around the Bluetooth RFCONN protocol used to program Sphero robots
Ruby
2
star
56

clh

CraigsList Housing Helper
Ruby
2
star
57

node-sphero-pwn-macros

Macro compiler for Sphero robots
CoffeeScript
2
star
58

stellar

Automated access to MIT's Stellar data
Ruby
2
star
59

mit_stalker

Fetches publicly available information about MIT students.
Ruby
2
star
60

feedtools_ram_cache

RAM-based cache for FeedTools.
Ruby
1
star
61

webkit_remote_unstable

Unstable features for the webkit_remote Webkit remote debugging client
Ruby
1
star
62

imageutil

Golang library containing a seemingly random collection of low-level image processing tools
Go
1
star
63

heroku-web-client

Heroku Platform API client for Web applications
TypeScript
1
star
64

ether_ping

Command-line ping equivalent for Ethernet frames
Ruby
1
star
65

playbox

Skeleton for Web UI experiments
Ruby
1
star
66

fallocate

Rubygem containing FFI bindings to the posix_fallocate libc call.
Ruby
1
star
67

filer

Ruby
1
star
68

mit_cert_auth

Source code for the MIT certificate authentication proxy service (Ruby on Rails).
Ruby
1
star
69

ddr

DDR :)
CoffeeScript
1
star
70

next_editor

Syntax-highlighting editor that supports IME (Input Method Editor) input for languages with complex scripts
JavaScript
1
star
71

pwnbus-configdb

Pure-ruby database for configuration variables.
Ruby
1
star
72

bcpm

MIT Battlecode (6.370) Program Manager
Ruby
1
star
73

markdpwn

HTML-formats text documents such as Markdown, textile, and source code
Ruby
1
star
74

gem-index-dumper

Spot-checks on the gem index.
Ruby
1
star
75

radeonhd-power.fc

Fedora packaging for radeon-power
1
star
76

tian_tian

Rails application that generates Chinese character practice sheets
Ruby
1
star
77

bitdiddle_sec

Web application for Bitdiddle's Encryption Standard breaking exercise in MIT 6.857
Ruby
1
star
78

usaco

C++
1
star
79

battlecode-client

Official Battlecode game client, 2D and 3D versions
Java
1
star
80

radeonhd-power

Configures the RadeonHD open-source driver's power management.
Shell
1
star
81

node-sphero-pwn-cli

Command-line tools for Sphero robots
CoffeeScript
1
star
82

rockbands_bot

Bot for the Rockbands Live game
Ruby
1
star
83

filer_js

JavaScript
1
star
84

pwnfx_js

Sprinkles of AJAX using UJS
1
star
85

topological_sort

Topological sorting in arbitrary directed graphs.
Ruby
1
star
86

inplacecontrols

The inplacecontrols Rails plug-in, hacked to work with for Rails 3.
Ruby
1
star
87

pwnpet_web

Ruby
1
star
88

pset_writeups

Write-ups for my MIT problem sets
Ruby
1
star
89

pdf_test

Rails application for playing with PDF security features
Ruby
1
star
90

hsreporter

Hearthstone logging output uploader in Golang
Go
1
star
91

hibaby

De-anonymizer for dating networks
TeX
1
star
92

coninference

Ruby
1
star