Introduction to Mobile Development Over Multiple Platforms With React Native And Expo
You can skip to the series outline at the end of the post.
For developing mobile applications for both Android and iOS, the languages recommended by the OS vendors are Kotlyn/Java and Swift. If these technologies were used, developers will need to maintain two separate code-bases for each platform. They’d also have to implement the same functionality on both code-bases separately, twice. This is contrasted with web development, where a single thread of development is usually sufficient for any platform.
In addition, similar concepts have subtle but important differences on each platform. This includes differences in UI concepts like screens/activities and buttons, lower-level system APIs like Geo-location and camera.
The developers also had to learn, debug and test two technologies, which made it impossible to focus on and become experts on a single base technology with a good learning and efficiency curve.
This new philosophy in Cordova/Ionic can be called write-once-build-everywhere, as the same codebase is built over different build-chains and tools to create different build targets, i.e. binaries.
The philosophy behind Ionic is called write-once-build-everywhere
React Native was able to solved issues in developing on Cordova/Ionic such as,
- Performance and memory-efficiency (web-technology abstractions and native WebView UI component limitations)
- Inability to use existing or new native code
React Native also made it much easier and straight-forward to implement new interfacing with native APIs for the end developers. In addition, React Native also became a framework for combining existing separate platform-specific codebases into a single codebase.
React Native helps combine existing codebases for different platforms into a single codebase
Flutter is another cross-platform development technology recently introduced (by Google), which is not considered in this article. We’ll discuss it at a later time.
Both Cordova/Ionic and React Native are different to the write-once-run-everywhere concept in Oracle Java. In Java, the same bytecode files created in a single build can run on any platform. This is made possible by the Java Virtual Machine that acts as a middle layer between platform and app. With Cordova/Ionic or React Native, usually, the developer has to build twice for both Android and iOS, separately.
Ionic very recently came up with a solution by providing an online service that builds the app for both Android and iOS for separately-given certificates and configurations. While React Native didn’t focus on this, a separate organization called Expo created such a service for free.
Still, building separately for both platforms on every new change and testing continues to be a hassle. The solution for this from Ionic is the Ionic View app, and later the Ionic Dev app, as well as the Expo app. The developer can build an easily testable version of target servable over a network, without using or even installing Android or iOS SDKs. Then, using Ionic View/Ionic Dev or Expo apps running on either an emulator, or a mobile on the same (WiFi) network as the developer’s machine, testing the app is possible.
Ionic View, Ionic Dev and Expo apps make testing and prototyping of cross-plarform mobile apps a breeze
This mechanism supports most app requirements, but does have certain limitations. However this ease in development and testing made it a popular part in cross-platform mobile app development workflows.
Create and run simple Expo app
On emulators and physical phones
- Creating and using standard UI components
Navigation and screens
Tab navigation, communicating state, creating screens
For face-recognition with Microsoft Cognitive Services
Using Google Maps
With multiple routes, labels, markers, shapes, etc.
- Structuring complex Expo apps
- Building for Android
- Building for iOS
- Publishing to Android App Store
- Publishing to iOS App Store
The order is open for change, depending on your suggestions. There will be multiple articles covering this series.