“View Source” for Your iPhone

Mon 03 Mar 2008

After expressing my aggravation with not being able to view the source for an iPhone project I've been working on, a co-worker quickly found a cool little bookmarklet that allows you to "View Source" on the iPhone itself.

Of course, you can also get the User Agent Switcher for Firefox and enter the appropriate parameters to fake an iPhone, but in my case, for some reason I thought it was something specific to Safari. Turns out it was not, but nevertheless, the bookmarklet is still very cool for tracking down potential Safari-specific issues!

Working Around IUI Click Interception to Allow for Native iPhone Functionality

Sat 09 Feb 2008

For those of you who haven't checked it out yet, the IUI is a great library created by Joe Hewitt (the same guy who brought us Firebug) for creating iPhone-like web applications. Overall, I love how easy it is to create screens, transition between screens, submit forms via AJAX and much more. However, while working on my first iPhone-targeted web project, I came across an issue.

There a few special hrefs that can be used to launch iPhone functionality such as the Google Maps application (using an href that begins with "http://maps.google.com") or prompting the user with a dialog box that allows them to dial the linked phone number (using an href that begins with "tel:"). Since the IUI intercepts the click event on links and prevents their default behavior, it ends up overriding this functionality.

While I was searching the web for a workaround, I found a few sites that said that the IUI code had to be modified in order to make these special hrefs work, but they didn't say exactly how. So, here's my solution:

For all links that launch iPhone functionality that you don't want the IUI to override, assign them a type of "iphone" like this:

<a href="tel:9043430030" type="iphone">Click to dial the number</a>

Then modify iui.js. I'm showing the whole block of code, so you can see the changes in context, but the only changes necessary are to lines 174 and 175. I'm using version 0.13 in the example below, so your line numbers may be different depending on the IUI version.

  1. addEventListener("click", function(event)
  2. {
  3. var link = findParent(event.target, "a");
  4. if (link)
  5. {
  6. function unselect() { link.removeAttribute("selected"); }
  7.  
  8. if (link.href && link.hash && link.hash != "#")
  9. {
  10. link.setAttribute("selected", "true");
  11. iui.showPage($(link.hash.substr(1)));
  12. setTimeout(unselect, 500);
  13. }
  14. else if (link == $("backButton"))
  15. history.back();
  16. else if (link.getAttribute("type") == "submit")
  17. submitForm(findParent(link, "form"));
  18. else if (link.getAttribute("type") == "cancel")
  19. cancelDialog(findParent(link, "form"));
  20. else if (link.getAttribute("type") == "iphone")
  21. return;
  22. else if (link.target == "_replace")
  23. {
  24. link.setAttribute("selected", "progress");
  25. iui.showPageByHref(link.href, null, null, link, unselect);
  26. }
  27. else if (!link.target)
  28. {
  29. link.setAttribute("selected", "progress");
  30. iui.showPageByHref(link.href, null, null, null, unselect);
  31. }
  32. else
  33. return;
  34.  
  35. event.preventDefault();
  36. }
  37. }, true);

7 Simple Steps to Conserve iPhone Battery Power

Fri 25 Jan 2008

I learned the hard way that the iPhone's battery won't last long if you are careless with your settings. Use these steps to maximize the time between charges.

  1. Setup a Gmail account as a proxy for your other mail accounts so your phone will only have to check one place for all your mail.
  2. Set the Mail application to check for mail less often. Do you really need to check your email every 15 minutes?
  3. Turn off "Ask to join networks" in your WiFi settings.
  4. Set the brightness to a lower level or turn on Auto-Brightness.
  5. Turn off Bluetooth when not in use.
  6. Set a short auto-lock time.
  7. Turn off keyboard sounds.
  8. Bonus step - Stop watching so much YouTube! :)

Save Your iPhone’s Battery with Gmail

Mon 21 Jan 2008

Shortly after I got my iPhone, I set it up to retrieve my email via the Mail application that comes with the phone. I have three email addresses for various purposes, so I set each of them to check once every 15 minutes. What I didn't think about was how much battery power all that checking would use. I soon found out that this (in combination with a few other things) was causing my battery to last less than a day. An additional frustration was that I had multiple inboxes on my phone and had to flip between them when I received mail at different addresses.

My solution was two-fold:

  1. I set the Mail application to check less often, since, in reality, none of the email I receive is so important that I need to get it within 15 minutes. I set mine for 30 minutes, but you can set yours to whatever is comfortable for you.
  2. I setup a Gmail account to act as a proxy (Google calls it Mail Fetcher) for the rest of my accounts.

Gmail will allow you to check up to 5 accounts (via POP), which means that it will fetch mail from your other accounts (and delete it from the other server once it's done if you choose). The result is that you only have one place (Gmail) to check for all your mail.

Here's how you do it:

  1. Login to you Gmail account
  2. In the upper-right corner, click "Settings".
  3. Click the "Accounts" tab.
  4. In the "Get mail from other accounts:" section, click "Add another mail account".
  5. Enter the email address from which you wish to retrieve mail, then click the "Next step" button.
  6. Enter your username, password, and provider's POP settings (Gmail will give you suggestions. Usually, you can accept the defaults. If these don't work, visit your email provider's website for more information.)
  7. Make sure to check "Leave a copy of retrieved message on the server." if you don't want your mail deleted from your other mail provider's server. (You'll want to do this if you check your mail from multiple locations.)
  8. You will receive a message saying that you are now able to receive mail from the address you entered. It will also ask you if you want to be able to send mail from the address as well. If not, then select "No", click the "Finish" button, then skip to step 12. If so, then select "Yes", click the "Next Step" button, and continue to step 9.
  9. Enter the name you want others to see when you send mail from this address, optionally, specify a different reply-to address, then click the "Next Step" button.
  10. You will be presented with a screen telling you that you have to verify that you own the email address you are asking Gmail to send from. Click the "Send Verification" button to be sent an email to the address you have specified.
  11. Once you receive the email, click the link to verify the address, or enter the code provided in the email.
  12. Repeat for each of your accounts.
  13. Set up Mail on your phone to access only your Gmail account.
  14. You're done! Fewer accounts to check = more battery life and less confusion flipping through folders on your phone!

As an added bonus, Gmail has great spam filtering, so hopefully, you'll have less spam to sift through as well!

Related post: 7 Simple Steps to Conserve iPhone Battery Power

I Love My iPhone But…

Wed 17 Oct 2007

I've had my iPhone for about 2 weeks and I have to say that I absolutely love it! However, as capable as the iPhone is, there are a few areas where I feel Apple dropped the ball. More specifically, features that other cheaper, less technologically advanced phones provide, but are lacking on the iPhone.

MMS

When you receive what should be an MMS (picture or video) message on the iPhone, instead, you receive a text message asking you to go to viewmymessage.com and type in an alpha-numeric message ID and password. This means that you have to leave the SMS application to launch Safari and type in the address (or use a previously saved bookmark) to get to the site. Then you'd better have a really good memory or you'll have to flip back and forth between the SMS application and Safari to type in the message ID and password (it's different every time). Finally, after submitting your login credentials, you're brought to a page that shows your message.

I really like the way the iPhone shows text messages in a chat format, but Apple should have figured out a better way to handle picture and video messages.

Copy, cut, or paste

The iPhone is missing these functions all together. This makes the MMS situation especially painful when you have to type in the message ID and password. If copy and paste were available, entering a random ID and password might be a little more bearable.

Ringtones

Apparently, Apple decided that they needed to squeeze another $0.99 out of their customers to create their own "custom" ringtones. Basically, you have to pay $0.99 to download a song from the iTunes Music Store, then another $0.99 to convert it to a ringtone. The interface that Apple provides to do this has been described as "Garage Band-like".

Hey Apple, here's an idea: How about you let people use their own mp3 files that they've ripped from CDs they've already purchased, and if they need to edit them, they can use Garage Band?! I mean, come on, I could do this with my Motorola RAZR with no problem. Isn't the iPhone supposed to be far more advanced?

Tether using Bluetooth

Or should I say tether using any means! Again, I could do this very easily with my RAZR. The iPhone is a completely data and Internet-centric device. Why can't I do this?

Send text messages to multiple recipients

When selecting recipients in the SMS application, the iPhone only allows you to choose one contact for each new message. I did find a pseudo-solution at iphonefaq.org, which allows you to send a message to multiple recipients and gets around the fact that you can't send MMS message from the iPhone, but it is far from ideal. Ironically enough, this solution doesn't work as well for iPhone users as it does others. Recipients using iPhones will still be directed to viewmymessage.com.

Multiple pictures via email

The only way to send a picture in an email is to go to the photo in your photo library, tap on the icon in the lower left corner, and select "Email Photo". This will bring up a new email with the photo already embeded in the body. From within the mail application, there is no way to add another photo. If you return to your photo library and try to repeat the process, as soon as you select an album, it returns you to your mail message.

Third-party applications

I have to admit that I haven't really found any applications that I can't live without that aren't available via Safari as a web application. However, I think that this is something that Apple should allow. There are some applications that just don't work as well on the web as they do as a client-installed application. Hundreds of applications were created with the idea that they could be run on the iPhone, only to be broken by update 1.1.1. Once again, my RAZR would run third-party Java applications just fine.

P.S. If anyone has a solution for any of these problems that works on an unhacked iPhone, please leave me a comment.

Filed Under: Technology, Apple, iPhone | 1 Comment