It’s a shame Apple hasn’t added HTTP proxy support in the Safari app! I just spent an hour or so investigating compression addons and ad-blockers for squid thinking it would greatly improve the browsing speed on my iPhone. I found most of what I was looking for too, using Squid 3.1 there are addons for gzip compression and ad-blocking. However, I couldn’t find an addon that will re-compress images into lower quality but maybe that can be done with ImageMagick somehow?

Then it hit me: the damn phone only support http proxies over WLAN, and that’s not really when I would want to use it! Now I wonder if Apple has intentionally ignored proxy support in the Safari app to please the service providers? A smart http proxy could reduce the transferred text for each page view from a non compressing site by somewhere around 70-80%, removing ads will also reduce a larg amount of data, effectively reducing the end users data transfer fees and at the same time speed up page loads. If images were removed altogether we’re talking huge data savings but that comes with a major experience reduction.

But is there really no way we can manipulate what’s being downloaded over sometimes expensive 3G networks? YES there is! The iPhone does support VPN over 3G, and what can be enabled for a VPN connection? A proxy of course! Setting all this up is a bit of a hastle but we already have a VPN at work so I installed Squid on my “server” (the mac mini PPC in my closet that previously hosted this blog) and it worked very well over the VPN. Unfortunately the gzip compression addon doesn’t work for some reason but the ad-block works like a charm.

If you don’t have a VPN server there are a few available for Linux: OpenVPN, FreeS/WAN, Poptop.

Now if there was only an image re-compression plug-in for Squid, that would be awesome!

UPDATED 2010-04-03

iPhone OS 3.0 is out this week and while the new iPhone 3GS was pretty disappointing hardware wise, the new iPhone OS is really packed with new cool frameworks and APIs. I’m working on a lot of projects back and fourth depending on what I feel like working with at the moment. After we released the first app, Hitta Hem, I wrote a bunch of articles based on that work and got kind of tired of iPhone development. I’ve started working again on some new things around iPhone OS 3.0 features and I thought I’d share some Core Data stuff.

What is Core Data?

Core Data is new in iPhone OS 3.0, but has been around for OS X application developers for quite some time. Since I’m NOT an OS X application developer this framework was totally new to me and it’s a great addition to the iPhone SDK. So what exactly is the Core Data framework? If you are familiar with the entity framework in .NET, it’s something similar. Core Data is an abstraction layer on top of a sqlite database which enables developers to more easily implement data-centric applications. Personally I never got around to do much with sqlite but I touched it enough to appreciate what Core Data brings to the table. My main issues with sqlite are poor tooling support and a limited range of documentation and samples. I’m used to working with Microsoft products and even though I’m aware that MS has the best tooling support in the world, the tooling provided for sqlite sucks! Keep reading and download the code

Installing EPiServer 4.61 is a PITA

18 Jun 2009 In: EPiServer, Ramblings

EPiServer released EPiServer CMS 5 about 2 years ago but I was still surprised today when I noticed that it’s impossible to install EPiServer 4.x using the normal online installation with the installation manager provided by EPiServer.

Avantime has been working with EPiServer for over 6 years and some clients has been with us since then. Many clients has already upgraded their existing sites to CMS 5 but there are still quite a few on 4.x.

Today I helped my new colleague Erland setting up a new virtual machine for a customer on 4.61. When we got around to install EPiServer the provided manager from world.episerver.com for 4.61 first told us we should upgrade the installation manager. We ignored that but when we selected 4.61 and install the manager told us:

Selected version of EPiServer requires an updated EPiServer installer.

» Read on for the solution to this problem

Logan Stanton gives the freaky finger at UFC 99

14 Jun 2009 In: Ramblings

This post has absolutely nothing to do with .NET, iPhones or programming in general, I apologize. However, I am a huge fan of the UFC and so is my girl friend Anna (fortunately). We enjoyed the UFC 99 show today on big screen in our living room and both reacted when Logan Stanton, one of the ring girls, was stepping down after the first round between Mike “Quick” Swick and Ben “Killa B” Saunders. Miss Stanton has a real freaky finger!

UFC Logan freaky fingerDon’t get me wrong, I’m not posting this to be mean. Logan actually looks human (compared to some other ring girls). It’s just an observation.

The show itself (UFC 99) wasn’t too exciting, but then, UFC 100 is just around the corner! Go Lesnar and GSP!

Working with maps and geographic data is becoming more popular and important by the hour, much due to Google Maps extremely simple and powerful API. If you found this page through a search engine you’re probably facing the same problem I’ve faced multiple times in my work, you posses geographic data in one format and need to convert it to another format. Chances are you need to convert your coordinates in your own application/code in real time, not manually converting them on Lantmäteriets web site. Get the code »

The war on IE6 – 3 months update

21 May 2009 In: Ramblings

Three months ago I wrote a post about “the war” on IE6. We joined in with svenskfast.se and posted a warning to visitors with IE6 that they should upgrade their browser. Another big site who also did this was Aftonbladet, Sweden’s most visited tabloid/news site. I promised I would follow up with some statistics on whether the campaign was successful or not. Get the graphs and numbers »

iPhone accelerometer and device orientation

7 May 2009 In: Development, iPhone

So Apple released a new beta of iPhone OS 3.0 today. It’s the fifth beta and we’re getting closer to final release of 3.0. There were very few changes or additions to the API so it’s not likely we’ll see more changes at all. In February I published a quite lengthy solution  on how to rotate images without rotating the entire application where I use shouldAutorotateToInterfaceOrientation.  Recently I wrote a post about the changes made to shouldAutorotateToInterfaceOrientation which in my opinion breaks important functionality. As promised here’s how you can replace shouldAutorotateToInterfaceOrientation using the accelerometer.

*UPDATE*
Kyle was friendly enough to post a simple solution to how you can listed to the shouldAutorotateToInterfaceOrientation event. I’ve updated my previous post with his solution (or see his comment below): breaking changes to shouldAutorotateToInterfaceOrientation.

The application is called DeviceOrientation and is just a proof-of-concept, not a full replacement for shouldAutorotateToInterfaceOrientation. Unfortunately the accelerometer cannot be simulated in the simulator, you will have to compile and run it on your iPhone to test. Here’s a dirty clip I recorded with the iSight camera in my iMac, it’s harder than you think to record a clip sitting behind the device and the screen itself adds a nasty glare in the iPhone. At least it’s pretty short, enjoy:


Code example ahead »

xcodeiPhone OS 3.0 beta 3 has been available for a few weeks and it’s actually pretty stable. The most annoying bug in the standard functionality must be that quite often the last row of buttons in phone mode disappear. A reboot fix that until next time it happens, but it’s annoying.

Unfortunately I haven’t had the time to mess around much with the new APIs in 3.0. I’ve tested my Hitta Hem application and found a breaking change to the shouldAutorotateToInterfaceOrientation which I use to rotate images in an UIScrollView. I’ve explained and posted that code. Since beta 1 of iPhone OS 3.0 shouldAutorotateToInterfaceOrientation doesn’t behave like in 2.x, which is a problem. Read more about the changes »

About this blog

With this blog I try to provide useful tips and solutions for programming .NET, Objective-C and more. My name is Björn Sållarp, and I love writing code.

Donate!?

If you found this blog post useful, please consider donating a dollar or two. All donated money is invested at Kiva. Read more on About this blog. Thank you!


All blogposts are written on a mac!  Avantime - Strategic IT solutions
Blogg listad på Bloggtoppen.se    BlogRankers.com
WP-Highlight