Rhnio And V8

V8 is a C-based JavaScript interpreter developed primarily by Google. It is the JavaScript engine used by the likes of Chrome and node.js, as well as Titanium Mobile for Android. In Android platform versions 2.2 and higher, V8 can be used as a JavaScript engine for Titanium by using Android's NDK (which enables developers to write their own C code for Android). This is the default JavaScript interpreter used by Titanium on Android.

Rhino is a Java-based JavaScript interpreter developed by Mozilla and contributed to by many. Because it is Java-based, Rhino can be used in any Android environment. Not all Android devices support the NDK (despite being Android 2.2 or better), notably Google TV. In general, V8 is preferred to Rhino because the performance of V8 is significantly better in most scenarios.

The "Android Runtime" might be considered the combination of:

  • A JavaScript engine (Rhino or V8)
  • Titanium's native C code, which provides the binding layer between the JavaScript environment in which your source code is evaluated
  • Titanium's Java code, which implements most of the Android APIs for UI, data access, and other platform features

你可能感兴趣的:(Rhnio And V8)