

Once this is completed, right click the Java class again and re-select the conversion option to convert it to a Kotlin class. Android Studio will walk you through configuring the project for Kotlin support. Using Kotlin Ĭapacitor uses Java by default but you can use Kotlin instead, if you prefer.Īfter generating a plugin, right click the Java plugin class in Android Studio and select the "Convert Java file to Kotlin file" option from the menu.


java file at android/src/main/java/com/domain/echo/EchoPlugin.java. java file for your plugin, which changes depending on the Plugin ID and Plugin Class Name you used when creating the plugin.įor example, for a plugin with the ID and the Plugin Class Name Echo, you would find the. Next, open echo/android/ in Android Studio. To get started, first generate a plugin as shown in the Getting Started section of the Plugin guide. Once initialized, setting setVisibility() to true will result in the building layer getting added on top of your map style.Building Capacitor plugins for Android involves writing Java or Kotlin to interface with Android SDKs. Besides the required parameters, you also have the option to provide a layer ID which you'd like the buildings to appear below. The Building Plugin requires no additional permissions and initialized by passing in both the map view and mapboxMap objects that you'd like the building layer to show on.
