Often you will find yourself writing React Native applications for both iOS and Android. We have discussed how to go about creating native modules in iOS in the first recipe of this chapter. Now it's time to put our green Android robot hats on and write some Java!
This recipe will take us through writing our first Android native module. We will mimic the functionality of the Exposing custom iOS modules recipe, but for Android. We're going to create a
HelloManager native module with a
greetUser method that takes a
isAdmin Boolean value arguments. It will return a greeting message that we will display.
For this recipe, we created a React Native application titled
In this recipe, we ...