cordova platform add android (Adding Platforms) copied the cordova-android 15.1.0 template into platforms/android, a complete Gradle 19,597 project that Android Studio 234 opens directly:
| Path | What it is |
|---|---|
| app/src/main | AndroidManifest.xml, java/.../MainActivity.java, res/ and assets/www |
| CordovaLib | The runtime: WebView engine, bridge, plugin manager (Web App to Native App) |
| cdv-gradle-config.json | SDK, Gradle and AGP versions, rewritten by every prepare |
| tools/gradlew | The Gradle wrapper pinned to 8.14.2 (Gradle) |
The only Java in your app is a short activity; everything else comes from CordovaActivity:
package com.example.booknest;
import android.os.Bundle;
import org.apache.cordova.*;
public class MainActivity extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// enable Cordova apps to be started in the background
Bundle extras = getIntent().getExtras();
if (extras != null && extras.getBoolean("cdvStartInBackground", false)) {
moveTaskToBack(true);
}
// Set by <content src="index.html" /> in config.xml
loadUrl(launchUrl);
}
}The package path follows the widget id, one more reason to fix the ID before the first platform add.