Forging Titanium Episode 2: A Cross-Platform Navigation Controller

Editor’s note: This and future episodes of Forging Titanium are available here.

When developing cross-platform applications in Titanium, one of the challenges facing a developer is maximizing code reuse while still conforming to the UI conventions of the Android or iOS platform. In this week’s episode, we explore how we could create a hierarchical Navigation Controller, which would display a series of windows in an easily navigable stack. Be sure to join us next week as well, when further explore how to extend core Titanium UI components to create custom UI controls.

Oh – and a question. I did my best to add this “special” controller to a tab-based application. It was not difficult to add a native “IPhone” navigation controller, but I couldn’t figure out how to use your control together with tabs.

In all cases – first this videos are fantastic and a great help. And second exactly this control seems to me a basic feature to write cross plattform apps. Thanks a lot! Klaus

One thing i have found really weird is that I cant set certain items to the child windows. For example, I cant use the IPhone only tools to set a top right button in the test window. It only adds to the very first window and then I get a weird flickr effect in my other screens as I move between them.

I also found that I can create extra window classes that I have extended to do all sorts of things but without being able to set the refresh button and other controls Im a bit stumped as to how to progress.

Great concept however and Ill be using this and the ep003 heaps as a great way to extend functionality.

I am testing this sample from github to see whether I can use it as the basis for rebuilding an iOS app I already have for cross platform. Two lines of code require tweaking to make it work in Android, though it works as-is on iPhone.

I wonder if I’m using a wrong version of the Android SDK, though 2.2 is the only one with which I’ve gotten the sample to run.

In app.js, this change seems to be required by Android and works fine in iOs5: //open initial window controller.open(new TestWindow(>>this.<>exports.<<TestWindow(navController));

I am testing this sample from github to see whether I can use it as the basis for rebuilding an iOS app I already have for cross platform. Two lines of code require tweaking to make it work in Android, though it works as-is on iPhone.

I wonder if I’m using a wrong version of the Android SDK, though 2.2 is the only one with which I’ve gotten the sample to run.

In app.js, this change seems to be required by Android and works fine in iOs5: //open initial window controller.open(new TestWindow(####this.####controller));

Follow Us

What can we help you with today?

Let us know how we can help you today! We're ready to get down to business. To contact our sales click here or fill out the form below: Need support? Log in to our support portal for assistance.

Axway respects your privacy. Your personal data will not be shared with or sold to a third party (unless to Axway legal entities where you can find the list at "Contact us"). Please note that you can withdraw your consent at any time by clicking here.