Sometimes I find myself working backwards up a tree of errors to fix a problem. Today was a case in point.
Since I’ve been doing a bit of WordPress grooming, I have the development build checked out locally. Previously I had run phpunit against the unit tests included in the code, but for some reason when I tried to run things under NetBeans, it would error out (Bug 247704).
I decided I’d walk through creating a new app to replace one I’ve used for years on my iPhone that no longer appears to be maintained. The app in question is called GasBag which as near as I can tell stopped being updated in 2009 (see: http://blog.jam-code.com/).
I could just write a quick and dirty web app to store my mileage, but I figured I’d approach this as an exercise in building an iOS application with a design first approach.
At a high level, what I want is an app that easily captures my mileage, and allows me to save that information somewhere that won’t get destroyed. There are a number of features that GasBag had that I liked (for instance being able to send an email with my mileage information), and a number that it doesn’t have that would be nice (like allowing me to use it for multiple cars, or to do some data capture from a gas station receipt).
Alternatively, you can use the standard GMail settings, on the iPhone, but my favorite approach is to actually use the GMail app from Google in the App Store. The reason I like that app over the standard iOS mail app is that it is much more of a true mobile client that takes advantage of the platform.
You can do this either from your iPhone/iPad directly, or using the iTunes store on your Mac/PC.
Once you have the app installed, you need to set up your GMail accounts. Either tap “open” from the App Store page about GMail, or find the GMail icon and launch it.
On launch the app will prompt you to log into your account. For a Google Apps account, this will be the email your administrator assigned you like firstname.lastname@example.org, and the password that you’ve set up previously by going to http://gmail.com.
Launching the App the first time takes you to the login page, where you can type in your email address and password. Note that this is the same whether you are logging in to a GMail account or a Google Apps account, to Google they are just different users as far as mail goes.
Once you log in, you will be shown the inbox for that account, and be able to read your email pretty easily. To navigate the folders (like sent, draft, etc), you tap on the little icon in the upper left corner that looks like a box with stacked bars.
This will cause the folders and settings pane to slide out from the left and reveal your email structure so that you can choose. Clicking on a particular folder will display that list in the same fashion as you saw with the inbox.
Additionally from this screen, you can add other email accounts by tapping on the profile area at the top of the pane, which slides the list of accounts down and changes the direction of the panel indicator at the top of the pane.
If you’ve already done this, you will see the list of accounts, and each one will be badged with the number of unread messages. Adding a new account is as simple as tapping the large plus icon and logging in. Tapping on a profile picture will switch you to that account once you are logged in.
The little gear icon in the upper right of this corner brings up settings for you email where you can set a few things (such as vacation responder, signature, etc).
Once you log into the new account, you will again see the loading page, this time with the image from the new account’s name and profile image
The next time that you go to the account selection page, you’ll see a list of accounts with the icon for each badged with the number of unread messages showing so that you can easily see what needs your attention at the moment.
Google apps on the iPhone are a mixed bag, with some being native, and others not, so it’s also a good idea to set up the Apple “Mail, Contacts, Calendars” for synchronization of those things (which can use the Exchange push in the same way as an actual Exchange server).
First go to your settings (normally you can find this by clicking the home button on and looking for the gear icon that says “Settings”.
If you’ve previously added accounts, the “Add Account …” will appear below the existing account settings list (in my case I actually have to scroll in order to get to this button.
Tap on the add account button and you’ll be presented with the choice of types of account that you want to use. You can use GMail here, but I prefer to use Exchange simply because it pushes the information to the phone asynchronously
Once you tap on the Exchange button, you’ll get a new page that prompts you for the authentication information. This uses Microsoft’s autodiscover method to figure out how the account should be configured.
Type in the user name and password for your account here, and give it a description. Typically I use the name of the company that has the domain that I’m adding (for example PMI-SFBAC for my pmi-sfbac.org address).
Then click the “Next” button which should bring up the Domain screen. The only thing you need to make sure of is that the server ends up being m.google.com, and that you still have the right username and password. To continue, tap “Next”.
The final step is to choose what you want to be pushed to your phone. Generally the important ones are the contacts and calendars, since those are business related.
It really doesn’t hurt to have Mail turned on as well, since that keeps your inbox in the iOS Mail app up to date, but if you’re worried about your data plan, just set up the contacts and calendars, since that is the part that the GMail app won’t really be as helpful with.
I’ve made a slight change to the way I’m doing meeting minutes for standing meetings that I find helpful.
I am using a feature of OneNote that allows me to check off attendees a bit more easily.
It’s a bit of setup in the beginning, but it really works nicely once you have it done the first time.
Step 1: launch your meeting notes as usual from Outlook (by clicking the OneNote button on the ribbon). If you’ve installed the meeting template you’ll see something like:
Step 2: Now, because we haven’t figured out how to make the fields all flow into the right place in the template, a lot of the meeting information is actually way down at the bottom of the template. So scroll down until you see the meeting information (normally I just delete that). In this example, no attendees show up (I think because it’s not my meeting):
Step 3: Insert the meeting details by choosing “Insert Outlook Meeting Details” from the menu (Do this near the existing text in the notes so that you don’t have to scroll as much):
Step 4: Choose the meeting you want the information for from the list:
Step 5: Now you have a copy of the information for the meeting, including the attendee list (in the order it is in the invite):
Step 6: Copy the list of attendees to the Attendees section of the notes:
Step 7: Highlight the names and choose the “To do” tag from the tags list on the ribbon bar (or hit ctrl-1):
Step 8: Reformat the attendee list in whatever way makes the most sense to you (for long lists I typically split it into multiple columns):
Step 9: use this as the template for your roll call, click the check box for anybody who is in attendance, uncheck if they’re not. If your attendee list doesn’t change much, you can just copy the notes from a prior meeting and go forward with that.
It’s also easier for people receiving the notes to see who was actually there.
…Or how to brick your phone with an upgrade, and recover…
Earlier this month, Apple released the fifth beta of their 3.0 firmware for the iPhone. As usual, I raced to the site to download it.
I became very excited by the email that I got saying that submissions to the Apple store have to be compatible with iPhone OS 3.0, which to me means it won’t be long before this is a production OS. With that in mind, I strapped on my crazy cap and decided to upgrade my phone to beta 5.
After downloading the firmware and software for the new beta, I began the upgrade. According to the instructions, you needed the new beta of iTunes to do the upgrade, so that was the first thing that I installed.
Once that was ready, I followed the process that has become familiar to me for upgrading the phone:
After the backup click the “Restore” button while holding the option (alt) key.
Browse for the new firmware and watch things roll.
As it turns out, the mistake I made at that point was clicking the “Restore” button, later I learned that beta 5 won’t install unless you click “Check for Update” while holding the option key.
The first thing I noticed was that there was an odd cartoon that flashed up on the screen with a pink background. I figured it was some developer’s Easter egg, so I didn’t worry too much. After the usual series of minutes of resetting the phone and iTunes validating the software, the upgrade told me it was done, and I waited for the final reboot. This is typically the point at which the phone reboots, and iTunes detects it and activates.
Instead I ended up with an endless wait, as the phone never rebooted. So I went through the usual tricks to get it to come back to life. Eventually it worked, and I got a pink screen that showed the graphic you see with a new phone.
I plugged it in again, only to find that it wasn’t recognizing the phone (which after several tries led me to believe that the upgrade was not complete). Not only was the phone stuck, but I couldn’t seem to get it back into DFU to restore the software.
At this point it occurred to me that perhaps there was something nefarious going on: my phone had been jailbroken prior to the upgrade, so perhaps that was the issue. Luckily for me, I had my wife’s phone to play with, and it hadn’t been jailbroken, so I decided to try and upgrade it.
After downgrading the USB drivers on my Mac, I was able to get it into DFU mode, and restore the 2.2.1 version of the firmware. Inspired by this, I tried upgrading my wife’s phone on a PC (figuring the problem was something in the USB drivers). Sure enough, her phone loaded the 3.0 software just fine.
So, once again, I tried upgrading my phone, and couldn’t get it to go. I tried it on the Mac, then on the PC, same results both times. For some reason it wouldn’t work. I could downgrade to 2.2.1, but not upgrade to 3.0.
More digging on the internet, and I found a posting on the iPhone developer forums that talked about installing beta 4 then upgrading to beta 5 if you have an old silver back phone (both of mine are the metal backed pre-3g phones). I figured it was worth a shot, so I downloaded a copy of the beta 4, and ran the upgrade. Eureka! The beta 4 firmware upgrade worked !
At this point it had been a few days since I had my phone working, so I took a breath and decided to run with beta 4 for a while. I kept scouring the web and watching the discussion on the beta 5 upgrade problems to see what people were doing to get it to work.
In the mean time, I ran into an interesting (and scary) side effect of the USB driver downgrade. I forgot to upgrade the drivers after my successful downgrade of the firmware, not thinking that those drivers were actually for a different version of the OS. Whenever I plugged a USB stick into my machine, it would go into panic mode and shut down. I thought my hard drive was dying until I realized it only happened when I plugged in a USB stick, and remembered the driver downgrade. Upgrading to the current drivers fixed that issue.
Finally, I saw a post that talked about clicking the “Check for Upgrade” button while holding the option key instead of the “Restore” button. I decided to try this, and was amazed when it worked. So apparently, all along the secret was to use the upgrade button instead of the restore button. There’s some evidence that the reason this fails is because of part of the upgrade to the firmware, so it makes sense that there may be a difference in the way that iTunes processes an upgrade as compared to a restore.
At any rate, my current thinking of the process is as follows:
Download the firmware and iTunes beta
Install the iTunes beta
Dock the phone
Do a backup of the phone
Option click the “Check for Update” button
Choose the beta firmware IPSW file you downloaded
Be happy if it works.
If it doesn’t work, follow the link above to downgrade the USB drivers.
Go through a normal restore (should put you back to 2.2.x)
Repeat steps 5-7
Hopefully Apple will have this all figured out with the next release (and especially before the production update). As near as I can tell, this only affects the older phones, and doesn’t happen with the 3g iPhone.
I’ve been pretty happy with this iPhone OS, it seems to be quicker and more stable than the 2.2.1 was – still looking forward to the actual release.
Recently I downloaded the iPhone beta 3.0 firmwareupgrade and decided (without thinking it through) to update my phone to use the new version. In hindsight, Apple makes it pretty clear this is a bad idea, and warns you that you won’t be able to revert to a prior version of the software:
But warnings were meant to be ignored, so I blithely went ahead and updated with the new firmware. Immediately after doing so, I had a d’oh moment when I realized I better not have my business phone running on beta software, so I wanted to revert.
Well, this turned out not to be so easy, as soon as I tried to reload the prior version of software, I got to a place where the firmware restore would simply stall, and eventually fail.
I tried every version of firmware on my machine, including the beta, and my phone simply couldn’t be reloaded.
Just when I thought I was going to have to give up and take the phone to the Apple store, I remembered that jail breaking your phone involves a process of putting your phone into DFU mode (allegedly stands for Device Firmware Update, but I think it stands for Dumb Frantic User). In essence this does a hard reset of the phone and puts it back to a factory clean state.
Once I fired up PwnageTool, and ran through the process of jail breaking my phone (mostly because it has a step that helps you through the steps of getting your phone into DFU mode), the restore of the firmware worked again, and I was able to restore to the current 2.2.1 version of the firmware without any problems.