Lost my iPhone

Just over a year ago, right after I quit my job, I bought an iPhone 3GS off Craigslist for development. I was going to be working on a project that did barcode scanning, so the iPhone simulator wouldn’t cut it. I had a feeling that a new iPhone was coming out, but it was either work a month and earn money or save the $325 and make excuses to why I couldn’t test the app; the choice was pretty easy. When the iPhone 4 came out, I bought one and kept my iPhone 3GS running iOS 3.1.3 for a testing device.

I made the mistake of letting my son (3 years old at the time) play with it and he quickly learned to use it to play music, see pictures, take pictures, and check the weather. He now calls it “his” iPhone and loves to listen to music on it (yes, I did set the volume limiter and selected appropriate music for him). The phone is amazingly durable and my son now listens to it with headphones when we’re in the car which is a huge improvement from us having to listen to his music on the stereo!

At least I didn’t actually lose my iPhone, but I doubt I’ll be able to get it back from my son anytime soon!

Fixing a problem I didn’t know I had (FaceTime)

Today my father was playing with FaceTime and couldn’t reach me which was odd as my phone was on and had WiFi access. My dad had tried earlier using my email address as well and when I looked at my iPad later, I saw a missed call, but it should have rang on my desktop. The number on my iPad was the number that my dad’s phone was initially given before he ported his phone number.

Ahh, a bell went off and after a bit of searching, I came across an Apple Support Article about this particular problem after porting. After reading this, it dawned on me why I couldn’t FaceTime from my desktop to my iPhone; I had ported my phone number to AT&T a few weeks ago (I was just forwarding it from Sprint since I got my phone last year). The quick fix was to turn off FaceTime and turn it back on again to get it to re-register with Apple’s servers. My dad did the same thing and presto, FaceTime worked.

However, I also forgot to setup FaceTime on the desktop with my primary email address (my Apple ID is not my primary email address). A trip to the FaceTime preferences on the desktop fixed that issue as well.

So, if FaceTime isn’t working, check preferences and turn it off then on again and it should work again.

As you can probably tell, I don’t use FaceTime much!

Spoiled by broadband or is it a necessity?

For WWDC, I’ve been staying at the InterContinental Hotel in San Francisco as it is close to Moscone West where the conference is being held. While the conference has WiFi throughout, having access in my hotel room is needed so that I can keep up with work before and after each conference day. Unfortunately with the hotel filled with geeks, the Internet connection goes from bad to worse at times. I’ve managed to sort of carry on a video chat with my wife twice, but that was when no one was around. The hotel apparently charges $60 for the week (the front desk said it was complimentary when I checked in) which is more than the full monthly bill for my home cable modem connection. My experience isn’t unique; my co-workers in the W hotel down the street have been experiencing the same problems. As compensation for the poor experience (after tweeting about it), one co-worker received a cheese plate. Personally I’d rather have a working connection than a cheese plate!

I can understand that WWDC occurs just once a year and the hotel has no interest in paying for excess bandwidth the entire year for the one week there are a bunch of geeks in the hotel. While the room has been fine, the quality of the Internet connection may be the deciding factor for people choosing a hotel.

I feel quite frustrated trying to do work with the slow access which is causing me basically to do nothing; it’s a good thing that I’m at a slow point in my project.

1334727069

Another WWDC

This week, I had the opportunity to attend Apple’s Worldwide Developers Conference (WWDC). I’ve been to a number of other WWDCs with the last one being in 2008. Things have changed significantly in the past years as the popularity of iOS (iPhone and iPad OS) increases. Unfortunately, I don’t think that the changes are for the better.

I’ve been writing handheld software for almost 17 years and been writing Objective-C software for around 10 years which now makes me one of the old timers in this game. In order for Apple to cater to everyone (all 5200 attendees), they have had to dumb down many of the sessions. In addition as indicated in the keynote, WWDC was going to cover Lion, iOS 5 and iCloud. With iOS 5 being released in the fall, it will be a long time before I actually get to use features in iOS 5, so I’ve sat through many sessions containing information about stuff I can’t use for awhile. Typically the apps I write can’t drop support for an operating system for about a year. (There are some cases where we can use newer features, but for the most part, we have to use the same features across all OS versions.) As my products are now requiring iOS 4, I can learn some of the information from last year’s conference.

WWDC has grown each year which caused it to sell out within hours this year. I was on top of things, so I was able to get a ticket. With all of these people clamoring to absorb all the informations they can, attendees end up waiting in lines for each and every session. This gets old quite quickly. Last year Apple put out the WWDC videos pretty soon after the conference and I hope they do that again this year; watching the videos may be as valuable, or even more valuable, then being at the conference.

The real value, for me, was hanging out with my co-workers and meeting other members of my group that I’ve only met by email. This, of course, is invaluable and there is really no substitute for it.

Will I be coming back next year? I’m not sure.

Trust in business

This week I’ve seen a number of “leaks” showing Lion and iOS 5 as well as people Tweeting about some of the information contained in WWDC sessions. Everyone that attends WWDC has to agree to an NDA (non-disclosure agreement for those not in the loop) and Apple stated everywhere that with the exception of the keynote, the content of the sessions was confidential and subject to the NDA. So, all these leaks are violations of the NDA. Besides what I’ve read on the web, the most flagrant violation I saw was someone taking a picture of the slide that said something on the bottom to the effect that photography was not permitted!

As Jason Snell tweeted a few days ago:

And with that, I declare the NDA completely dead. RT @daringfireball iOS 5 Screenshots and Tidbits at Engadget: df4.us/hqy

There are, unfortunately, no consequences to these NDA violations as Apple wouldn’t accomplish anything by suing the small developer. However, that is no reason to violate it as it won’t help any developer get ahead (I doubt the sites that have published information have paid the developers).

The first point of the Scout Law is “A scout is trustworthy”. I always try to live by this and this includes everything I have done in every aspect of my life including business and work. I wish that more people, especially those in my field, would take trust seriously.

More pitfalls to synchronous networking

Anyone that reads my blog or talks to me professionally knows how much I hate dislike asynchronous network programming. While working on rewriting some networking code, I came across a few more reasons why synchronous networking is a poor decision.

The first issue occurs when a developer abstracts the networking, then forgets that when the call is invoked, it actually makes a network call and does it on the main thread. Synchronous networking should never be done on the main thread. For instance, let us use the following made up example:

- (void) displayUserPreferences
{
	Preferences *prefs = [[Utility sharedInstance] getPreferences];
	if (prefs)
	{
		// Update the user interface
	}
}
- (Preferences *) getPreferences
{
	NSDictionary *dict = nil;
	NSData *result = [Networking queryPreferences];
	if (result)
	{
		dict = [self parseData:result];
	}

	return dict;
}
+ (NSData *) queryPreferences
{
	return [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.something.com/data.json"] returningResponse:nil error:nil];
}

In order to not block the main thread, the developer has to always make sure that displayUserPreferences is called on a secondary thread. While this may sound simple, forgetting to do this is quite easy especially for a developer that didn’t initially write the code. Another developer might think that getPreferences is a local call and doesn’t hit the network and therefore call displayUserPreferences on the main thread. This is, of course, a recipe for disaster.

The second issue isn’t specific to networking, but has to do with threading. In the above example, the “Update the user interface” code under the comment must run on the main thread as user interface calls can/will crash when run on secondary threads. It is far too easy to forget to use performSelectorOnMainThread to run the code on the main thread. Having to keep track of what can and can’t run on a secondary thread just adds confusion and inevitably will lead to mistakes. A simple call like:

[self.tableView reloadData];

run on the secondary thread for networking will cause a crash.

I’ve seen both of these issues in code and there really is no excuse for being lazy in writing networking code. Once you write a good networking class, it can be reused over and over; I’ve used a networking class I wrote a few months ago in 4 or 5 different projects. I wrote it once; tested it extensively and now reusing it is quite simple.

I’m tempted to file a radar bug to ask Apple to deprecate the synchronous call, but I know that they won’t do it. The synchronous networking call screams lazy and should be avoided in my opinion.

Authentication security in iOS apps

When I read a post that John Gruber wrote today about OAuth in native Twitter apps and how much of a poor user experience it is/will be, I had to dig deeper into the article. On first read of the article, I disagreed with him as I thought he missed a very important point about security, but upon re-reading it, he did identify one of the major issues with how OAuth (and other types of service authentication) is done on iOS, in particular.

Developers can alleviate some of the context switching by using an embedded web view inside their native app for the OAuth authentication handshake, but at that point, why not just use xAuth and simply allow the user to enter their username and password in a native dialog box? So long as you remain within the app, there’s no security advantage for OAuth in an embedded web view over xAuth…

This is something that most users are unaware of when entering their credentials in any iOS app. As long as you are in the app, even if the page says Facebook, Twitter, Dropbox, etc. and you’re not running an app from these companies, the app can capture your username and password. Some companies ship their libraries to developers in a form that doesn’t let the developer modify the source code, but that offers zero protection from a malicious developer that wants to steal usernames and passwords.

I’ve seen one application launch Safari, ask you to login to Facebook and when done, returns you to the app. From a security point of view, this is the ONLY way to ensure that the application doesn’t capture your credentials (provided that you trust that Safari isn’t stealing your credentials). Any embedded web view offers no guarantee that the app isn’t hijacking your credentials as the app can walk the hierarchy of views and grab info; in a kiosk I worked on, we presented web pages, but I modified the web pages before displaying to change the credit card field to a password field to mask the numbers; this type of modification of web data is quite easy when a developer controls the entire app.

Should you be worried? That all depends. Do you use different passwords for every service? If not, consider using 1Passwd. Yes, it may be a pain to enter the random password on a mobile device, but if some app got access to the password you use on all your sites, the risk is great. Are most developers honest? Yes, but bugs in the code could put your password at risk. Also when I tried out apps for Google Voice, I had some strange feelings about an app, so I ran my iPhone’s networking through Charles Proxy to see where the app was connecting; it was connecting to a site that wasn’t Google. I had no idea if my Google Voice password (which is my Google password for email) was going to some lone developer’s server. Based on the developer’s posting in various forums, I didn’t trust his app with my password.

Should users be inconvenienced by having an app launch Safari, enter credentials and then go back to the app? Personally, as someone a bit paranoid about security, I think it is worth the one time inconvenience (per app). The average user may not think this way. However, if the user was better educated in the app indicating that for security purposes Safari will be launched, that may mitigate the issue.

Surviving the spring storm

Yesterday, I was interviewed about the spring storm that was going to happen today. I found it pretty humorous that any storm in San Diego especially a spring “storm”, makes the news. Today the “storm” hit and it dumped so much rain that by 4 pm, the ground was just about dry and it was sunny! I went for a run and mistakenly wore a long sleeved shirt; it was far too warm for it even though the spring storm was supposed to bring cold air.

Why does weather in San Diego make news? People in other parts of the country laugh at us when we complain at the weather and the local news just make things worse by reporting ridiculous stories calling what we got a storm.

While I do complain about the weather, I do it jokingly and have used it to gently poke fun at my co-workers in other parts of the country.

My weather gripe has made me famous

Back in January, I posted about being a weather wimp. Today I was contacted by the local CBS affiliate about the entry wanting to know if I’d be interviewed about the big storm coming. I didn’t even know that a storm was coming, but I agreed to be interviewed. We did the interview over Skype as they wanted it for today’s news. Unfortunately, the only piece of the interview that made the news was one quote on their website and a split second shot of my blog. I guess the people that lived on Rainswept Way were more interesting than my rant!

Review: Alfred

When I saw Alfred available in the Mac App Store, I grabbed a copy and was pretty impressed. I’ve used a number of launchers over the years including Quicksilver, LaunchBar, Google Quick Search Box, and Butler. Each one has its strengths and weaknesses. The biggest downside I found to all of the launchers was the UI.

Alfred does basically the same thing as the other launchers, but the UI I find to be quite elegant. The free version of Alfred has handled just about all my launching needs as I’m primarily a keyboard person and the less I have to use the trackpad, the better (with some limitations). Just yesterday, I saw a new version of Alfred had come out and the PowerPack (£12) had some features that I found cool including entering Terminal commands and file navigation. I plunked down my ~$20 and have been happily using Alfred all day.

I really have no complaints about Alfred and find that it is easier to use and more visually appealing than its competitors.

Pros

  • Easy to use.
  • Clean user interface.
  • Preferences are easy to understand.
  • Quick Terminal command entry is slick. (PowerPack Only)
  • File Navigation is a quick way to find files. (PowerPack Only)
  • Clipboard history eliminates need for a separate app. (PowerPack Only)

Cons

  • Searching for files could use a bit more narrowing down. For instance, I want results from my home folder, but not in my Library folder.

Summary

Without buying the PowerPack, Alfred is well worth using. The user interface is clean and the application works well. Adding the PowerPack, if you need the extra features, is worth the small cost. I find that without a launcher of any kind, I spend far too much time looking for applications; I don’t like a ton of applications on my dock, so a launcher is needed. Alfred, for me, is the best of the current crop of launchers.

Everyone has a favorite launcher and switching launchers is much like the debate about which is better, Mac or Windows. Giving the free version of Alfred a try is a no brainer. If you don’t like it, go back to using another launcher.