Capacitor features a native Android runtime that enables developers to communicate between JavaScript and Native Java or Kotlin code.
Capacitor Android apps are configured and managed through Android Studio.
API 21+ (Android 5 or later) is supported, which represents over 95% of the Android market. Capacitor requires an Android WebView with Chrome version 60 or later. On Android 5 and 6, Capacitor uses the Android System WebView. On Android 7+, Google Chrome is used.
First, install the @capacitor/android
package.
npm install @capacitor/android
Then, add the Android platform.
npx cap add android
To open the project in Android Studio, run:
npx cap open android
Alternatively, you can open Android Studio and import the android/
directory as an Android Studio project.
You can either run your app on the command-line or with Android Studio.
To use an Android Emulator you must use an API 24+ system image. The System WebView does not automatically update on emulators. Physical devices should work as low as API 21 as long as their System WebView is updated.
To run the project on a device or emulator, run:
npx cap run android
The command will prompt you to select a target.
Learn more about run
.
In Android Studio, first select the device or emulator and then click the run or debug button to run your app. Unless you’re debugging Java or Kotlin code, the run button is preferred.
If you encountered any issues while getting started, you can consult the Android Troubleshooting Guide. Feel free to open a discussion if you need help.
If your app ran you are now ready to continue developing and building your app. Use the various APIs available, Capacitor or Cordova plugins, or custom native code to build out the rest of your app.
Follow these Android-specific guides for more information on setting permissions for your app, updating dependencies, building plugins, and more:
Configuring and setting permissions for Android ›
Building Native Plugins for Android ›