https://github.com/jordaaash/react-native-webview-crosswalk
Crosswalk's WebView for React Native on Android.
https://github.com/jordaaash/react-native-webview-crosswalk
android crosswalk java react react-native webview
Last synced: about 2 months ago
JSON representation
Crosswalk's WebView for React Native on Android.
- Host: GitHub
- URL: https://github.com/jordaaash/react-native-webview-crosswalk
- Owner: jordaaash
- License: mit
- Created: 2016-02-23T09:33:17.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-13T01:16:02.000Z (almost 8 years ago)
- Last Synced: 2025-03-07T00:08:35.905Z (2 months ago)
- Topics: android, crosswalk, java, react, react-native, webview
- Language: Java
- Homepage:
- Size: 38.2 MB
- Stars: 97
- Watchers: 7
- Forks: 71
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-native - react-native-webview-crosswalk ★88 - Crosswalk's WebView for React Native on Android (Components / Web)
README
# react-native-webview-crosswalk
Crosswalk's WebView for React Native on Android.[](https://npmjs.org/package/react-native-webview-crosswalk "View this project on npm")
[](https://npmjs.org/package/react-native-webview-crosswalk "View this project on npm")
[](https://npmjs.org/package/react-native-webview-crosswalk "View this project on npm")### Dependencies
* [0.4.0](https://github.com/jordansexton/react-native-webview-crosswalk/releases/tag/v0.4.0)+: `react-native >=0.32.0`, `react >= 15.3.0`
* [0.3.0](https://github.com/jordansexton/react-native-webview-crosswalk/releases/tag/v0.3.0)+: `react-native >=0.29.0`, `react >= 15.2.0`
* [0.2.0](https://github.com/jordansexton/react-native-webview-crosswalk/releases/tag/v0.2.0)+: `react-native >=0.25.0`, `react >= 0.14.5`
* [0.1.0](https://github.com/jordansexton/react-native-webview-crosswalk/releases/tag/v0.1.0): `react-native >= 0.19.0`
### Installation
* From the root of your React Native project
```shell
npm install react-native-webview-crosswalk --save
mkdir android/app/libs
cp node_modules/react-native-webview-crosswalk/libs/xwalk_core_library-22.52.561.4.aar android/app/libs/
```### Include module in your Android project
* In `android/setting.gradle`
```gradle
...
include ':CrosswalkWebView', ':app'
project(':CrosswalkWebView').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview-crosswalk')
```### Include libs in your Android project
* In `android/build.gradle`
```gradle
...
allprojects {
repositories {
mavenLocal()
jcenter()flatDir { // <--- add this line
dirs 'libs' // <--- add this line
} // <--- add this line
}
}
```* In `android/app/build.gradle`
```gradle
...
dependencies {
...
compile (name: "xwalk_core_library-22.52.561.4", ext: "aar") // <--- add this line
compile project(':CrosswalkWebView') // <--- add this line
}
```
* Register package :If [0.1.0](https://github.com/jordansexton/react-native-webview-crosswalk/releases/tag/v0.1.0) or [0.2.0](https://github.com/jordansexton/react-native-webview-crosswalk/releases/tag/v0.2.0)+ used add code into MainActivity.java
```java
import com.jordansexton.react.crosswalk.webview.CrosswalkWebViewPackage; // <--- add this linepublic class MainActivity extends ReactActivity {
......@Override
protected List getPackages() {
return Arrays.asList(
new MainReactPackage(),
new CrosswalkWebViewPackage(this) // <--- add this line
);
}......
}
```If [0.3.0](https://github.com/jordansexton/react-native-webview-crosswalk/releases/tag/v0.3.0)+ used add code into MainApplication.java
```java
import com.jordansexton.react.crosswalk.webview.CrosswalkWebViewPackage; // <--- add this linepublic class MainApplication extends Application implements ReactApplication {
......@Override
protected List getPackages() {
return Arrays.asList(
new MainReactPackage(),
new CrosswalkWebViewPackage() // <--- add this line
);
}......
}
```## License
MIT