Skip to content

Archive

Tag: Titanium

Titanium 0.7 has just been released, and some of the features do look rather exciting.

By far, the best new feature is PHP support, which adds a whole new dimension to Titanium development. It will also facilitate the porting of existing codebases and frameworks to Titanium apps, potentially increasing the market substantially.

Another great new feature is the introduction of native social APIs. You will be able to connect to Yahoo YQL, Facebook Connect and Twitter all from directly in a Titanium application.

There are a quite a few smaller changes, and while I have yet to confirm it, I have it on good authority that Titanium 0.7 also now supports native drag and drop functionality.

Things are really looking good and Titanium seems to be maturing nicely.

Share

In some exciting news from Appcelerator, they have launched Appcelerator University (or App U for short), which allow you to host training sessions for Titanium.

They provide all the materials you need, as well as extras like t-shirts and pennants. And don’t worry if you don’t know what to talk about, they also provide prepared presentations for you to use.

If anyone is interested in hosting or attending an event, or if anyone in the Cape Town area would like me to host such an event, please leave some comments. I would love to hear your views.

Share

I got contacted a few days ago by the Appcelerator Titanium team with some rather exciting news. Appcelerator are interested in hosting a Webinar on Titanium, particularly tailored to you, my readers, interests.

I would like to encourage anyone who is interested to leave a comment with when would suit you to hold it, and any topics which you would like to discus. I will then let Appcelerator know, and then we can organise it.

Hope to hear from all of you….

Share

I was very pleasantly surprised to find that Appcelerator Titanium has the ability to embed Flash objects into a Titanium window.

For a normal web browser, before the browser can display a Flash object, the Flash player needs to be installed as a plugin on the computer first. Titanium, however, has got the Flash player included already, which means that when working with Flash, you never need worry about showing a message asking the user to install the plugin before they can view the site. It just always works.

There are two ways in which a Flash object can be embedded into a page. It can either be done with an <object> tag, or using the Javascript swfobject object.
continue reading…

Share

Appcelerator Titanium is pretty free with what it allows you to do, imposing very few restrictions to access. One thing that I did find it did not like you doing is accessing the Titanium API from a remote HTML file.

A Titanium app can load a file into a window using either the HTTP or the APP protocol. The APP protocol is a Titanium specific protocol which tells Titanium to reference the local resource folder for the page to display.

The crucial difference here is that a page loaded using APP is allowed to access the Titanium API and make calls to it freely. Pages loaded via HTTP cannot.

This means that if you have an HTML page sitting on a webserver somewhere, and it contains a call to the Titanium API, it will not work if you load that page into a Titanium window. The page will work normally if there are no Titanium calls.

So, what do you do when you want to have code sitting on a remote server that you want to be able to run in Titanium?

There is a very easy way in which to accomplish this.
continue reading…

Share

A very useful feature of desktop applications is being able to browse the contents of a folder programmatically, which makes all manner of explorer type applications possible. Appcelerator Titanium makes this very easy to do.

Thanks to to mrobinson on the Titanium for pointing out the needed function in the API. I wasted several hours looking in the wrong place for how to do this.

The functionality to get the directory listing is found in the File object.

The example listed in the Titanium API is as follows:

   var win = Titanium.UI.getCurrentWindow();

   win.openFolderChooserDialog(function(folderResponse) {
      var file = Titanium.Filesystem.getFile(folderResponse[0]);
      var listing = file.getDirectoryListing();
      for (var i = 0; i < listing.length; i++) {
         alert('Name: ' + listing[i].name() +
            ',isDirectory: ' + listing[i].isDirectory() +
            ',isHidden: ' + listing[i].isHidden());
      }
   });

continue reading…

Share

Appcelerator Titanium enables you to show a dialog box to select files which you would like to save or open.

To open a SaveAs dialog box, we first set up the options object, and then call the function to open the dialog, passing it the callback function to call once it is closed.

  var options = {
     title: "Save file as...",
     types: ['*'],
     typesDescription: "All files",
     path: Titanium.Filesystem.getUserDirectory()
  }

  Titanium.UI.openSaveAsDialog(callbackFunc, options);

In types we put the file types filter, for example ['doc', 'txt]. The path is the default path to point the dialog to.

Next in the callback function, we can reference the filename which is returned as an array, which when saving a file is always going to be one element, but may be multiple filenames for an Open dialog.

   callbackFunc = function(filenames){
      var fileSelected = filenames[0];
   }

continue reading…

Share