Tag Archives: iphone

Mobile phone networks can break your website

Sometimes my day job throws up some weird problems. Recently during development of a web app iPhones suddenly stopped loading the JavaScript file. No matter how far we rolled back the code it would not load. Other phones were fine and it had worked on the iPhone in the past. Eventually we found that the problem, of all things, was the mobile network! We only found this out because the JavaScript worked on Wi-fi but not on 3G and all the iPhones we tried were on the same carrier (I won’t say which but it begins with an ‘O’ and ends with a ‘2’). Certain carriers “optimise” web pages before sending them to phones as I found in this blog post. This is supposed to speed up sites on phones but can actually slow them down by introducing latency. We worked around this by putting the JavaScript in line. Luckily the mobile network I personally use doesn’t seem to do this (hint: it’s name is a single digit more than 2 and less than 4, 5 is right out). Next time your contract is up be careful which network you choose!
Fortunately, PubCrawler doesn’t seem to suffer from the issue.
A good way to test and validate a web app post carrier fiddling is to tether a handset to a computer. Then using Firefox with the User Agent Switcher add-on mimic the desired mobile phone. Viewing source will display just how much the mark-up, CSS and JavaScript has been altered. Images are usually transcoded (unless the Cache-Control response header is set to “no-transform”) and linked CSS can sometimes be brought in-line for example.
I think this issue highlights the complexity that mobile developers face when trying to troubleshoot a problem. Dealing with differences between handsets and software is the norm but add carriers to the mix and it makes things even harder.

PubCrawler updated to Google Maps API V3

Good old PubCrawler. I have somewhat neglected my duties in maintaining this web app. However, I recently completed the migration to Google Maps API V3 for it. Advantages of this include:

  • Automatic display of controls based on device. For example zoom buttons are displayed on Android devices but not on the iPhone (because it has multitouch built in). This means that I have done away with the buttons below the map.
  • Built in map type buttons (Map, Hybrid, Satellite, Terrain) so I got rid of the button to do this at the top
  • Speed: it uses less data and therefore loads maps faster. They built it with mobile devices in mind.

There’s more but Google themselves can explain it better than I can. PubCrawler running on Maps API V2 (or PubCrawler Classic as it might become known) is still available here. I actually started this process of migration to V3 not long after it was announced. However, at first the full feature set wasn’t there so I parked it for a while. I’m not sure when the API became complete enough for PubCrawler’s needs but everything is there now.

Revisiting PubCrawler after such a long break means that the iPhone-esque look and feel is starting to look a little dated to me. At some point its going to need revising to something more unique and suited to the application’s purpose.

PubCrawler HTML5 geolocation

I’ve been neglecting the PubCrawler a bit recently because of my current widget fetish. I made one quick change to it last night though. It now has HTML5 geolocation for browsers that support it. I tested it in Firefox 3.5 beta 4 which is a bit flakey when it comes to the geolocation stuff even on other peoples’ sites. Ideally I need someone to test it with a new Palm Pre which it should work for. Please contact me on webmaster at ubikapps.net if you do. Either that or I will have to wait until iPhone OS 3.0 comes out and try it on my iPod Touch.

I have lots of changes I want to make to PubCrawler. One thing that is high on my list is updating it for Google Maps API V3 which has a much improved mobile experience. I may have to create a separate version though because V3 is not fully featured yet.

Update: just installed OS 3.0 on my iPod touch and it works.

PubCrawler HTML 5 DB – Save crawls on iPhones

I have updated PubCrawler to use HTML 5 client side storage. This is supported by iPhones and iPod Touches with firmware 2.0 and above. It means that these devices can now save crawls. For Android phones a Google Gears database is still used.
It took me a while to get the HTML 5 DB working properly. The fact that it works asynchronously (rather than synchronously like Gears) made it difficult to implement all the functionality. Also the created tables don’t have a built in ROWID column (like Gears) so I had to create my own. I’ll probably revisit it later to tidy up the code.

PubCrawler now has manual location

PubCrawler now has manual location functionality. When Google Gears is not installed it falls back to asking for location in a JavaScript prompt(). With or without Gears on the map screen the location can be changed with a new button. Another minor change is the removal of the map buttons at the bottom for everything but Android devices. iPhones can use multitouch gestures to zoom and drag the map (Google’s functionality not mine!). For Android 1.5 I have added drag functionality myself though.

Coming soon: HTML5 database to save crawls on iPhone (instead of Google Gears DB which Android uses).