Category Archives: Titanium

How to find your Google Plus ID

By | September 27, 2012

This is so simple 1. Go to your Google + account ( 2. Click on the Profile icon on the Left. 3. If you look at the URL in the address bar, it should look something like this: 4. The long numerical string in the URL is your Google+ ID. Here is CoderzHeaven’s from the URL above:… Read More »

Open a webpage in Titanium (iPhone or ANDROID).

By | May 4, 2011

Opening a webpage in Titanium is really simple. Look at the following sample. [js] function openWebpage(){ var URL = "" ; Titanium.Platform.openURL(URL); }; [/js] If you are running in iPhone then it will open safari and if it is ANDROID, it will open the default browser with the supplied URL String. Happy coding…….. Please leave your valuable comments.

Get a file from PhotoGallery and copy it to your directory in your project resources in Titanium(iPhone or ANDROID).

By | May 3, 2011

This example opens the photogallery and then when you select a file from it , it will be copied to your resources directory. First manually create a directory in your resources, here the directory is named “mydirectory”. Call this functiion inside a button click or something [js] var directory = "mydirectory" Titanium.Media.openPhotoGallery({ success:function(event) { var cropRect = event.cropRect;… Read More »

How to use tableView in Titanium, iPhone or ANDROID?

By | April 28, 2011

This tutorial shows how to create a tableview in Titanium and add data to it. How to handle a click function in the tableView and get the data from the row. [js] /* Create a new window */ var win = Titanium.UI.createWindow({ backgroundColor:’#336699′, backgroundImage:’images/bkg.png’, navBarHidden:true, tabBarHidden:true }); /* Datasource for the tableView */ var my_data = [ {title:’data1′},… Read More »

How to place a label or textBox or anyother control inside a tableView in Titanium, ANDROID or iPhone ?

By | April 26, 2011

Hi all…….. This tutorial is for Titanium users. This tutorial explains how to place a textBox or anyother control inside a tableView. A tableview requires data in the form of a array, so we create an array (here array is named “data_array“) by adding the controls like textboxes and labels inside it. You can give a large number… Read More »

How to load a PDF in Titanium?

By | March 3, 2011

Loading a PDF file in Titanium may be sometimes our requirement for an application. For loading a PDF we need to have a webview inside a scrollview so that it is scrollable also. Take a look at this simple example. /** creating a window **/ var window = Titanium.UI.createWindow{}; /** creating a webview **/ var my_webview = Titanium.UI.createWebView({… Read More »

HTTPClient in Titanium iPhone or ANDROID. How to check whether you request is complete?

By | February 10, 2011

[java] function sendRequest() { var xhr = Titanium.Network.createHTTPClient(); xhr.onload = function() { if(this.status == 200) { // this becomes true if your request is completed. } }; };‘POST’,’’); xhr.send({ ‘data’:data}); xhr.onerror = function() {‘error’); Titanium.UI.createAlertDialog({title:’Error ‘, message:’Please check your internet connection’}).show(); }; [/java]