Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
100
rated 0 times [  107] [ 7]  / answers: 1 / hits: 45027  / 8 Years ago, tue, december 13, 2016, 12:00:00

When I develop hybrid apps with React Native. Does the JavaScript code I write transform into Java-Code or Java-Bytecode for the Dalvik/ART Runtime when I create an Android-App from my React Native code? Or are just the UI components compiled into native UI components? Or does a library like the Fetch API compile the JavaScript code into Java-Code or Java-Bytecode?


More From » java

 Answers
15

Basically, you write Javascript. The Javascript communicates with native components (Java on Android, Objective C on iOS, C# on Windows).



The communication occurs through the so-called bridge. If at any time you feel that this communication slows things down too much, you can choose to implement the Javascript functionality in Java, Objective C, or C# respectively in order to run purely native. In this case, you are writing directly in native code, so there's no Javascript to native compilation.



This will sacrifice compatibility for performance. Normally, this is not necessary.




  • Further reading



Understanding React Native bridge concept


[#59717] Monday, December 12, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jerome

Total Points: 592
Total Questions: 98
Total Answers: 101

Location: Tonga
Member since Tue, Nov 30, 2021
3 Years ago
;