Skip to content

appcelerator Titanium Framework

Generate JSDoc file for your IDE

To get auto-completion for the Titanium framework, you have to let your IDE know of all available methods and properties. Most IDEs can do this by parsing a JavaScript file. If you add JSDoc tags to it, you will even have descriptions, parameter hints, etc.

For more information about JSDoc, take a look at these links:

My very first try was with the 0.8.3 API and I created a JSDoc tagged JavaScript file by hand. The file is still available here: titanium.js

Now there's a file apicoverage.json available from the Titanium Mobile Git repository which contains names and descriptions of all the functions. You just have to get this into JavaScript code for your IDE to understand.

I wrote a Python3 script, which parses the JSON of the apicoverage.json file and generates a dummy JavaScript file for your IDE. To get that file, first run:

wget -N http://github.com/appcelerator/titanium_mobile/raw/master/site_scons/apicoverage.json

After that, download this script, put it into the same directory and on Linux make it executable (chmod a+x genapidoc.py):

Now you only have to run this command:

genapidoc.py > Titanium.js

or on Windows run this (make sure you installed Python 3.x.x):

python.exe genapidoc.py > Titanium.js

Problems in Linux

Doesn't start on Lucid

If Titanium Developer doesn't start on Ubuntu Lucid complaining about /usr/lib/libgtk-x11-2.0.so.0, go to $TITANIUM/runtime/linux/1.0.0 and delete the files libgobject*, libglib*, libgio* and libgthread*. Maybe repeat that in older versions of the Runtime.

See support.appcelerator.net.

Can't install to device

If you can't install apps to your device connected via USB, check the list of attached devices running the following command (from the Android SDK):

$ ./adb devices
List of devices attached 
????????????    no permissions

If you get a device listed as ???????????? no permissions, do the following:

$ sudo ./adb kill-server
$ sudo ./adb start-server
$ ./adb devices
List of devices attached 
HT9CVPxxxxxx    device

See this thread for details.

Trackbacks

blog.mbirth.de on : Develop iOS Apps

Show preview
real Apps XCode appcelerator (write in JavaScript, but gets natively compiled to standalone apps) currently my weapon of choice for iPhone+Android development, needs a Mac with XCode though for the iPhone part see appcelerator Titanium Framework Pse

Comments

Display comments as Linear | Threaded

Joacim Boive on :

Brilliant stuff!

Didn't work with the default Python installation on Mac (Snow Leopard), but that's not the fault of this script but because of the old Python version (2.61).

Upgrade to the latest version (I used 3.1.2) from here:
http://www.python.org/download/releases/

To use the new version on OS X:

Open terminal
python3 genapidoc.py > Titanium.js

Keep up the great work!

/J

Joacim Boive on :

The api at github.com is the old 0.8 as far as I can tell. I do know it's missing a lot of methods and function from 1.3 at least. I checked the original apicoverage.json file to verify this.

The updated api.json is available from: http://developer.appcelerator.com/apidoc/mobile/1.3/api.json

However... Your script doesn't work with this new version as they've seem to have reworked the structure totally! In my humble opinion the new structure is incorrect as it's too flat (no parent/child relationship between objects in the JSON, ex; Titanium & Titanium.API instead of Titanium{ API{

Could you please rewrite your script to make it work with the latest version?

Keep up the great work!

/J

Chris on :

Maybe this idea could be added to http://github.com/appcelerator/titanium_mobile/blob/master/apidoc/docgen.py so it's becomes part of the project & anybody can use the latest API with their IDE?

jhaynie on :

might want to check out

http://developer.appcelerator.com/question/30751/hacked-together-quick-script-for-13-autocompleteion

mh on :

the py file to download doesn't download...

Add Comment

Markdown format allowed
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Form options