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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.