How to implement phonegap/cordova in android webview? <p>I need just a few minutes for someone to tell me if these steps are correct for implementing cordova in a android webview:</p> <p>EDIT: Ok I finally got it working these are the right steps:</p> <p>1) I create project: <code>cordova create hello com.example.hello HelloWorld</code> and enter the folder</p> <p>2) <code>cordova platform add android</code>, <code>cordova run android</code> (cordova.jar is created) => the app is launched => device is ready is shown</p> <p>3) I create a cordova_layout.xml in "/res/layout" with this code:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;org.apache.cordova.CordovaWebView android:id="@+id/cordova_web_view" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>4)Import the project (as an "existing project" in eclipse) and add to the main java file after imports:</p> <pre><code> public class HelloWorld extends Activity implements CordovaInterface { private CordovaWebView cordova_webview; private String TAG = "CORDOVA_ACTIVITY"; private final ExecutorService threadPool = Executors.newCachedThreadPool(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.cordova_layout); cordova_webview = (CordovaWebView) findViewById(R.id.cordova_web_view); // Config.init(this); String url = "file:///android_asset/www/index.html"; cordova_webview.loadUrl(url, 10000); } @Override protected void onPause() { super.onPause(); Log.d(TAG, "onPause"); } @Override protected void onResume() { super.onResume(); Log.d(TAG, "onResume"); } @Override protected void onDestroy() { super.onDestroy(); if (this.cordova_webview != null) { this.cordova_webview .loadUrl("javascript:try{cordova.require('cordova/channel').onDestroy.fire();}catch(e){console.log('exception firing destroy event from native');};"); this.cordova_webview.loadUrl("about:blank"); cordova_webview.handleDestroy(); } } @Override public Activity getActivity() { return this; } @Override public ExecutorService getThreadPool() { return threadPool; } @Override public Object onMessage(String message, Object obj) { Log.d(TAG, message); if (message.equalsIgnoreCase("exit")) { super.finish(); } return null; } @Override public void setActivityResultCallback(CordovaPlugin cordovaPlugin) { Log.d(TAG, "setActivityResultCallback is unimplemented"); } @Override public void startActivityForResult(CordovaPlugin cordovaPlugin, Intent intent, int resultCode) { Log.d(TAG, "startActivityForResult is unimplemented"); } } </code></pre> <p>NOTE: the activity name must match the one in manifest.xml</p> <p>Hope it will help you. Have a nice day!</p>