Skip to content

hwchai/wpe-android

 
 

Repository files navigation

WPE Android

LGPLv2.1 License CI build

logo

WPE WebKit port for Android.

WPEView API

WPEView wraps the WPE WebKit browser engine in a reusable Android library. WPEView serves a similar purpose to Android's built-in WebView and tries to mimick its API aiming to be an easy to use drop-in replacement with extended functionality.

Setting up WPEView in your Android application is fairly simple.

(TODO: package, distribute and document installation)

First, add the WPEView widget to your Activity layout:

<com.wpe.wpeview.WPEView
        android:id="@+id/wpe_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity"/>

And next, wire it in your Activity implementation to start using the API, for example, to load an URL:

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    val browser = findViewById(R.id.wpe_view)
    browser?.loadUrl(INITIAL_URL)
}

To see WPEView in action check the tools folder.

Setting up your environment

python3

The bootstrap script requires python3.

Getting the dependencies

WPE Android depends on a considerable amount of libraries, including libWPE and WPEWebKit. To ease the cross-compilation process we use Cerbero. To set all things up run:

./tools/scripts/bootstrap.py

This command will fetch the required binaries and place them in the expected location.

If you want to build (and/or modify) the dependencies you can pass the --build option:

./tools/scripts/bootstrap.py --build

This command will fetch Cerbero, the Android NDK and a bunch of dependencies required to cross-compile WPE Android dependencies. The process takes a significant amount of time.

You can optionally create a debug build of WPEWebKit passing the --debug option to the bootstrap command:

./tools/scripts/bootstrap.py --build --debug

Finally, the bootstrap option accepts the --arch option to set the target architecture. Currently supported architectures are arm64, armv7, x86 and x86_64.

Android Studio

Android Studio is required to build and run WPE Android. Once the bootstrap process is done and all the dependencies are cross-compiled and installed, you should be able to open the launcher demo with Android Studio and run it on a real device.

Known issues and limitations

  • The universal wpewebkit bootstrap package is not yet supported.
  • The scripts and build have only been tested in Linux.

About

WPE WebKit for Android

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 53.3%
  • Java 25.1%
  • Python 10.3%
  • Kotlin 6.5%
  • CMake 2.0%
  • HTML 2.0%
  • Other 0.8%