React Native App Development Company in USA | Page 9
system.out.println(“Bulb is turn On ”);
}
@ ReactMethod
Public void turnOff (){
isOn = false;
system.out.println(“Bulb is turn OFF”);
}
@Override
public string getName (){
Return : ‘Bulb’;
}
}
COPY
We demand to Override createNativeModules function and compute the Bulb object to the modules array. If this is
often not added here then it'll not be available in JavaScript.
We don’t have to change any JavaScript code written in iOS, as we've exposed an equivalent class name and
performance . If you've got skipped the iOS part then you would like to repeat the React Javascript code from App.js
Now run the App over Android Studio or from react-native run-android:
We can detect the Bulb status on the screen and may turn on or distant from the button. The good thing is that we've
created a Native Bridge which is Cross Platform.
Develop robust native-style applications for both Android and iOS with the help of top rated React Native development
company. React Native mobile applications for both iOS and Android platform. Since it requires to be coded only once,
React Native quickly gained popularity amongst developers as well as businesses because of its fast time to market and
cost-effectiveness.