Wednesday, April 20, 2011

missing images in iPhone using Titanium

Note to future self: If you build an app in Titanium -- do NOT create a folder in the images directory called 'iphone' to place iphone specific images there. They will show up in the emulator but not on the device. I ran into this a few months ago but didn't document the solution and just spent another 2 hours trying to debug it a separate time. Use any other name than 'iphone'!!!

Wednesday, April 13, 2011

Titanium createHTTPClient issue on Android

Setting up an Android app on Titanium, I was having problems getting a webservice using a signature. It was working fine on iPhone. Turns out that Titanium auto url encodes the url in an createHTTPClient.open() method -- thus sending a different string than the signature had hecked against -- and thus returning an error.

To fix it, do this:

var xhr = Titanium.Network.createHTTPClient();
xhr.autoEncodeUrl = false;

before you call the open() method.