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

You must Login before you can answer or comment on any questions.

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?

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) http://stackoverflow.com/questions/1482586/comparison-between-corona-phonegap-titanium

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

3) http://stackoverflow.com/questions/4217551/what-happens-to-javascript-code-after-app-is-compiled-using-titanium-mobile

4) http://stackoverflow.com/questions/2444001/how-does-appcelerator-titanium-mobile-work/2471774#2471774

2 Answers

The UI is compiled in native ObjC, but the logic behind is executed in the javascriptcore engine.

A), which is consistent with Dan's answer.

On Android, classes are compiled to bytecode and logic (your code) is streamlined and interpreted with Rhino, a Java-based JavaScript interpreter.

Your Answer

Think you can help? Login to answer this question!