Configuring Android SDK and Titanium Developer

Check out the new site at https://rkblog.dev.

Titanium Developer is a platform, application for developing mobile native apps for Android and iPhone OS (iPhone, iPad, iPod Touch) with JavaScript API and HTML/CSS help. This application "compiles" JavaScript code that uses this API to native code for Android and iPhone - no Java or Objective-C needed. In this tutorial I'll show you how to set up Android SDK and Titanium Developer.

Android SDK

To test Titanium mobile apps without a mobile device we need an emulator. iPhone emulator is only on Mac OS X with the XCode package. Android SDK is cross platform, so I'll describe this mobile OS. To install and configure Android SDK you have to:
  • Download the SDK package from developer.android.com and unpack it.
  • From the tools subfolder launch GUI configuration app - ./android (android.exe on MS Windows). In this app we can download SDKs for specific Android versions, and create emulator configurations and launch it.
  • In "available packages" you will be able to install packages for specific Android versions. If the app can't download packages - force HTTPS in the configuration:
    andrti1
    and install latest SDK release:
    andrti2a
    andrti2
  • In the Virtual Devices tab we can create emulator configurations. We need one for Titanium to reuse:
    andrti3
    We specify configuration name ("Target" as a name is needed for Titanium as it AFAIK looks for such configuration and reuse it), Android release (Target label), SD card size and optionally hardware support.
  • When we have a config we can launch the emulator:
    andrti4
  • Android SDK works, now we have to install Titanium Developer and make it work with Android emulator.

Titanium Developer

Titanium Developer is an application, platform that allows creating native mobile apps on Android and iPhone OS. It also can create cross platform desktop apps. The mobile API won't let you make multithreaded 3D game, but social, web powered applications are doable with this platform. For more details check , application showcase, or documentation.
  • Download Titanium Developer for you OS. For Linux untar the package and launch "Titanium Developer".
  • On first run it will ask for installation folder, and after that it will download initial packages:
    andrti5
    andrti6
  • After downloading you will have to register (or login if you already have an account):
    andrti7
    When you register/login you will be able to use Titanium cloud services and you will get nice update notifications.
  • Application is ready for work, so we star with creating a mobile project.
  • On project creation we select the Mobile type. Fill in the form and create the project.
    andrti8
  • If Titanium can't find the Android SDK - show him the path to folder with Android SDK.
  • Created project can be launched in emulators or packaged for release:
    andrti9
  • You write the code in code editor, IDE of choice. Titanium isn't a code editor. The code is where the project was created :)

Titanium Developer and Android SDK

Titanium mobile SDK is still beta and it needs some hammering to work with Android SDK.
  • Go to platforms folder in Android SDK. In it there should be folders with installed SDKs of Android releases like android-2.1. Copy the folder as android-1.5. Current Titanium SDK has some hardcoded paths to 1.5 Android :)
  • Create Android emulator configuration called "Target" (may not be needed in newer Developer SDKs, but IMHO it's needed now)
  • Launch Titanium Developer, open your project and go to Android emulation tab:
    andrti10
    On the bottom of the page you can set Android SDK version, screen resolution. Hit launch to launch the initial application.
  • Sometimes Developer needs to be restarted to work. Also if the Android emulator booted, but the app didn't try hitting the launch button once more while the emulator is running.
  • Filter option on the emulator page can show you exceptions or other errors made but Titanium or your app.
andrti11
RkBlog

Linux and programming, 22 February 2010


Check out the new site at https://rkblog.dev.
Comment article
Comment article RkBlog main page Search RSS Contact