Simple Remote Requests with Titanium Appcelerator

Titanium Appcelerator is a pretty nifty tool. Here’s a small data manager object that looked after my external requests.

I was tinkering with Appcelerator recently, and came upon the need to build a data manager to shoot off requests in a bit of a “fire-and-forget” sort of way. I created this global object I could channel requests into. My particular server always replied with JSON, so you can tweak this for whatever data your remote server will return.

Using this object in the global scope, you can just type:

Appcelerator has sped up development in key areas tremendously, but at the cost of some flexibility and code bloat. It’s worth keeping an eye on, as each release is leaps and bounds ahead of its predecessor.

Accessing local sites on VirtualBox

One of the most frustrating things about setting up VirtualBox for the first time is setting up a local host. It isn’t immediately obvious, and finding documentation was difficult. When you know how to get it running, it’s easy.

Here’s how:

1. Set up your VirtualBox image as normal.

2. On the networking tab, make sure you have the primary network adapter set to NAT

3. Boot your VirtualBox image and open your ‘hosts’ file using Notepad. This can be found at C:\Windows\System32\drivers\etc

4. Add your host entry as it is found on your main machine. In this example, I’m using the my site’s development copy ‘timneill.local’. See below.

5. Save the hosts file and enter your address into the browser. You should see your locally served site.

This was tested using Mac OS X and VirtualBox running WinXP. There is no need to flush the DNS cache for Windows after WinME.

If there are any problems, leave a comment or send me an email.