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:
- Getting Started with Appcelerator
- Appcelerator Application Project Structure
- Appcelerator Programming Guides
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 (@fusion94 and @chadauld 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 Kitchen Sink 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 TortoiseGIT for me) or just download the source as a ZIP or TAR.GZ.
- 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.