{ Category Archives }
Mobile
Google Android G1 APN Settings for AT&T / Cingular, First Impressions
I got an unlocked T-Mobile G1 today. Woo. There is a bunch of mis-information out there on blogs and forum about how to get the phone set up. Here’s the real deal, I found these settings on Piaw’s Blog.
Name: whatever_you_want_the_name_to_be APN: wap.cingular Username: wap@cingulargprs.com Password: cingular1 MMSC: http://mmsc.cingular.com MMS Proxy: wireless.cingular.com MMS port: 80 MCC: 310 MNC: 410
Now, on to my first impressions of the phone.
Works:
- Calling works.
- Google contact import works.
- Google Chat works.
- EDGE data works.
- WiFi data works.
- Keyboard works. It rocks
Doesn’t work:
- AOL Chat does not work. Complains it can’t read my mobile number from my SIM card.
- 3G data does not work. I read that the phone doesn’t support the 3G band used by AT&T.
Works, but not well:
- The browser works, but it sucks compared to the iPhone. Feels very slow. I was expecting a lot more given that it’s using MobileSafari/WebKit.
- Video download/playback works. The player was branded with the YouTube logo, so I’m guessing it only supports YouTube out of the box.
- The UI feels clunky at first. Sort of feels like Nokia S60, too many menus and inconsistency in how different tasks are done
iPhone 2.0 User-Agent string, other iPhone/iPod data
I was preparing a report on iPhone locales from some web server logs, and noticed a few oddities. Some of the hits appear to be coming from the new 3G iPhone 2.0, check out the User-Agent strings:
# observed from 1 metrocast.net (NY) IP Mozilla/5.0 (iPod; U; iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.17 (KHTML, like Gecko) Version/3.1 Mobile/5A240d Safari/5525.7 # observed from 1 optonline.net (NY) IP Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A345 Safari/525.20
The former is confirmed to be an iPhone 2.0 User-Agent string on the MacRumors Forums.
Other unusual/rare iPhone/iPod User-Agent/UA strings:
Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A102 Safari/419 (United States) Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3 Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Cydia/1.0.2460-59
Update July 11. iPhone 2.0 is out, and the UA is (note the Safari revision increment from the earlier pre-launch UA):
Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A345 Safari/525.20
While the iPod with iPhone 2.0 software update UA is:
Mozilla/5.0 (iPod; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A347 Safari/525.20
Note that both the upgraded iPod and the iPhone UAs both contain the string “iPhone” in them, so you may need to update your device-detection logic if you care about discriminating between iPods and iPhones. Not yet clear to me how to discriminate between an upgraded iPhone 1.0 w/ 2.0 software, and a bona fide 3G iPhone 2.0. Will post more when I figure this out.
Know anything else about these? Leave me a comment!
new R package: getopt
I just uploaded the getopt package to CRAN. This will make it easy to use command line options with Rscript #! “shebang” scripts. It’s pretty much like what is available in every other programming language (getopt.h in C, Getopt::Long in Perl), but oddly was not yet available for R. So I wrote it!
Example usage, to print a sampling of a random normal variable, you might make a script named ./rnorm that contains:
#!/usr/bin/Rscript library('getopt'); opt = getopt(c( 'verbose', 'v', 2, "integer", 'help' , 'h', 0, "logical", 'count' , 'c', 1, "integer", 'mean' , 'm', 1, "double", 'sd' , 's', 1, "double" )); if ( !is.null(opt$help) ) { self = commandArgs()[1]; cat(paste("Usage: ",self," [-[gh]] [-[-mean|m] <mean>] [-[-sd|s] <sd>] [-[-count|c] <count>]\n",sep="")); q(status=1); } if ( is.null(opt$mean ) ) { opt$mean = 0 } if ( is.null(opt$sd ) ) { opt$sd = 1 } if ( is.null(opt$count ) ) { opt$count = 10 } if ( is.null(opt$verbose ) ) { opt$verbose = FALSE } if ( opt$verbose ) { write("writing...",stderr()); } cat(paste(rnorm(opt$count,mean=opt$mean,sd=opt$sd),collapse="\n")); cat("\n"); q(status=0);
and can be called, e.g., like:
blink:/tmp allenday$ ./rnorm -s 10 -c 10 --mean=100 --verbose=2 writing... 80.2953014070924 109.36715703278 104.856588724070 97.7983406914681 102.163515767212 90.7613417541473 97.8344921793064 108.918662445162 100.725143995218 105.285435884127 blink:/tmp allenday$
Yay! It’s a trivial example, but this can get pretty powerful once you can start passing in data files, reading from pipes, etc. I have some more example code for doing that, but it’s not getopt related so I need to dig it up.
Ok, I seriously need to get a syntax highlighter installed on this blog. Anyone have a recommendation? Isn’t there an enscript plugin for wordpress?
Update: I installed wp-syntax. There is no R support, but the C highlighter seems to work okay… wonder what it will do if I start doing the funky <- left arrow assign syntax…
Moving the blog, more on streaming to the iPhone/iPod
Moving things over here from over there. The blog is not well-established so I doubt anyone will care, and this URL structure lets us bring Jordan onto the primary domain.
If I don’t get around to migrating the only useful post on the old blog, check it out, I managed to trick the iPhone to play internet radio. Yes, that means live broadcasts. iPhone can stream live video too, but I’m not ready to show it off just yet. I suspect this technique has some legs — Apple wouldn’t want to let their cash cow loose anytime soon, would they?
Streaming Audio to iPhone & iTouch

I’m going to refer to the iPod Touch as the iTouch when I write, it’s easier.
Anyway, I bought an iTouch earlier today, or rather TinyTube bought one b/c there are a lot of Apple mobile user-agents showing up over there. We want to be able to test for the Apple devices, but there are no good iPhone emulators available that I’m aware of.
I figured out earlier how to stream video to the iPhone, and it turns out that the iTouch works the same way. Easy. Basically it uses the Range: HTTP header to buffer chunks of the file for playback. It’s progressive streaming the video. Audio files work the same way. I’ve been able to get this to work with MP3 files, but not (yet) AAC files. Great, so we can stream audio files off our server to the iTouch.
But what about MP3 net radio, does it work? Nope. I tried surfing over to Shoutcast on the iTouch and using the .pls files there to stream. No go. Looks like the iTouch doesn’t understand how to parse .pls or .m3u files. I then tried ripping an Icecast URL directly out of a .pls file. Again, no go. Looks like the iTouch doesn’t understand Icecast protocol either.
Hmm… but it is able to stream static audio files okay. So, is there a way to trick iTouch into treating the Icecast stream as a static file? Of course the answer is yes, and my next technical post will cover some of the details on how to make it happen.
For now you can just listen to the result, it’s serving up the “Groove Salad” station I found on Shoutcast. Hit this on your thing: http://sparkle.wooly.org/cgi-bin/iStream.






















