Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

How to optimize the size of Titanium based iPhone App?

I have created a iPhone App using the Titanium Framework. The app has totally 4 screens. I do not use any database at all. But my application size seems to be around 5.7 MB. Is there any way to reduce the size of the application?

— asked November 18th 2010 by Radhakrishnan Selvaraj
  • iphone
  • size
0 Comments

4 Answers

  • As mentioned in other answers, code has already been committed to 1.5.X that makes the Titanium pre-compiler much more effective. The pre-compiler takes the JavaScript code you have developed and optimises it by removing whitespace, reducing symbols' size etc and then creates a dependency hierarchy of only the Titanium APIs used by your application.

    The enhancement was tracked in ticket #685. In fact, Marshall only moved it to fixed-in-qa status two days ago, so it's quite a coincidence that you brought the subject up! :)

    — answered November 19th 2010 by Paul Dowsett
    permalink
    1 Comment
    • Thanks Hal H

      — commented November 19th 2010 by Radhakrishnan Selvaraj
  • Thats because every titanium module is compiled with it. In the nex release (1.5.0) the size should be reduced (if i'm correct)

    — answered November 18th 2010 by Jacob van Dam
    permalink
    2 Comments
    • Hi, But the KitchenSink app is roughly 6.7 MB. What could be the reason?

      — commented November 18th 2010 by Radhakrishnan Selvaraj
    • As Jacob said, most of the big size is because every Titanium module gets loaded with every app. The code, a few or alot of windows for example doesnt affect the size that much.

      So thats why the size of your "small" app and Kitchen Sink "the big app" is almost the same.

      — commented November 18th 2010 by Fredrik Nordlund
  • Check your resources folder and get rid of everything you're not using. I had some Photoshop PSD's that I had in a project for design purposes and my app was huge. Moved these to another folder and it shrunk.

    — answered November 18th 2010 by Josh Lewis
    permalink
    0 Comments
  • Just before publishing an app, I copy all of the resources to a new place, delete the project, and re-create it from new. My thought is that perhaps Titanium doesn't do a full "distclean" type of rebuild and there might be stuff hanging around from previous builds. Try this, it might help, and can't hurt (as long as you're careful not to delete all your code…)

    :)

    Todd

    — answered November 19th 2010 by Todd Trann
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.