Titanium Developer Tips

Overview

First I want to start by pointing out that this Titanium Developer info will likely be moot in a short amount of time.  Titanium Appcelerator has recently acquired Aptana and is likely to release an IDE with deployment integrated, thus making Titanium Developer obsolete.  It should be tremendous for the workflow, but the beta isn’t due until March and there’s no certainty as to when it will be an official release.  So for the time being, let’s make due with Titanium Developer.

This isn’t a post on how to use Titanium Developer or develop apps with it.  For that information please reference Titanium’s own documentation:

Also remember that Titanium Developer is not an IDE, it is just a project and deployment platform.  For creating and editing content for your apps, you’ll need your own IDE.  I’d suggest one that specializes in HTML, CSS, and Javascript.  TextMate seems to be the weapon of choice for Mac based Appcelerator developers (among others) and there’s a bunch out there for other OSes, like Aptana, WebStorm, Notepad++, jEdit, and many more.  Obviously I’d suggest Aptana as that’s the new IDE of choice for Appcelerator.

OK, enough back story, here’s the things to consider when using Titanium Developer and some issues you may run into.  For reference, I was using Windows XP for Android development when most of this was uncovered.  I believe Appcelerator has a more natural focus on iOS workflow, so other Windows/Android developers will benefit most from this.   HUGE thanks goes out to Tony Guntharp and Chad Auld ( and respectively).  Without their help I probably would have quit Appcelerator before I got started.

Guide & Troubleshooting

  • First thing, be sure to follow the “Getting Started” guide completely.  Most issues that arise with Titanium Developer are a direct result of not doing one of the things specifically mentioned in this guide.
  • Make sure you installed the Java JDK (not just JRE) and that you add the JDK’s bin directory to your PATH environment variable.  If you don’t you are liable to run into some weird behavior in Titanium Developer including:
    • [ERROR] JDK version ‘javac’ is not recognized as an internal or external command
    • Your Run Emulator and Run on Device tabs may just appear as blank, grayed out panels
    • Other errors relating to compiling your application
  • Here’s some things you MUST have if you want the app to run on Android
    • Latest Titanium Mobile SDK (1.5.1 at the time of this post): you can download and install it through the status updates in the upper right corner of Titanium Developer
    • Kitchen Sink source code: Pull the source from Github for Kitchen Sink, don’t use the Downloads section.  The Kitchen Sink installed but would force close immediately after the splash screen finished on my Droid X when using the 1.5.0-update2 download.  You can use your favorite git client (like for me) or just download the source as a or .
    • Google APIs by Google Inc., Android API: You can download and install this using the Android SDK and AVD Manager that comes with your Android SDK installation.  It is available through Available Packages -> Third Party Add-ons -> Google Inc. add-ons

  • Android 1.5 is no longer supported and 1.6 is going to be end-of-lifed for Appcelerator soon.  They also have no yet dug into Android Honeycomb.
  • Titanium Developer projects can have problems deploying caused by artifacts of old builds, old Titanium SDK versions, or iOS/Android SDK changes.  Here’s a small list of brute force troubleshooting to try and get past these issues:
    • Uninstall apps before reinstalling: This isn’t often necessary, but it is a good first measure to take when getting deployment or execution issues with an Appcelerator app.  Think of it like your sys admin telling you to reboot before he digs into the real troubleshooting.
    • Restart Titanium Developer: see above
    • Try deleting and re-importing your project: This will ensure that all of your profile and project specific settings are being properly applied to your project.
    • Create a new project and copy your existing project’s content into it: Yeah, it ain’t pretty, but if the above doesn’t work this might help.  A fresh project will sometimes fix any corrupted project settings.
    • Delete the {PROJECT_PATH}/build/android and {PROJECT_PATH}/build/iphone folder: I’ve heard this advice but had no luck with it myself.  In fact I ran into even more errors when trying to emulate or run my project on a device.  Some, though, claim it will cause a full rebuild of your project in Titanium Developer and that it can often fix any build or deployment issues.  Try at your own risk.  I would make a backup of the directories you intend to delete.

Summary

While it may a bit of a bumpy road getting started, I have a feeling the investment in time will be worth it in the end.  If I was a patient person I would just wait until the new IDE beta came out and start working with he new, sanctioned workflow.  But I’m not a patient person.  Cross platform mobile development, with access to native components and near native performance, is just too cool to wait for.

6 Responses to “Titanium Developer Tips”

  1. says:

    Love the article. And yeah, there’s a lot that needs fixing; you shouldn’t have to need to do the voodoo with restarting TiDev.

    A quick tip with regards to deleting the build/iphone or android folders: Don’t delete the actual build/iphone or android folders, but remove their contents. That is, you want to leave an empty iphone and android folder in the build folder.

    It’s not ideal, but that *should* force a proper clean build.

  2. Armindo says:

    Hi Tony,
    I see that you have made a mod on suds.js on Github to use basic authentication.
    Can you provide a a few line of code of how to use it ?
    I have to pass the Username and Password…

    Thanks for your help.

  3. christian says:

    Do you know any developers looking for a side project replicating a web app for both android and iphone?

  4. @christian: you might want to check out DevLink at Appcelerator: http://developer.appcelerator.com/devlink

  5. David LaPointe says:

    I’m sure the people who wrote this page originally know this already, but just in case any readers haven’t figured this out, there is now an appcelerator IDE called Titanium Studio. It is based on Eclipse. So, if you wanted an IDE for doing appcelerator stuff, that’s probably the way to go. I don’t think Titanium Developer is even supported any more.

  6. Nope, it’s not supported by Appcelerator anymore and Titanium Studio is the way to go: Titanium Studio