Friday, March 3, 2017

Using CKEditor in WebView on Android

CKEditor is a powerful rich text editor for web applications.  This post shows how to integrate the editor into an Android application and load a sample page into a WebView.

  1. Download CKEditor.
  2. Unpack Zip file and move ckeditor folder to $project.projectDir/src/main/assets folder.
  3. Create a WebView in your layout file.
  4. After inflating the layout file, find WebView and enable JavaScript: webView.getSettings().setJavaScriptEnabled(true);
  5. Load sample app into the WebView: webView.loadUrl("file:///android_asset/ckeditor/samples/index.html");
When the application is launched, it'll look something like this:




1 comment: