29 December 2008

Update: Hello World iphone

KGelner pointed out that my Hello World iphone edition wasn't very good, looks like he was right. I did try to find an official edition. So I found this link: HelloWorldClassic, but it requires registration to access. And by registration, it's not just "get a login" it's "give us your home address". No thanks. Compare that to Android code, which is freely available without a login. I'm not positive, but I'd bet that the Agreement on the developer.apple.com site says that I can't copy and paste code from their site to my blog. Or risk running afoul of the Apple legal team. Anyway, someone posted this code in discussions.apple.com:

- (void) drawRect:(CGRect) rect {
* [UIColor whiteColor] set;*
* [@"Hello World" drawInRect:CGRectMake(0, 175, 320, 50)*
* withFont:UIFont fontWithName:@"Marker Felt" size:40
lineBreakMode:UILineBreakModeMiddleTruncation*
* alignment:UITextAlignmentCenter]; *
}

That looks much better, and not too far off from the Android version. There's something up with the withFont line in the original version, so that line might be incorrect.

22 December 2008

Video of Android Soft Keyboard

Here we are, the Android soft keyboard in action; wonder if he's heard of those things called "tripods". Sorry for the poor vid quality, first one I've found.

21 December 2008

Yeah, but will it run Doom?

Read about this on Adam Kinney's blog. This is a great proof of concept for light gaming on the Silverlight platform. Looks damn good. Wish there were some higher res versions of the video.

http://www.innoveware.com/quakelight.html (scroll past the fold for videos)

There are some versions of Quake running in Flash, but they aren't ports they're just an interface over the top of the Quake code. The Innoveware Quake is a port from C++ to C#. It's still in progress, no real demo yet.

Samsung + Android = Good

Looks like Samsung might be launching an Android phone next year.

I've been very happy with every piece of Samsung hardware I've owned, so this is a step in the right direction for me. Still, don't think I could live without a dedicated keyboard. A soft keyboard is on the way for the G1, we'll see what I think in a few months. But I think for anything other than SMS, it'll suck.

Looks like there's going to be an Android version of the Instinct on Sprint and the Omnia on T-Mo. There's rumors of a version of the Omnia heading to AT&T, so does that mean AT&T will have an Android-capable phone that's not running Android? That'll be interesting. And we'll have a phone that's now running WinMo that's being released as Android too. So will people be able to switch over on their existing phones?

The Omnia site lists an "Etiquette Mode"... hmm... I know some people who could really use that.

16 December 2008

Silverlight --> Windows

Just read the last post in Scott Gu's great intro to Silverlight. Great tutorial. But it was the last one that really shocked me: porting a Silverlight app to Windows. Seriously, very little work involved. I think if you knew what controls to avoid ahead of time you could make it almost seamless. Shawn Burke has a discussion here about why the transition isn't seamless now.

For my money, I'd start with Silverlight and port to Winforms. Basing that on the amount of jobs for asp.net devs vs. jobs for winforms devs. Expecting that trend to continue into the Silverlight world. There's also a big "why" for porting apps from Silverlight to winforms (WPF)? For line of business apps, if your connection to your db is down then having a WPF version of your app won't help you much. No network, no workie. And if your connection to your db is down so often that you really need to have a WPF version of your app, then you have a bigger fish to fry.

Now, if we're talking about a mobile app, then disconnected might matter, but we have many other issues to deal with as well, so it's a big conversation.

Also, got my "Nice Answer" badge on StackOverflow. Achievements for developers, whoop whoop.

15 December 2008

Hello Android

... or not.

Trying to get going on Android Development, and everything's going fine. But I'm not able to get to my coveted "Hello Android" due to this message:
"Connection Failure when starting to monitor device 'emulator-5554' : device (emulator-5554) request rejected: device offline"
So my emulator is offline. Hmm. It's a file in a directory, seems unlikely that it would be offline. Impossible really. Well the emulator did fire up once, so it can't be too broken. But my first impressions of Eclipse are quite good, it's a darn nice app for being free.

I thought this part of the tutorial was pretty funny (in reference to installing a driver file for the G1, on Windows this is the standard "Found New Device" wizard):
If you're developing on Mac OS X, it just works. Skip this step.
Vs.
If you're developing on Ubuntu Linux, you need to add a rules file:
Login as root and create this file:
/etc/udev/rules.d/50-android.rules.
For Gusty/Hardy, edit the file to read:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
For Dapper, edit the file to read:
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666"
Now execute:
chmod a+rx /etc/udev/rules.d/50-android.rules
I guess that's the Mac gestalt in action. Wonder what it's called on Linux? It's a sort of gestalt that's for sure. Shudder. Would watching someone type that in would give me schadenfreude? Look at all the big German words getting tossed around. Yes I had to look up the spelling. No I'm not putting in any umlauts.

Now compare the Android version of Hello World to the iPhone version:

Android:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
iPhone:
- (void) applicationDidFinishLaunching: (id) unused
{
UIWindow *window;
struct CGRect rect = [UIHardware fullScreenApplicationContentRect];
rect.origin.x = rect.origin.y = 0.0f;

window = [[UIWindow alloc] initWithContentRect: rect];
mainView = [[UIView alloc] initWithFrame: rect];
textView = [[UITextView alloc]
initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
[textView setEditable:YES];
[textView setTextSize:14];

[window orderFront: self];
[window makeKey: self];
[window _setHidden: NO];
[window setContentView: mainView];
[mainView addSubview:textView];

[textView setText:@"Hello World"];
}

Wow, just looking at the iPhone version makes my carpal tunnel flare up. Coming from a C# background, the Android version is a cakewalk. I'll reserve my "learn weird code" miles for F#.

Hello Android will have to wait, not sure what the deal is with that emulator. Google search was no help there.