Quick iPhone app for offline traveling
Offline traveling may well be a neologism. The fact is that I am about to set off for a 2 week travel to the South of Italy. Now, I will bring my iPod touch with me, but it will be of limited use, since it has no 3G capability, and anyway 3G roaming is expensive; furthermore it is not always available as soon as you get away from the most beaten track.
Truly Sad. But, I did not want to do without it and the help it can offer when you are looking for your car route, for an hotel nearby, or for information about the place you are going to visit. An ipod/iphone is a great tool where you are traveling with all the information that is available on the web. So I decided to quickly hack a small app packaging:
- information from the local Tourist Offices about places, events, and accommodations;
- the wikipedia wealth of historical, geographical, tourist information;
- a route map.
Main requirement was that this all could work offline. It was fun, the hardest part being downloading the wikipedia portals about Basilicata and Puglia, without also downloading the whole wikipedia, and the most exciting part integrating an offline map.
wget-ting Wikipedia
Downloading the wikipedia for offline viewing is not an easy task, due to its ramification and to the lack of any kind of URL-based structuring of its information. So, eventually you end up downloading much more information than you really want. There are some tricks that you can do to improve filtering of wikipedia pages, specifically, you can skip all “index.php?” pages and all “File:” pages; I found that the following wget command worked pretty well for me:
wget -R "*index.php*.*,*File*.*" -D "locahost,it.wikipedia.org,upload.wikimedia.org" --random-wait -E -r -p -e robots=off -U mozilla -l1 -p --convert-links -H -nd -nc http://...
it produced 3000 files, including pictures, perfectly browsable offline. You can see that I was interested just in the information available on the main portal pages and on its immediate offsprings. Also including the “File:” pages would have produced almost 20 thousands files.
Route Map
I found a very good guide about embedding an offline map into your iPhone app at this site.
Getting “downloadosmtiles.pl” to download a map from openstreetmap was a breeze, as well as converting the downloaded tiles by means of map2sqllite.
What came next, i.e., compiling route-me and linking it to my app, was also a snap, but due to the fact that the above page was a bit outdated, the process felt a bit clumsier. It happens anyway that things are easier than what you can read there, so in the end, I had no problem at all. It seems that the latest “route-me” from github does already include all the changes that you are asked to do on the gisnotes page, except for commenting out the assert in the “setTileSource” method in “RMMapContents.m” file.
Integrating the “WebMap” view is also very easy if you have a look at the RouteMeSampleMapDBOffline sample.
User Experience @ CES
Among the many reports from CES 2012, this one is really interesting to me because it focuses on User Experience. Indeed, how boring all the hype around device specs when really all that matters is the experience that device grants you! But this is just a reminder of how difficult it is changing mindset, forgetting about details no one really cares about, and focusing on those details that really provide a benefit in terms of user experience and usability.
Using iOS SDK 5 with Xcode 3
I have been lately using a quite older MacBook Pro (Intel Core Duo 2 2.4 GHz, 4GB RAM) for development and found that it is pretty unpractical installing Xcode 4 for regular use due to its slow performance and huge memory footprint. So I looked for a way to run good old Xcode 3, which is fine under most aspects and works reliably. Turned out it was not so difficult in the end, so I list here the steps I took to make it work: you simply need to copy a bunch of files from a newer Xcode 4.3 distribution to the proper Xcode 3 location.
Core Graphics Image Interpolation Performance
Recently, I have done quite a bit of Core Graphics programming and discovered that one key point in ensuring that an app performs well is choosing the right CGContext interpolation level. Interpolation, according to the Wikipedia, “is a method of constructing new data points within the range of a discrete set of known data points.” Interpolating is what is done when you scale up an image, but also when you scale it down. In both cases, interpolation has a tremendous impact on the result of the scaling.
What's new in iOS 7 User Interface – 1
The new iOS 7 has radically changed the way user interface is conceived on iOS. Indeed, the change has been so radical that along the past few months many not so positive comments and criticism could be found on the web. Now that iOS 7 has officially shipped this is starting to change and many voices are expressing true their enthusiasm. Even the rush to updating to iOS 7 does not seem to stop, so that it is already clear that iOS 7 will be a huge success in adoption.