Today we released the latest revision of Optiscan to the App Store. With an all-new look and some greatly enhanced features, this version is the king of QR Code scanners on your Apple device!

Create a QR Code
Create a QR Code – so many options!
Optiscan 2.0 Scanning screen
Optiscan 2.0 Scanning screen

What’s new in 2.0:

  • No more tap to scan! Optiscan now launches straight into scan mode for ease of use.
  • Icon and UI redesign. We thought it could do with a sprucing up, so we tweaked the look to be more up-to-date and utilitarian. What do you think?
  • Enhanced scanning engine. With every release of Optiscan we tweak the scanning software more and more to cope with the plethora of designer codes and locations. After testing, we scan more QR Codes than any other app!
  • Scan from clipboard.“I can’t scan from my mobile browser!”, we heard you cry. Well now you can!
  • QR Codes for Events. We wanted to include this last time, but we just weren’t happy enough with the way they where dealt with. Now we are!

We hope you enjoy using this version of Optiscan. Show us what you’ve done with it and we’ll pass it on!

Today we released the latest update for Optiscan, our QR Code scanner and generator, on the iTunes App Store.

Optiscan 1.9.3 Create screen

You’ve always been able to create a plethora of QR Code content types with Optiscan, but now we’ve made it even easier for you with a new menu of options. These include:

  • SMS Create a QR Code containing a message and the phone number to SMS it to – great for marketing!
  • Location To our knowledge Optiscan is the only QR Code generator app that lets you pinpoint a map location without having to type the address in!
  • Email Similar to the SMS option, setup an email message, subject line and recipients all in one QR Code
  • Telephone Keep it simple – your phone number in a QR Code
  • Wi-Fi Need to share your wi-fi details easily? Put them in a QR Code and pass it round!

All these options have been added at the request of our users in addition to our standard Contact (with vCard or MeCard options), URL and Text note options. We hope you enjoy using Optiscan even more now to scan and create all those QR Codes!

Coming to an iPhone near you soon: Optiscan 2.0: The Scanner Strikes Back!

Well – this is it! After a fantastic 9 week internship it’s sad to be leaving behind the code, co-workers and, of course, coffee machine I have got to know so well. From the very first day I was plunged straight in the deep end, coding new features and fixing bugs. It’s been fun, frustrating and interesting in equal measures, but I can assure you that an internship here is never dull!

So what is it that I’ve been doing? My first few weeks were a steep learning curve, as I battled to comprehend the delegate design pattern while also trying to work out why there’s a small toy bear which lives in the office. (Though I am now completely au fait with the former, the latter continues to bemuse me)! A couple of code reviews later I had free reign to amend or add code, and moved onto adding social media compatibility to several of our apps. If you’re planning to do this yourself, I would recommend ShareKit as a good starting point.

By mid-August I was working full time on Optiscan. There’s a host of new features which will arrive on the AppStore soon, including much more support for creating QR codes. As a member of the engineering team I played a big role in delivering this functionality, both from a coding perspective and by participating in numerous (friendly if raucous) office arguments! The last couple of weeks have seen development give way to testing, so I’ve been scrambling to fix any bugs before I leave. For any of you who are newbie iPhone developers I’d have 3 words of advice – watch out for memory warnings, be careful when using UITableViews, and always keep an eye on your reference counting!

It hasn’t all been coding though. I’ve spent many a lunchtime dreaming up app ideas on the office kitchen whiteboard, with concepts ranging from the sublime to the ridiculous. The company lunches and barbecues were a particular highlight, as was a (slightly surreal) morning of set theory in order to write a Python script. These and other amusements unique to a small company like Airsource made this summer particularly enjoyable, even on the odd occasions where I did stare at the same bug for hours before seeing the simple solution!

Time to say farewell to everyone here, and thanks for a great summer. Keep an eye out for future releases of Optiscan and Cellar (there’s some quite cool stuff to come, by the sounds of things in the office). Adios!

(Oh and I must ask someone about that bear before I go…)

So there I was, scanning for the latest in the world of QR codes and what should pop up? A mention of The Sunday Times recommending three QR code apps. Curiosity got the better of me so I paid the ferryman and jumped behind the paywall for a day to see this article for myself. Planet of the Apps is The Sunday Times apps blog reviewing “the best and the brightest” on smartphones. Yesterday they chose three apps to talk about QR codes and guess what? The only paid app being recommended was – Optiscan!

We like that.

Not using Optiscan yet? Get it on your iPhone today.

Loveit

You may not have heard of SET Japan, but if you’ve seen some great looking QR codes around you’ll probably have seen their work. Producing designer codes for the likes of TIME magazine and Louis Vuitton, SET Japan are recognised as the ‘inventors’ of the designer QR code that is becoming so popular now. They created their first a few years back and have been involved in virtually every major new use of them since, working with companies such as Warbasse Design in the US recently.

With all their great experience of working with QR codes, it was with great pleasure and honour that we received an email from their development team praising Optiscan!

“We use a lot of readers when we are testing and the team is always looking for the fastest reader – it is like a badge of honor if you can bring in the best reader to a meeting – and we are all huge fans of your Optiscan reader. It is our go to app and the one we recommend to anyone looking to get clicking.”

It’s always good to be appreciated!

Get your copy of Optiscan today.

Louis Vuitton designer QR code
Louis Vuitton designer QR code
True Blood designer QR code
True Blood designer QR code
Optiscan 1.8.5 scanning screen

We released the latest update of our QR Code scanner and creator – Optiscan – onto the iTunes store last Thursday (12th). Along with stability improvements in preparation for iOS 4.2, you’ll find better decoding for newer devices plus a surprise new look! The new icons and UI tweaks have been brought in to match Optiscan’s continually growing success in the field of QR Code scanning. Expect more tweaks and new features to come in future releases as QR Codes take the world by storm in 2011!

As a summer intern I could have worried about just being given tasks such as making the tea, but here at Airsource, among other challenges, I was given the chance to work on improving some the QA infrastructure via automated testing. I study Engineering and have learnt some theory regarding testing practices in software development, so it was great to put that to a practical use!

Apple announced with iOS4 the ability to do automated UI testing on the iPhone as a part of the Instruments development tool. Such testing is done with the help of a number of JavaScript libraries which allow you to access an application on a device and tap buttons, scroll views and varify text as if it were a human interacting with the hardware, and not a script.

Why is this – other than the fact it’s something from Apple – cool? It essentially means that it is possible for us as app developers and testers to automate some of the tests we always do to ensure we have not broken anything in our latest development cycle. There is nothing worse than working hard on adding a new feature to an app, testing it and releasing it only to discover that your testing missed a regression in your previous functionality. This forces you to make a brown paper bag release to fix it, for which you have to test everything again in addition to the things not fully tested the first time. This takes up time and effort which could be used to add more features, and more importantly can lead to your users having a broken app.

Automating the tests does not mean that they are better tests than if they were done manually. What it does mean is that tester time is saved on doing the mundane day to day tests so that they can spend more of their time on testing edge cases and new features, where the harder to find bugs are more likely to be and less likely to be found by the developers as they write code.

What Airsource is doing with it

At Airsource we’ve been busy automating tests for our app, Optiscan. Doing this we have found that, despite what Apple have tried to do with using timeouts, it is sometimes necessary to have delays in the tests. The main shortcoming in this area is the fact UI Automation swallows taps on elements which are not visible; meaning that your tests script may expect a changed state and fail because the tap to change the state was never registered. The reason that timeouts do not work on this is that the element you are attempting to tap exists and valid, so it can be tapped, but it may not be visible (due to an animation sequence for example) thus the tap is never registered by the app. This is a big shortcoming in the system of timeouts, it would be great if Apple fixed this by attempting taps until the tap occurs on a visible element or the timeout is reached.

When you are writing a test you do not want to have to worry if the button is ready to be tapped or not, you just want to tap the button! So as a part of the testing effort we have written a bunch of useful little functions which encapsulate all the delay logic and mean than we don’t worry about delays when we’re writing the tests.

The code below allows us to scroll to an element with a particular name in a scroll view, before waiting for it to become visible and then tapping it. This simple encapsulation of a common task means that there is no need for the test writer to worry about the button becoming visible to tap before tapping it, just worry about how to actually test the app.

// Allows you to scroll to an element with a particular name and tap it.
function scrollToElementWithNameAndTap(scrollView,name)
{
	if (! (elementArray instanceof UIAScrollView))
	{
		throw ("Expected a UIAScrollView");
	}
		
	var e = elementArray.scrollToElementWithName(name);
	waitForVisible(e,5,0.25);
	e.tap();
}

// Poll till the item becomes visible, up to a specified timeout
function waitForVisible(element, timeout, step)
{
        if (step == null)
        {
                step = 0.5;
        }
	
        var stop = timeout/step;
	
        for (var i = 0; i < stop; i++)
        {
                target.delay(step); // for the animation
                if (element.isVisible())
                {
                        return;
                }
        }
        element.logElement();
        throw("Not visible");
}

Using JavaScript objects' prototype property it is even possible to make scrollToElementWithNameAndTap(name) a method of each instance of UIAScrollView. Hence if you have a constructor for your tests you can use

UIAScrollView.prototype.scrollToElementWithNameAndTap = function(name){
                        scrollToElementWithNameAndTap(this,name)
                        };

and now you can call the method on all your UIAScrollViews just as if it were a native UI Automation method.

Doing more than it says on the tin

An unfortunate aspect of the UI Automation kit is that there is no reset button or method. The result of this is that if a test fails, then your app is in an unknown state, thus it is very likely that all subsiquent tests will also fail. Ideally you do not want it to appear as if 20 tests have failed when in fact only one has failed. Having the ability to target.reset() to reset the app to a known state would be very useful, and it is a pain that Apple have not implemented it in some form.

To remedy this we've had to add a small amount of code to our apps which makes it possible for us to interact with them on the level of the program, not just the UI level. UI Automation allows us to change the volume on the device using methods in UIATarget, so we've added a listener for the device volume to our app, which means we can run code when we detect a volume change. Code for a volume listener is shown below.

// Set up a listener to act on volume changes
AudioSessionInitialize(nil, nil, nil, nil);
AudioSessionSetActive(true);
AudioSessionAddPropertyListener(
                         kAudioSessionProperty_CurrentHardwareOutputVolume,
                         applicationVolumeDidChange,
                         self);

// Note that this callback will only be called if the mute button is off.
void applicationVolumeDidChange(void *inClientData,
                         AudioSessionPropertyID inID,
                         UInt32 inDataSize, const void *inData)
{
        NSLog(@"Volume changed");

        // Do something like reset the system
}

This way calling target.clickVolumeUp(); just after UIALogger.logFail(...) in your testing script will mean that you can reset the app before the next test is run. Note that it is important that the hardware mute button is off when you are testing otherwise no signals will be sent that the volume has changed!

Shortcomings

Other than the swallowed taps and lack of reset method mentioned above, there are a couple of other shortcomings with UI Automation. The most obvious being the lack of screenshots when running the tests on the simulator; this makes it hard to verify UI and record what the app's state was when a test failed. To be honest it feels rather bizarre that you can take remote screenshots on the actual hardware iPhone, but not in the simulator. I hope that Apple fix this in future releases.

The less obvious, but rather annoying shortcoming (especially if you are building a large library of testing scripts) is the lack of a decent preprocessor. JavaScript does not have native support for preprocessing or any kind of #import structure, so it is good that UI Automation scripts support #import, but the lack of define statements and logic such as #define and #ifdef is a pain when you want only to run a certain initialisation script once, but it is called by each test you run. Emulation of this behaviour using JavaScript variables is not helped by the fact that variables can remain defined between different runs in Instruments.

Conclusions

Automated UI testing does not mean bug free code. No testing on any non-trivial piece of software can guarantee bug free code, and the testing is only as good as the tests themselves. Using automated testing means that it is easier to stop regressions by having a test in place for each previous bug which has cropped up, it also means that the tester's time can be utilised more effectively. Apple's UI Automation ticks many boxes for good automated testing despite its shortcommings, and we hope will prove an invaluable tool in our development cycle.

A while ago, I was tracking down some NaNs in accelerometer-based code (smoothing device orientation for an OpenGL AR view). It turns out it wasn’t my bug — UIAcceleration.timestamp was going backwards approximately every 12 minutes! Naturally, the documentation doesn’t mention anything about this:

This value indicates the time relative to the device CPU time base register. Compare acceleration event timestamps to determine the elapsed time between them.

Assuming iPhone OS is similar enough to Mac OS X, it must be using mach_absolute_time():[1]
Continue reading

optiscantransbak We’ve been making continual minor improvements to Optiscan, fixing some issues with cut and paste and handling of certain types of addresses. Unfortunately a serious bug slipped into release 1.8.2, which hit the App Store yesterday. Apple helped us immensely by fast-tracking approval of version 1.8.3. If you are seeing crashes in Optiscan today, check if you are still running 1.8.2. If so, check the App Store for an update! (It may take up to another couple of hours till it’s fully propagated through their distribution network.)