Custom webview in cordova app

I am new to android development and just started working on a web app using cordova, ionic framework and angular. I have completed the basic features of the app and found that the transitions between views in the app are a bit slow I found this article to improve them here:,-improving-performance

I have never coded in java and so I am stuck.

I tried doing the following

went to the in the path myapp\platforms\android\CordovaLib\src\org\apache\cordova and added the import statements missing in the file (except for the "import org.apache.cordova.CordovaWebView") which were using in the article and copy-pasted the myWebview class.

Then I went to the, below path


and modified it to

public class StarterApp extends CordovaActivity 
    public void onCreate(Bundle savedInstanceState)
        CordovaWebView webView = new MyWebView(MyActivity.this);
    super.init(webView, new CordovaWebViewClient(this, webView), new     CordovaChromeClient(this, webView));
        // Set by <content src="index.html" /> in config.xml

But when I run the cordova build command I am getting a error. Could someone tell me, what I am missing?

This looks incorrect to me:

CordovaWebView webView = new MyWebView(MyActivity.this);
  1. Have you written code for MyWebView?
  2. MyActivity doesn't seem to exist. You can just use this.