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?
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! :)
-
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)
-
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.
-
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