Part Four – Installing the Android SDKs and Appcelerator’s Titanium Mobile Developer
Hello and welcome back for part 4 (hopefully the last part!) of how to setup Appcelerator Titanium Mobile Developer on Ubuntu 1010 32-bit. These steps should also work with Titanium Desktop Developer, although you would have to downlaod that instead of the Mobile version, and probably would not want to add the Android SDK. In this final part we will add the Android SDK’s and finally install Titanium, in the previous parts we have configured a clean Ubuntu 10.10 installation so that all dependencies for Android development are installed and ready to go before we start coding. I got destracted and have started another post about getting The Elder Scrolls Arena and Daggerfall working on Android the last couple of days (should have a post on that a day or two after this one is up). And, off we go, lets get this post finished!
- sudo mount -a – make sure our shared drives are properly mounted
- let’s download the Android SDK and AVD Manager! – http://developer.android.com/sdk/index.html – The currently available download is android-sdk_r10-linux_x86.tgz, if you are using the default firefox that installs with Ubuntu 10.10 it will save it under ~/Downloads if you want to save a step, don’t save it, just open it with the archive manager and extract the contents to ~/Downloads.
- back to our friend the terminal sudo mv ~/Downloads/android-sdk-linux_x86/ /opt/android-sdk/ this will allow you to move the SDK plus AVD manager to the /opt directory, remember to use the [tab] key!
- cd /opt/android-sdk-linux_x86/tools/ && sudo ./android – this will move us into the directory and launch the AVD manager
- select Available Packages from the left column
- click the arrow next to Android Repository, this will expand the currently available choices
- I will be starting with 2.1; however I will also add 1.6, 2.2, 2.3.3, and 3.0 SDKs at this time, (you need 1.6 because Titanium looks for it by default and won’t let you set your preferences without it) also I am getting all of the samples, as there is no reason to reinvent the wheel, just the method used to turn it!. I also went under third party and grabbed the google api’s for 1.6, 2.1, 2.2, 2.3, 2.3.3, and 3.0 for the same reason, while under the third-party section, make sure to get the two google market Apis at the bottom. I also retrieved the Api 11 documentation (Android 3.0) (if you are interested there is also a samsung galaxy SDK there, but it is only for Android 2.2r1 for some reason)
- click on install selected and a new screen pops up
- click the “Accept All” radio button and hit install, this might take a bit… mine downloaded at 2.0 – 2.5mb/s so it was under 5 mins to d/l all of it
- You will be prompted to restart ADB, you must do so to continue. then close the application window.
- vi ~/.profile – edits your start up preferences
- [ctrl+f] [ctrl+f] – moves you down two pages, or in this case to the last line of the file
- A – starts editing the line from the end
- :/opt/android-sdk:/opt/android-sdk/tools:/opt/android-sdk/platform-tools – adds the android SDK directories to your path
- [esc] – ends editing and returns you to command mode
- :wq! – saves, then quits the vi editor
- sudo ln -s /opt/android-sdk/platform-tools/adb /opt/android-sdk/tools/adb – also needed for titanium, until they update to reflect the new home for adb!
- cd ~/android/environment/system && sudo wget http://www.appcelerator.com/download-linux32
- go to the Places pulldown menu in Ubuntu –> home folder
- then when it is open go to android –> environment –> system
- right click on the file download-linux32 and selct extract here – when I tested this, the extraction failed, when I went to the website and followed the prompts to get to the download, it downloaded the same file from the same server path and it was the same size, but the extraction worked. just an fyi if you have issues with these steps
- cd Titanium\ Developer-1.2.2 && sudo ./Titanium\ Developer – again remember to use the [tab] key after typing the first couple of letters
- on the installer screen, click on the “Install to my home directory” and change it to “Install to /opt/titanium”
- click Install
- after this ends you should get dumped to the terminal window with an error, so now we will fix that error
- cd /opt/titanium/runtime/linux/1.0.0 && sudo mkdir backup && mv libg*-2.0.* ./backup/
- cd ~/android/environment/system/Titanium\ Developer && sudo ./Titanium\ Developer – use that [tab] key!
- after you log in, or sign up, you should get prompted for an update to 1.6 (no idea why it downloads 1.2.2 instead of 1.6 to begin with, but hey, what can you do?), go ahead and get it, remember to install it to /opt/titanium
- after which you will be prompted for an update to 1.1.0 for the desktop developer, grab it if you intend to write anything for windows or linux, else, ignore it.
- now restart to make sure all settings changes have taken, remember to skip mounting the two bind mounts on startup
- sudo mount -a
- cd ~/android/environment/system/Titanium\ Developer-1.2.2/
- sudo ./Titanium\ Developer
Congratulations, you are now setup to work projects! I recommend leaving the snapshots for a bit, just in case you have issues. And of course, TAKE A NEW SNAPSHOT NOW!!! the last thing you want to do is screw something up at this point and have to go back… Also, since we have our dev env setup on a share from your local system, you can revert to this point at any time and still be able to pick right back up (I have not tested this yet!!).
I want to thank anyone who takes the time to read this, especially if you leave me comments, or tell me where I screwed up! It would be nice if someone comments about the app they create using this setup even!