WebContainer

build build codecov

Description

Web Container is a simple web container library for Android to help fellow developer to open WebView easily and we made it with a simple syntax. This library is written in Kotlin and published in JitPack.io

How To Install

Step 1. Add the JitPack repository to your build file

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

Step 2. Add the dependency

dependencies {
  implementation 'com.github.ichsanachmad:WebContainer:v1.2.0'
}

How to Use

  • Simple Usage WebContainer

Kotlin:

WebContainer.launch(context: Activity, Url: String)
  • WebContainer with Callback Listener

Kotlin:

WebContainer.launch(context: Activity, Url: String, object:WebContainerListener {
    override fun callback(json: String) {
        // ToDo
    }
})

HTML/JS:

<input type="button" value="Say hello" onClick="showAndroidToast('Hello Android!')" />

<script type="text/javascript">
    function showAndroidToast(message) {
        AndroidAppCallback.callback(message);
    }
</script>

GitHub

View Github