How to do it...

  1. We'll start by opening the new project's Android code in Android Studio. From the Android Studio welcome screen, you can select Open an existing Android Studio project, then select the android directory inside of the project folder.
  2. Once the project has loaded, let's open the project explorer (that is, the directory tree) on the left side of Android Studio and expand the package structure to find the Java source files, which should live in app/java/com.nativemoduleapp. The folder should already have two .java files in it, MainActivity and MainApplication:
  1. Right-click on the com.nativemoduleapp package, select New | Java ...

Get React Native Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.