How It Feels to Work with React Native If You're an Android Developer

React Native has become quite popular among mobile developers recently, so I just couldn’t resist the urge to get acquainted with this framework to keep pace with the newest trends in mobile app development.

Why React Native?

For those who are joining the party late, React Native is a JavaScript framework for writing “true” natively rendered applications for iOS and Android. React Native arose from Facebook’s JavaScript Library called React, which was designed to build interactive web user interfaces; but instead of targeting web browsers, React Native targets mobile platforms.

What this means for the web development community is that now web developers can build mobile applications that look and feel truly native, using their beloved JavaScript library. Moreover, because most of your code can be shared between platforms, it becomes possible to simultaneously build solutions for both iOS and Android. This is actually what intrigued me most, so I wanted to check if I could use React Native effectively in my future work.

Reviewing the project structure

Let’s get started! After everything is set up, you can create a project by entering a single command in the terminal:

react-native init TestProject

[Project structure]

The structure of a newly generated project is pretty straightforward: it contains your Android and iOS projects, which can be opened via their usual IDEs – Android Studio and XCode – if needed. But while it’s possible to develop platform-specific parts of an application, the primary logic of the application will be located outside of the distinct Android and iOS projects.

The node_modules directory contains all of the included dependencies. index.android.js is the entry point for the Android app, while index.ios.js serves the same purpose for the iOS app.

Let’s choose an IDE

One of the trickiest things, when you start with a new programming language, is choosing the right editor for your project. Besides, in our case, we have to find an editor suitable for cross-platform development, and I have a couple of insights on this matter...  

I might go for Atom, a beautiful, lightweight, and easily customizable text editor with a nice autocomplete and convenient file system browsing. Of course, it hardly compares to Android Studio in a number of features, but it’s worth giving it a chance.

Also, you may find it useful to install the Deco IDE. It seems to be more functional than the previous editor and includes a graphical editor which could ease the building of your app’s UI. There are loads of options actually, but I personally made my choice in favor of Vim, a highly configurable, time-tested lightweight editor that supports hundreds of programming languages including JavaScript. ... 

Click the link below to continue reading.

This article duplicated from: Yalantis.com

No corresponding comment