Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Titanium Mobile convert Javascript to native Java or Objective C compiled code?

I've read so many articles (which I listed below), but I can't get a consistent answer. We would it be possible to just pick one of the following 2 answers? If you work for Appcelerator or any competitor, please state so. Thanks!

FYI, I am working with Titanium Studio 1.7.2.

A) Yes it compiles to native code, but some of the code must be left in Javascript and interpreted at runtime.

B) No, that is not the way Titanium works.

Here are the articles, I have read:

1) Comparison between Corona, Phonegap, Titanium

2) http://developer.appcelerator.com/blog/2010/12/titanium-guides-project-js-environment.html

3) What happens to JavaScript code after app is compiled using Titanium Mobile

4) How Does Appcelerator Titanium Mobile Work?

like image 465
Amber Avatar asked Sep 20 '11 15:09

Amber


2 Answers

Kevin Whinnery's response is accurate on the link you provided to "What happens to JavaScript code--".

To state it succinctly: your JavaScript runs in a runtime (JavaScriptCore on iOS, and Rhino but soon V8 on Android). Your JavaScript can interact over a bridge with native code and components. Like buttons, table views, web views, labels, etc. The actual JavaScript is compiled in to the app and run at runtime on the device. But this is a very simplistic answer. To learn more, please read Kevin's answer in the link above.

That's how you get the power of JavaScript with the power of the native components on both platforms.

I work for Appcelerator.

like image 173
Dawson Toth Avatar answered Oct 21 '22 18:10

Dawson Toth


From what it seems (what they publish on their website and promos at least) , they have a Javascript API thats being compiled into Native bits on iPhone or Android (Objective C and Java accordingly, depending on the OS)

like image 40
Shai Mishali Avatar answered Oct 21 '22 17:10

Shai Mishali