How does titanium work?

Source: Internet
Author: User

 
In a titanium mobile application, your source code is packaged into a binary file and then interpreted at runtime by a JavaScript Engine bundled in by the titanium build process.

In this guide, you will learn more about the Javascript runtime environment that your code runs in.

Titanium runs your application's JavaScript using one of two JavaScript interpreters-javascriptcore on
IOS (the interpreter used by WebKit) and Mozilla rhino on Android and blackberry.


Titanium takes your JavaScript code, analyzes and preprocesses itand then pre-compiles it into a set of symbols that are resolved
Based on your applications uses of titanium APIs. From this symbol hierarchy we can build asymbol dependency matrix that maps to the underlying titanium library symbols to understand
Which APIs (and related dependencies, frameworks, etc) specifically your app needs. I'm using the word symbol in a semi-generic waysince it's a little different based on the language. In iPhone, the symbol mapsto a true C symbol that ultimately maps to a compiled. o file that has beencompiled for ARM/i386 ubuntures. For Java, well, it's more or less a. classfile, etc. Once the front end can understand your dependency matrix, we then invoke the SDK Compiler (I. e. GCC for iPhone, Java for Android)
To then compileyour application into the final Native Binary. So, a simple way to think aboutit is that your JS Code is compiled almost one to one into the representative symbols in nativeland. There's still an interpreter running in interpreted modeotherwise things like dynamic code wouldn't work. However, its much faster, much
More compact and it's about as close to pure native mapping as you canget.

We're obviusly still got plenty of room to improve this and working on that. So farin our latest 1.0 testing, it's almoindist stinguishable from the sameobjective-c Direct
Code (since in most cases it's exactly mapped to that ).

Froma compsci standpoint, we can now however start to optimize things that a humanreally couldn't easily do that-much like the GCC compiler already does today.


Reference: http://stackoverflow.com/questions/2444001/how-does-appcelerator-titanium-mobile-work

Http://www.itwriting.com/blog/4198-is-appcelerator-titanium-native-and-what-does-native-mean-anyway.html/comment-page-1#comment-535303

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.