First iPad app
March 22nd, 2011 by Brian | Filed under play.Wrote my first iPad application tonight. Took me longer to redo the signer cert and provisioning profiles than to write the code… but it was worth it.
I used Titanium Mobile which I’ve played with in the past.
The goal of this app is to teach my kids the positions on the baseball field.
Here it is in all it’s glory
var win1 = Titanium.UI.createWindow({
top: 0,
left: 0,
backgroundColor:‘#fff’
});
var webview = Titanium.UI.createWebView({
top: 20,
left: 0,
height: ’75%’,
url:‘./baseball_diamond.jpg’
});
var label = Titanium.UI.createLabel({
text:‘Where is Right Field?’,
bottom: ’50px’,
height:‘auto’,
width:‘auto’,
shadowColor:‘#aaa’,
shadowOffset:{x:5,y:5},
color:‘#900′,
font:{fontSize:48},
textAlign:‘center’
});
webview.addEventListener(‘singletap’, function(e) {
point = e.globalPoint;
if (point.x > 480 && point.x < 766 && point.y > 382 && point.y < 624) {
label.text = "Right!";
} else {
label.text = "WRONG!";
}
});
win1.add(webview);
win1.add(label);
win1.open();
Tags: appcelerator, ipad, titanium


Your blog is downright useful! Couldn’t sleep — stumbled into it. Curious, have you looked at http://rhomobile.com/products/rhodes/ ? It’s Ruby based. I was tinkering with that, but will now go and tinker with Titanium Mobile.
PS — I like how WRONG! is all caps, and Right! is not. SUch a dad….
Hey Sean, I looked at Rhomobile a long time ago and had written it off. I can’t remember exactly why, mighta been because I didn’t know Ruby back then. After looking at it again, I think I didn’t like how everything was uploaded to them. Probably a baseless fear, but it felt odd. The guys over at Appcelerator recently purchased Aptana, an Eclipsed based IDE I used to use, so I am a fan.
And yes, it’s more effective to yell WRONG! than Right!