Wednesday, February 3, 2016

React Native



http://hahack.com/codes/learn-react-native-for-android-01/

React Native applications are written using a mixture of JavaScript and XML-esque markup, known as JSX. Then, under the hood, the React Native “bridge” invokes the native rendering APIs in Objective-C (for iOS) or Java (for Android). Thus, your application will render using real mobile UI components, not webviews, and will look and feel like any other mobile application. React Native also exposes JavaScript interfaces for platform APIs, so your React Native apps can access platform features like the phone camera, or the user’s location.

In React, the Virtual DOM acts as a layer between the developer’s description of how things ought to look, and the work done to actually render your application onto the page.
Rather than directly render changes on the page, React computes the necessary changes by using an in-memory version of the DOM, and rerenders the minimal amount necessary

brew install node
brew install watchman
brew install flow

npm install -g react-native-cli

brew install android-sdk
Intel x86 Atom System Image (for Android 5.1.1–API 22)
Intel x86 Emulator Accelerator (HAXM installer)

android avd
Be sure to check Use Host GPU—otherwise your emulator will be very slow!
react-native init FirstProject

Running a React Native Application for Android
Select the emulator you would like to run and then click the Start… button
emulator -list-avds
emulator @galaxy

react-native init HelloWorld
http://facebook.github.io/react-native/docs/troubleshooting.html

http://stackoverflow.com/questions/26521014/intel-x86-emulator-accelerator-haxm-installer-vt-nx-not-enabled
From the Intel Instructions

"The SDK Manager will download the installer to the "extras" directory, under the main SDK directory. Even though the SDK manager says "Installed" it actually means that the Intel HAXM executable was downloaded. You will still need to run the installer from the "extras" directory to finish installation.

Extract the installer inside the "extras" directory and follow the installation instructions for your platform."
After download your need to run : sudo /usr/local/Cellar/android-sdk/24.4.1/extras/intel/Hardware_Accelerated_Execution‌​_Manager/silent_install.s

For the lazy (android-sdk installed with homebrew): cd /usr/local/Cellar/24.4.1/extras/intel/Hardware_Accelerated_Execution_Manager && open IntelHAXM_6.0.1.dmg. You may have to update your commands based on your install method and software versions.

I'm trying to use the Intel HAX x86 emulator for Windows (8, if that matters). I installed everything and created an AVD for the android version, and everything appears correct, but when I run it, I get this output:

Starting emulator for AVD 'x86_QVGA_Level10'
emulator: device fd:1044
HAX is working and emulator runs in fast virt mode
emulator: Failed to sync vcpu reg
emulator: Failed to sync HAX vcpu context

Make sure you don't have any virtual machines running. In my case, I had genymotion running which was causing this error.

http://sourcefreeze.com/react-native-what-makes-it-so-successful/
In the PhoneGap and Apache Cordova used DOM for rendering, it is the main reason for slow performance. With the release of Hybrid UI frameworks like ionic framewrokkendo UIOnsen UI the performance was very much improved. But still it is not comparable with native performance.
React Native is not using DOM for rendering, instead of it renders with native UI views, which means you are using the native components provided by the operating system.

Labels

Review (572) System Design (334) System Design - Review (198) Java (189) Coding (75) Interview-System Design (65) Interview (63) Book Notes (59) Coding - Review (59) to-do (45) Linux (43) Knowledge (39) Interview-Java (35) Knowledge - Review (32) Database (31) Design Patterns (31) Big Data (29) Product Architecture (28) MultiThread (27) Soft Skills (27) Concurrency (26) Cracking Code Interview (26) Miscs (25) Distributed (24) OOD Design (24) Google (23) Career (22) Interview - Review (21) Java - Code (21) Operating System (21) Interview Q&A (20) System Design - Practice (20) Tips (19) Algorithm (17) Company - Facebook (17) Security (17) How to Ace Interview (16) Brain Teaser (14) Linux - Shell (14) Redis (14) Testing (14) Tools (14) Code Quality (13) Search (13) Spark (13) Spring (13) Company - LinkedIn (12) How to (12) Interview-Database (12) Interview-Operating System (12) Solr (12) Architecture Principles (11) Resource (10) Amazon (9) Cache (9) Git (9) Interview - MultiThread (9) Scalability (9) Trouble Shooting (9) Web Dev (9) Architecture Model (8) Better Programmer (8) Cassandra (8) Company - Uber (8) Java67 (8) Math (8) OO Design principles (8) SOLID (8) Design (7) Interview Corner (7) JVM (7) Java Basics (7) Kafka (7) Mac (7) Machine Learning (7) NoSQL (7) C++ (6) Chrome (6) File System (6) Highscalability (6) How to Better (6) Network (6) Restful (6) CareerCup (5) Code Review (5) Hash (5) How to Interview (5) JDK Source Code (5) JavaScript (5) Leetcode (5) Must Known (5) Python (5)

Popular Posts