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

2

8

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?

Locklear answered 20/9, 2011 at 15:48 Comment(0)
T
4

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.

Thigpen answered 20/9, 2011 at 19:12 Comment(2)
"The actual JavaScript is compiled in to the app and run at runtime on the device." Would it be more accurate to say that the Javascript is interpreted then?Ellisellison
Depends on the runtime. #8820346Thigpen
D
1

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)

Dettmer answered 20/9, 2011 at 16:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.