Categories: Top ::
About
Codejunkie
Monologues of a mobile retro coder.
skeezix[at]codejedi.com
www.codejedi.com
Subscribe
Subscribe to a syndicated RSS feed. I've
also made a Livejournal version and Ben whipped up an auto-RSS Livejournal
Blogs
Michael Mace
JoelOnSoftware
Bruce Schneier
Wil Wheaton
I, Cringely
WritingOnYourPalm
Dan Gillmor
GrandTextAuto
Freedom to Tinker
Mark's SysInternals Blog
A List Apart
Tam's Palm
Bytecellar retro goodness
DadHacker; epic rants.
Lost Garden
Bill Ing
Ben Combee
PocketGoddess
PocketFactory
ModApex
Random Links
PalmInfoCenter
Zodiac Gamer
GP32x
Little Green Desktop
Atari Age
Penny Arcade
Hack-a-Day
Retro Remakes
SHMUPS!
Podcasts
1SRC
RetroGamingRadio
Recent Entries
| July 2008 | ||||||
|---|---|---|---|---|---|---|
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | ||
Archives
I'm working on setting up an iPhone/iPodTouch development environment, and theres no better way to get your head around a beast than to just switch to the device as your 'main.' In my case this means moving away from my trusty several year old Treo 650 and attempting to use the iPhone exclusively.. for a little while. The iPhone as I've gone on about before has some revolutionary ideas - and a slew of seriously boneheaded ones.. but actually trying to use it day in and day out will certainly reveal many of the holes and nits in the platform which is the bread and butter of the 3rd party developer. Without a doubt it is slick, but it takes more 'taps' (and thus time) to do many common operations and certainly lacks the general flexibility.. but should be fine. And let me drop my media player .. freeing up a pocket in summer is a win!
The Treo line is a very good line of smartphones, truth be told; some models (such as the 650..) are buggy in the OS and prone to fits of crashing, but more or less have the most features (when counting 3rd party applications) of any smartphone. Basicly, as a looong time Palm OS developer I'd be a huge fan of the Treo line except for my general love-hate relationship.. the device invariable crashes and loses important recent calendar events when I most rely on them, but generally serves as a very good workhorse I've been abusing for years. Palm used to lead the mobile pack but has spent the last few years shooting themselves, the developers and losing the race... letting folks like Apple get back into the mobile ring after a decade being out of it. Anyway, thats another rant..
What to migrate
Anyway, to switch main smartphones, we invariably have to consider a few things -- moving contacts/addressbooks over, moving calendars over, and everything else. (Stored bookmarks in the browser, SMS history, ebooks you might be working on, music and video files, and so on and so forth.) For me, I cannot move to a new phone without bringing over contacts, calendar, and encrypted text (password database etc.)
First step - handheld to desktop
This should be an easy step. For a Palm OS handheld it should be as easy as a single hotsync button press and you watch in amazement as your data moves from handheld to Palm Desktop and/or MS Outlook. A Pocket PC should work the same way, but entirely to Outlook. But of course, we all know its not so easy and you sit in amazement as your data is systematically destroyed :)
In my case, I tried a number of options before getting really dirty:
The winning method took another day to come to mind -- using bluetooth to transmit to my laptop directly. Calendar -> Send Category -> All and poof, my laptop received the request. It didn't work really well, so I made sure to set my laptop to just store the file rather than trying to process directly .. and voila, I received a "vcs" (vCalendar) file with all my calendar in it, and another file for all my contacts. Awesome. Painful as hell to get, but awesome.
How to get Contacts into Outlook / iTunes
Naturally, most application don't want to take the vCard files correctly, but I imagine you could just hit File -> Import in Outlook to suck these in. In this case I am targetting the iPhone so I did it a little differently -- Run the Windows Address Book that no one even knows about: Start -> Accessories -> Address Book and import the vCard file(s) into it. Then just pull up iTunes and plug your iPhone/iPodTouch in and hit the Info page for it... checking off the option to Sync Contacts, and setting the source to Address Book. Done! Sucked, but at least not so bad once you know that trick.
Calendar.. the hard one.
I had to repeat a few times to get things halfway right, so I learned a neat trick up front -- should you wish to wipe out your calendar in Outlook (or a subset of it), a handy way is to just hit View -> Current, and pick All Events (or whatever it is), rather than the traditional Day/Week/Month view. This just shows a list of events, and you can (say) hit Ctrl-A to select All, Del to wipe them, and then Tools -> Empty the Deleted Items to clear them forever. With this, you can screw up and re-import over and over, and not end up with 35 copies of each event in your handheld.
Given the vCard files you can just hit File -> Import in Outlook to suck them in. (Be sure to pick vCalendar as your import source type, then change the file selector to vcs files, and away you go.) The hard part was getting the vcal file in the first place, so importing it 'more or less' works, sort of. At first I actually imported to Palm Desktop, figuring Palm would have tested that, but alas.. no really useful: the events show up, but without titles. All the titles show up as Notes, meaning you end up with 5 blank entries in Palm Desktop, when you have 5 useful entries in your Treo. Peachy. I'm not interested in hand fixing several thousand events up, either. Palm has a KnowledgeBase entry where they snidely remark that 'some applications might do this' (paraphrased), but it actually means.. Palm Desktop (and Outlook and everyone else.)
If you can work like that, fine, you're good to go. Me, I want something a little better..
vCard and vCal files are just textfiles with various fields detailing begin and end of record and so on, so I hit up Google and Wikipedia to find out the field meanings, and surprisingly the Treo 650 doesn't even include title text in the events.. just notes. So it never worked.. thanks Palm! One would expect the smarter systems would at least use the note as the title if the title is not provided, but neither Palm nor MS are that swift.
I also noticed the 'times' were always wrong; in my case, off by 4 hours. Could be a timezone thing, or a number of issues.. I reimported a half dozen times using the trick above while fiddling with time and timezone on the Treo and the laptop but no go.. always off by 4 hours. I tried hacking a timezone into the vCalendar files but Outlook and Palm Desktop ignore it. (Thanks again guys!)
Also, and most sadly, some meta-data is not in the files and not imported correctly -- repeats, alarms and such. I can deal with this mostly, but it does mean birthdays are a problem for us leaky minded people. (To fix this.. after you've done the whole import up to the point you can handle or care about, just do a search in Outlook for 'birthday' or whatever in list mode for the All category and you'll get a list of all matching events. step down them and set recurrence and alarms if you need. Sucks, but what can you do, and I didn't write a tool to do this for me yet..)
An evil hack
OKay, knowing that vCalendar files are just text, I thought I'd make a short little code hack to fix them up just enough that I can stomach the results. 10 mins work to make everythingthat uch better is worth it every time. The hack below is in Perl which pretty much every Unix and Unix-like OS comes shipped with these days.. be it Linux, FreeBSD, Mac OSX, Solaris, whatever. You can also get it with cygwin for Windows, or get a native Perl port for Windows.. look around. This hack takes a command line argument of a vCalendar file (a .vcs file) and spits out on the screen a 'fixed' version.. so I just run it like "./fixme-script.pl myfile.vcs > fixed.vcs" essentially.
The script does two main things -- it looks for the note field (DESCRIPTION) and repeats it out as the title field (SUMMARY); it doesn't cut it down in length, as most of my event titles are short and it didn't seem a problem for me. The job also adds 4 hours to the time (so a 5pm event will show up at 9pm in the file), since Outlook seems ot take 4 hours back off again. Theres probably a better way, but whatever.. this worked in less than 10 minutes.
Over-technical and lame, but it sure saved my bacon.. so heres to hoping it helps someone else too.
#!/usr/bin/perl
$filename = shift;
if ( ! $filename ) {
print "$0: Supply filename to vcs vcalendar file to insert SUMMARY lines into.\n";
exit ( 0 );
}
if ( ! open ( FOO, $filename ) ) {
print "$!: Couldn't open $filename\n";
exit ( 0 );
}
while ( $inline = ) {
# note, not dropping newlines here
# chomp ( $inline );
# just keep emitting lines as we get them; should we see a DESCRIPTION field
# we can summarize it and spit out a SUMMARY line immediately following, and
# proceed. No need to keep any state.
# do we see DESCRIPTION field tag at beginning of a line? Crom knows how they
# are escaped..
if ( $inline =~ /^DESCRIPTION:(.*)$/ ) {
# found a description; parse it down into a usable summary and spit that
# out; the regular line-emitter will then spit out the description as normal.
# Do we actually need to trim the desc down, or just copy it verboten?
print "SUMMARY:$1\n";
} elsif ( $inline =~ /^DTSTART:(.*)$/ ) {
# print "DTSTART;TZID=US-Eastern:$1\n"; # should've worked, stoopid Outlook
# looks like Outlook is ignoring timezone or otherwise corrupting time, so
# events are always 4h too early (9pm becomes 5pm); I guess I can just deduct
# 4h from each event (caution for events before 4am.. but there shouldn't
# be any, so I'll ignore it for this hack.) (caution for items after 8pm..)
print "DTSTART:" . fixdatetime ( $1 ) . "\n";
next; # don't emit DTSTART line again, so skip back to top of loop
} elsif ( $inline =~ /^DTEND:(.*)$/ ) {
#print "DTEND;TZID=US-Eastern:$1\n";
print "DTEND:" . fixdatetime ( $1 ) . "\n";
next; # don't emit DTSTART line again, so skip back to top of loop
}
# emit the line in as normal
print $inline;
} # while
close ( FOO );
# done!
exit ( 0 );
# support functions
sub fixdatetime {
my ( $dt ) = @_;
my ( $tdate, $ttime ) = split ( 'T', $dt );
my $thh = substr ( $ttime, 0, 2 );
my $tmmss = substr ( $ttime, 2, 4 );
if ( $thh < 5 ) {
print "ERROR .. do something.\n"; # just so I can see if it occurs
} elsif ( $thh > 19 ) {
# for this case, just let Outlook bump them down.. so what if 9pm becomes 4pm
# for now
} else {
# normal case, we bump them up 4h so Outloko can decrement them 4h agin..
$thh = sprintf ( "%02d", $thh + 4 );
}
# reconstruct the date-time
return ( $tdate . "T" . $thh . $tmmss );
}
[ Category: / technology / apple / iphone ] [link] [Comments]>
Apple: iPhone first impressionsA quick post here to bitch up some nagging thoughts. (Life continues to be busy with the packing and so on, but I'll try to post a few things :)
The Apple iPhone does feature an impressive interface, and anyone who suggests otherwise is a hateboi, but that UI really is just the appetizer - when it comes down to it, the main course has to stand on its own. As a long time handheld developer and user I can safely say .. this is typical Apple. Its minimalist and slick, hot and sexy, and when you get right into the gears.. its not as impressive as it looks.
Anyway, so here I sit considering using the iPhone as my mains so I can get a bearing on it for developing applications for Codejedi with it. But right at the onset -- it doesn't work with my headphones, doesn't accept my video files, doesn't sync in multiple locations and so screws up my calendar and address book options. Certainly, trying to migrate from any device to another is hard, but this is extra tedious.
As I've said for a year -- my 3 year old Treo does all these things. Sure its ugly in the UI, but it works. And crashes a lot, but fine, I have a backup tool. (Crom knows what happens when an iPhone crashes hard.)
[ Category: / technology / apple / iphone ] [link] [Comments]>
Apple: Way to go Apple, you mp3 player is the new PDATeething keeping us up half the night aside, my brain is a little more functional today. I thought it very interesting when Apple announced the iPod Touch -- an iPod (mp3 player) with a large touch screen, a pile of storage, and good multimedia abilities. Despite the fact that PDA sales have been punished severely the last few years (and the whole product class being ignored by the manufactuers like Palm, Dell etc), Apple has just created the next PDA.
Apple for all their greatness and faults is pretty fearless these days, and they've demonstrated time and time again a willingness to take an aging concept and attempt to revitalize it, just as they've done most recently with the cell phone. We can be sure Apple knew they were just buffing up the iPod, but sneakily hoping to enter the PDA marketplace from the side..
I've not really looked into the iPod Touch specification to know how its data entry will work -- is the touchscreen simply for yes/no and kicking up applications and picking songs, or will the device feature an onscreen keyboard like the iPhone does? I doubt they will take on a grafitti-like stroke solution for fear of being branded a PDA and losing their core music-loving tech-fearing community. Regardless, the unit does feature a calendar and addressbook (with synchronization via iTunes) and media playing, which as everyone in the PDA industry knows.. account for eight tengths of what that gadget set are used for. Perhaps Apple has nailed it -- sticking to a minimal core of the highest demanded features and yet staying closed to shun the other uses will let them recapture a lost marketplace. People already carry iPods and phones, whereas carrying a PDA and phone is redundant in so many peoples minds.
Naturally, as with the iPhone, the devices are closed (for now) to developers.. more or less. No iMail port sure opens up an angle for developers to make a buck with, and gaming of course.. but I'm sure Apple will make some strategic partners (Bejewelled on yet another device), and open up web applications if.. confirmed - yes, the iPod Touch will include wireless. Sweet.
It'll hopefully be sold in Canada, even..
Way to go Apple .. while everyone else dropped the ball literally for years, as I've so often lamented and ranted about - you've picked it up again.
Please don't lock us developers out. We like to nibble on your pie.
[ Category: / technology / apple ] [link] [Comments]>
Apple: How to make disk image files (.dmg) from the command lineOn my development Mac (a G4 tower from a few years ago - when the G5's were announced, the prices on G4's dropped by 1/3rd overnight - how could I refuse?) I run Mac OSX 10.2. I've often considered upgrading to 10.3 or 10.4, but in the end I do almost all of my work through my laptop (as a gateway to my other two development boxes) so don't really need the update. Further, as a developer, I find it wise to hang back on versions so that your dev environment shares more with the average user than the bleeding edge user. Anyway, people tell me that 10.4 is a bad update and to stick with 10.3, so I might as well stick with 10.2 right?
Of course, Shadow Plan development marches ever on and I release Shadow Plan updates as .dmg files to make installation of the desktop components a breeze - just drag and drop or even run-from-disk-image. Creating .dmg files from the command line is a little screwy though, so I thought I'd note it down here in case anyone needs to know. Read on, spiderfriends.
[ Category: / technology / apple ] [link] [Comments]>