• Stars
    star
    103
  • Rank 333,046 (Top 7 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated over 7 years ago

Reviews

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

Repository Details

Change the default WebView used in Cordova to Tencent X5 WebView, improved compatiblity in different Android devices. Cordova整合使用腾讯浏览服务X5内核

cordova-plugin-x5engine-webview

Makes your Cordova application use the TBS X5 WebView instead of the System WebView. Requires cordova-android 4.0 or greater.

腾讯浏览服务X5SDK

腾讯浏览服务X5SDK是通过调用微信/手机QQ/空间的X5内核,解决系统webview兼容性差、加载速度慢、功能缺陷等问题,开发接入便捷,大小只有253K,仅需几行代码,即可解决一切令开发者们头疼的问题,为用户提供最优秀的浏览体验。

腾讯浏览服务官方只提供了如何把系统Webview替换成X5的接入文档,并没有提供Cordova集成的方法。现在Hybrid App项目经常使用很多Cordoca插件提供拍照,扫二维码,App支付宝支付等功能,因此就需要把cordova和x5结合起来。

Cordova框架现在已经很完善,Cordova的Web Engine也是基于接口开发的,因此我参考系统engine的实现,写了一个x5engine插件,解决了Cordova调用X5内核的问题。

问题背景

熟悉Cordova生态圈的朋友可能听说过Crosswalk,Crosswalk是Intel维护的Webkit开源项目,可以通过插件安装命令 cordova plugin add cordova-plugin-crosswalk-webview 安装,它的缺点就是太大了,集成后apk会增加20M,安装后会占用50M空间,因此一般不推荐普通App使用Crosswalk。

Benefits

  • 同时享受Cordova平台完善的生态系统和腾讯X5内核的兼容性和稳定性,大量的Cordova插件仍然可用, Apk size只增加250k。
  • 微信/手机QQ/空间装机量很大,足够覆盖大多数国内用户
  • 使用X5内核的播放器增强H5视频播放能力

Drawbacks

  • Increased APK size (about 250Kb)

Install

The following directions are for cordova-cli (most people).

  • Open an existing cordova project, with cordova-android 4.0.0+, and using the latest CLI. TBS X5 variables can be configured as an option when installing the plugin
  • Add this plugin
$ cordova plugin add  https://github.com/offbye/cordova-plugin-x5engine-webview.git
  • Build
$ cordova build android

Known issue

  1. 64位手机上加载包含x5 so文件的插件报错 TBS:initX5Core -- loadSucc: false; exception: java.lang.reflect.InvocationTargetException; cause: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/com.tencent.mm/app_tbs/core_share/libmttwebview.so" is 32-bit instead of 64-bit 解决办法是在libs/armeabi目录下增加一个32位的JNI so, 随便弄个小一点的so加上就可以,如果已经用了其它的JNI so应该不会有这个错误。

  2. X5内核不支持file://本地域url,但支持本地相对路径。

More Repositories

1

DroidDLNA

DroidDLNA is a full featured android DLNA App, with support of UPnP/DLNA Control Point, UPnP Media Renderer and UPnP Media Server. This app is based on Cling 2.0
Java
333
star
2

cordova-plugin-alipay

cordova-plugin-alipay, 支付宝App支付插件,支持Android、iOS
Objective-C
80
star
3

AndroidDownloadManger

A full feature Android Download Manger, not use android sdk download services, support android 2.2 above.
Java
46
star
4

downloaddemo

A download demo to show how to use my android download
Java
20
star
5

PiBoat

PiBoat is Android and Respberry Based small boat, it is a project on Hackathon by Qianmi.com.
Java
13
star
6

cordova-plugin-qianmi-baidumapmark

cordova-plugin-qianmi-baidumapmark use swift
Objective-C
10
star
7

rpiservocamra

Raspberry Pi use a servo control a web camra,turn the camra through remote web page
C
9
star
8

Awesome-CBIR

Awesome lists to CNN based Image Retrieval Projects an Papers
7
star
9

zxtRN

React Native和Android,iOS原生项目集成实验项目
Java
5
star
10

offbye.github.io

offbye blog
HTML
5
star
11

SDCC2016Hangzhou

SDCC-2016杭州-互联网应用架构峰会PPT
4
star
12

RpiIRRemote

Raspberry Pi IRRemote
PHP
2
star
13

ChinaTVGuide

The source code of my first Android App on Google market in 2010, it has been top 30 in google market Entertainment catagory, not maintained in 2012
Java
2
star
14

TaoPyTools

涛哥的Python工具箱,用于研发中经常遇到的繁琐事务处理的Python自动化脚本,以最Pythonic的方法实现
Python
2
star
15

SpringRooMysqlStarter

A SpringRoo with Mysql database Starter,this project is used to start a new web project, now integrated jwplayer, simple Spring Security 3 ACL, a simple but beautiful Admin Panel, and many useful jquery libs
JavaScript
1
star
16

cordovaapp

A Cordova App example
Java
1
star
17

4pitools

some codes for respberry pi.
Python
1
star
18

dialer

dialer
1
star
19

kinmouse

use xbox360 kinect to emulate mouse and keyboard on pc, mainly for play games
1
star
20

BookMaster

BookMaster published in 2010/03, not maintained in 2012. BookMaster help you make book buy decisions.You can scan the isbn code of book and find the it on douban.com,which is the biggest book review website in china. you can read book reviews write by other reader,and check the price of online bookstores.
Java
1
star