Android Tutorial [B4X] WebView + CKEditor (rich text editor)


This is a cross platform example that adds CKEditor rich text editor using WebView:
Make sure to read CKEditor licensing and pricing: (related discussion:

It also shows how to get the html string using this useful sub:

Private Sub RunJavaScript (js As String) As ResumableSub
    #if B4A
    WebViewExtras1.executeJavascript(WebView1, $"B4A.CallSub('Process_HTML', true, ${js})"$)
    Wait For Process_Html(html As String)
    Return html
    #Else If B4J
    Return WebView1.As(JavaObject).RunMethodJO("getEngine", Null).RunMethod("executeScript", Array(js))
    #Else If B4i
    Dim sf As Object = WebView1.EvaluateJavaScript(js)
    Wait For (sf) WebView1_JSComplete (Success As Boolean, Result As String)
    Return Result
    #end if
End Sub

It will require more work to make it actually useful but it should be a good start for anyone who is looking for a cross platform rich text editor.

Download link:
B4A depends on WebViewExtras:
B4J requires Java 14. Link is available here:
Last edited: