Well, this was my solution before this shorter way came along. A force of habit, really, since I noticed that it was Android's internal method of detecting captive portals. There's really no reason to use this over neverssl.com, other than the gstatic.com page returning an empty response (or redirecting you if you're actually behind a captive portal). Somewhat useful if you don't want to leave the new tab page.
www.gstatic.com/generate_204 should work fine; that's what I use regularly.
I just tried, and it looks like it'll still work after dropping www as well: