Ben Dodson

Freelance iOS, Apple Watch, and Apple TV Developer

The Divide #11 - 3D Printing

The 11th episode of The Divide podcast is now available in which we discuss 3D printing with a focus on John’s experience of the Da Vinci AIO 1.0. In addition, Chris has some updates on DC Rebirth, John is interested in the Xbox One development kit, and I propose an experiment in the measurement of canine happiness…

You can get The Divide from these fine outlets:

Don’t forget to leave a review on iTunes and follow us on Twitter via @PodcastDivide.

HomeKit, Wink, and Canary

A couple of weeks ago I took the plunge and bought a Canary, an internet-connected personal security camera and air quality monitoring system. It has been working great so far and comes with a decent iPhone app that allows you to control the camera and have it activate automatically based on location. There are three different operating modes; armed, disarmed, and privacy. Whilst armed, you’ll get a notification when any activity is detected whereas disarmed will still record and store any video when there is motion but it won’t notify you1. Privacy completely shuts off the camera and microphone.

For the simple reason that I don’t want everything that happens in my living room whilst I’m in it to be streamed to a 3rd party server, I have set the iPhone app to switch between armed and privacy modes; this means that if nobody is in the house, it automatically arms itself but will shut off the camera and microphone as soon as a family member gets back home. The problem with this is that the camera is then in privacy mode when we go to bed as obviously our phones are still in the house; if somebody breaks in, we won’t have any video evidence. I can open the iOS app and manually arm the Canary but Sod’s Law means I’ll probably get an intruder on the night I forget to do that2.

My first thought was a scheduling system could be put in place to automatically arm and disarm the Canary if I’m in the house but the app doesn’t have that functionality and there is no public API. I then discovered that Canary have partnered with Wink, a platform that allows multiple devices to connect together so you can do things like have the lights turn on when motion is detected. This is really useful and does allow for the sort of scheduling I’d envisioned, but then I came up with a better solution; tying it into my existing HomeKit routine.

I’ve blogged about HomeKit before and specifically about Homebridge which allows you to get non-HomeKit enabled devices to work with the system. Canary is not a HomeKit enabled device and with no open API it wasn’t possible for me to write a plugin. However, Wink does have an existing Homebridge plugin allowing you to control most devices connected to Wink via HomeKit. Unfortunately, HomeKit doesn’t support cameras and so neither does that Wink plugin. Back to the drawing board!

After a bit of tinkering, I realised I could just re-purpose an existing supported HomeKit protocol; locks. In HomeKit, locks are basic binary operators that are either “secured” or “unsecured”. This works perfectly for my Canary as I could denote it as a doorlock and then have “secured” equal “armed”, and “unsecured” equal “privacy”. After a few minutes, I managed to fork the existing plugin and create a new version with this hack in place. Once downloaded, you just need to add the following platform in your Homebridge config file:

{
    "platform": "homebridge-wink.Wink",
    "name": "Wink",
    "client_id": "quirky_wink_android_app",
    "client_secret": "e749124ad386a5a35c0ab554a4f2c045",
    "username": "YOUR-WINK-USERNAME-HERE",
    "password": "YOUR-WINK-PASSWORD-HERE",
    "hide_groups": [],
    "hide_ids": []
}

(Sidenote: most of my time tonight was spent trying to find a client_id and client_secret to use for the config. To get these, you usually have to email Wink with response times being around 7-10 days. I decided to rip it out of the Android app instead…)

Once you restart Homebridge, any of your Canary devices in Wink should show up in HomeKit automatically. You can then say something like “Hey Siri, lock the living room” to arm the Canary. I personally like to use HomeKit scenes which allow me to control the Canary automatically with my existing “good morning” and “good night” Siri phrases. I find this much more reliable than a schedule as I already use these phrases every time I go to bed and wake up in order to turn my lights on and off (whereas a schedule might turn the camera on whilst we’re still awake or turn it off before we get up).

Hopefully in the future we’ll see a public API for Canary and support for cameras in HomeKit so I can make this slightly less hacky but it works for now and means I’ll no longer forget to disable privacy mode at night. If you’re interested in trying this setup yourself, check out the plugin on GitHub.

  1. The use case for this is things like capturing a babies first steps, the sort of thing you could easily miss but can easily find in the 12-hour log of a practically always-on camera. ↩︎

  2. And I often forget to turn it off when I get up which means my wife and I get a notification of me groggily letting the dogs out every morning. ↩︎

The Divide #10 - Let us loop you in. Again.

The 10th episode of The Divide podcast is now available in which we discuss Apple’s ‘Let us loop you in’ event1. Chris has a rant about his internet provider (before promptly being disconnected), I talk about Twilight Princess HD, and John gets excited about a box of replacement Apple Pencil nibs…

You can get The Divide from these fine outlets:

Don’t forget to leave a review on iTunes and follow us on Twitter via @PodcastDivide.

  1. Where my big prediction of “there will be an updated processor for the Apple Watch” proved utterly incorrect. ↩︎

What to expect from the 'Let us loop you in' Apple event

Later today, Apple will be holding a special event entitled ‘Let us loop you in’. I don’t often post my predictions for such events but I’m intrigued by this one as all rumours seem to suggest there is very little to announce.

It is clear from supply chain rumours and other sources that there will be two hardware releases; an iPhone SE1 and an iPad Pro in a 9.7” form factor. Neither of these are terribly exciting nor worthy of a big event as they are things we’ve seen before in sizes we’ve seen before. It will not be easy to talk for 15-20 minutes on each of these devices as it’ll essentially be “this thing we made 6 months ago is now available in a smaller size you are familiar with”.

So what else is there? Apple Watch bands seem to be a certainty with a black milanese loop, some new sports bands, and a NATO-style nylon band2. As watchOS 2.2 will likely be released today, there will probably be some shiny new watch faces which haven’t been present in the betas over the past couple of months. Speaking of software updates, there is also iOS 9.3 coming today (which was publicised heavily by Apple on a special website) and a minor update to the Apple TV OS both of which I expect to be showcased.

Whilst that could be everything, it seems very lacklustre for an event; everything here could be done by press release which leads me to think there may be more.

First of, I’m hopeful that there will be a minor Apple Watch hardware revision. There would be no new features or any changes to the design, but the internal S1 chip would be replaced with a faster S2 chip. There is no doubt in my mind that the Apple Watch is being held back by its slow processor and so this would be a good upgrade until a hardware refresh comes before Christmas. I have a couple of reasons for believing this might happen:

  • One of the main features of watchOS 2.2 is that you can pair multiple watches to an iPhone. This doesn’t seem like it would be necessary until there are two versions of watch hardware. In my own case, I would likely buy a 2nd generation Apple Watch Sport for everyday use and then use my 1st generation Apple Watch if I was dressing up. Whilst you could argue that some people may have multiple watches already, it seems like odd timing when this multiple watch support could have been earlier.

  • There haven’t been any leaks from the supply chain but I believe that is because it would just be a case of changing the fully integrated chip inside. There would be no external changes, no massive shipments (like with iPhone), and even the packaging would likely give nothing away as the product name would be the same. I believe Apple could maintain secrecy of a chip change for the Apple Watch in a way that isn’t possible for other hardware updates.

Some people are hoping for Mac updates, especially to the MacBook, MacBook Air, Mac Mini, and Mac Pro, but I do not believe these will make an appearance until WWDC at the earliest. All of them require significant hardware changes which would have leaked through the supply chain, especially as they’d all have exterior changes3. I’m in the market for a Mac Mini so I’d love to be wrong about this, but I think these updates are a few months away yet.

This leaves the one thing that Apple are incredibly good at keeping completely secret; software. As nearly all of their software is written in Cupertino, they can keep a very tight lid on it and prevent leaks in a way that is almost impossible with hardware. There have been a few rumours that iTunes may finally be getting a makeover; whilst I think that is ultimately coming4, I think it far more likely that the Apple Music part of iTunes and the Music app on iOS will be getting minor design changes in order to avoid some of the many UX problems that have been evident since its debut last year. This would fit in well with iOS 9.3 which is otherwise fairly light on features5 for something that is likely to get a lot of stage time. Aside from that obvious issue, I have no idea what software they could be announcing6 but I’m fairly confident there will be something.

The only other thing to mention is that I’m fairly confident Tim Cook will mention the current fight with the FBI over encryption at the beginning of the keynote. I also expect numerous mentions to privacy and encryption throughout.

A note for those in the UK: Whilst Apple events typically happen at 6pm for us, this event falls within the 2 weeks after the US has moved their clocks back for Daylight Saving Time but the UK hasn’t. This means the event is at 5pm UK time. You can watch it on Apple’s website.

Update

I thought I should come back and update where I was right and wrong on these predictions…

  • New Apple Watch bands
  • watchOS, tvOS, and iOS updates coming today
  • CareKit
  • No Mac’s
  • FBI mention about privacy

Wrong

  • No new Apple Watch internal hardware (just a price drop)
  • No update to Apple Music
  • iPhone SE did get the front-facing flash of the 6s
  • Whilst not specifically mentioned, I expected the iPad Pro 9.7” to be exactly the same as the 12.9” one; it’s actually got a much better screen and cameras (although slower clock speed and less RAM)

Conclusion

You can hear me discuss the event in detail in Episode 10 of The Divide.

  1. Basically an iPhone 6s (minus 3D touch and front-facing flash) in an iPhone 5 size. ↩︎

  2. This is the only thing I can see myself buying from this event at present. ↩︎

  3. The Mac Mini, MacBook Air, and Mac Pro are all due a design refresh. The MacBook, at just a year old, is unlikely to change much but I imagine they will give in and add a 2nd USB-C port possibly at the expense of the 3.5mm audio jack which is in their crosshairs on the iPhone. ↩︎

  4. I mean it has to, right? I know I’ve been saying that every year since the iPhone came out but surely it has to come soon… ↩︎

  5. When your 2nd headline feature is “you can secure your notes with TouchID” then it evidentally isn’t as big a release as it is made out to be. ↩︎

  6. Although an iMessage upgrade and new health apps would be my educated guesses. ↩︎

Show Me The Next

An iOS app I worked on for The Browser has gone live in the App Store today; Show Me The Next:

The concept is very simple; an app with curated articles that you read through at random with a simple swipe. No going back, no list no images, no videos, and no tracking; just fast offline access to interesting articles.

I made a quick mockup and then I added some extra features such as the ability to share articles, alter the font size, and change screen brightness1. I also built a simple CMS so that the articles embedded in the app could be updated remotely. The app is built using Swift 2.1, runs on all devices with iOS 9 or above, and is optimised for all the various shapes and sizes including iPad split screens.

As well as completely designing the app and the functionality, I was also asked to design the app icon and logo with a simple single sentence brief: “I admire the art of Mondrian. I took inspiration from the work Composition II in Red, Blue, and Yellow and used the same colours and textures with lines to shape the letters SMTN. It was a fun design experiment and something a bit different for me!

Show Me The Next is a free app and is available on the App Store.

  1. The client did not ask for these additions but I often like to add extra functionality free of charge when I feel it is of benefit to the app. ↩︎

Music Tracker v1.3

I’m very happy to announce that v1.3 of Music Tracker is now available as a free update.

In this version, I’ve focused on speed and stability. The original scanning engine has been completely rewritten from the ground up and now runs faster and for larger libraries than ever before.

Previously, the app would wake up once an hour and have around 30 seconds in order to scan the library, look for additions, changes, and deletions, and then save all of that information locally. This worked great for small libraries on newer devices like the iPhone 6s but didn’t work so well on an iPhone 5s with a library of over 75000 songs. The reason for this is that iOS limits the amount of time an app can run in the background1; if the entirity of the process wasn’t complete in the time allowed, then it would simply fail. This meant that customers with large libraries were typically seeing no updates as the app wasn’t able to get through the entirity of the library within the 30 second window allowed.

To fix this, I rewrote the scanning engine to be faster but to also work in batches. If iOS terminates the Music Tracker process (as it is taking too long) then the current state is saved and will pick up from where it left off the next time the process is restarted2. This means that huge libraries can now be scanned correctly as they are broken up over a few passes rather than trying to do it all at once. A nice side benefit of this is that the app can now handle older hardware3 which previously was too slow to handle even small libraries in a single pass.

In order to accomodate this new multi-pass scanning engine, I’ve also changed the way in which manual updates are performed within the app. Previously you could “pull to refresh” on the main activity page; this gave you a little spinner icon and not much detail as to what was happening. In v1.3, there is a refresh icon in the top right hand corner that will take you to a new page which details exactly what is going on and shows a progress bar so you can see that it is actually working.

If you have already purchased Music Tracker, you should see v1.3 as a free update within the App Store; you can check which version you have installed by going to the settings page within the app. If you don’t yet have Music Tracker, you can get it on the App Store. For more details about the app, you can view the official website at Dodo Apps.

One final thing: on the advice of Dan Counsell, I’ve changed my press media kit to be a standard HTML page with full access to everything the old zip download contained including details of the app, screenshots, icons, and mockup images. This makes it easier for the many iOS journalists who have switched to using something like the iPad Pro as their main work machine which doesn’t handle zip files particularly well. You can check out the online media kit or download the media kit as a zip file.

  1. This is a sensible thing; tasks should not be allowed to run for large periods of time in the background otherwise they’ll kill your battery. ↩︎

  2. Music Tracker typically wakes up every hour to check for changes. ↩︎

  3. Previously the app was only available on devices with a 64-bit chip. Music Tracker now runs on any device capable of running iOS 9.0 which means the iPhone 4s, iPhone 5, and iPhone 5c are now supported. ↩︎

Brapp 2.0

Over the last couple of months, I’ve been working with Brapp on their v2.0 release which adds a ton of new features for video makers, producers, and music lovers.

For video makers, there is a huge improvement to the record and upload flow allowing for studio grade Audio FX such as Pump (compression), EQ, bpm centric Delays, and Reverb1 with adjustments occuring in real time. You can tap on the camera view to adjust exposure and light balance and the recording quality has been improved. Finally, you can now save videos locally complete with a watermark with your name and the beat creator if applicable.

For producers, there is now a systemwide ability to import beats from any app that displays media files. Just tap the share icon and choose the new “Copy to Brapp” option. This will take you to a new editing page that lets you trim the beat to a minute or less in length and add optional fades in or out. The trim page was particularly difficult to build (as you have real time scrubbing and fades, waveform generation, and the ability to move the waveform before you even get to outputting these to a single audio file) but the end result works beautifully.

In addition to these big features, there are 100s2 of smaller changes including:

  • The new profile system makes it possible to hide reposts on a profile so you can just check out their beats and videos.
  • Search is more powerful than ever.
  • It is easier to find new people to follow in the new Explore section.
  • You can now see trending hashtags as they happen in Search > Videos/Beats.
  • Certified. OGs on Brapp will now have the Certified icon by their name3.
  • It is now easier to find beats that are used in videos.
  • It is now easier to save beats you like with the new “Save Beat” button.
  • You now get notifications on reposts, so you can see when your followers react to your reposts.
  • Check out your Mug Shot in Profile > Settings.
  • You can now see all the beats and videos you have Liked in Settings > My Likes.
  • It is now easier to Invite friends to Brapp via Facebook or SMS.
  • Lots of stability and speed improvements.

Finally, previous versions of the app were written in Swift 1.2 using Xcode 6.4 and the iOS 8 SDK. With this build, I migrated it to Swift 2.1 using Xcode 7 and the iOS 9 SDK. This means, among other things, that there is now San Francisco rather than Helvetica Neue throughout!

As ever, Brapp has been a really fun project to work on. I can’t say enough good things about the people behind it and I really believe this app is going to be a big deal. If you haven’t checked it out yet, you can get Brapp for free on the App Store. You can also read about the initial build and release and the v1.1 update last November.

  1. The audio filters were written by David Gibson; I did the integration with the Brapp project and UI. ↩︎

  2. Literally. ↩︎

  3. I am currently certified though I don’t think I will be for long bearing in mind I only have two ‘raps’ and I’m miming in both of them. I did record some sick beats during development but I deleted them pretty quick after recording! ↩︎

Sunday Isn't Special

Last night, the Government lost a vote in the House of Commons to change Sunday Trading Laws in the UK. I don’t usually blog about politics1 but Sunday Trading has been a big issue for me and, as a freelancer, I am incredibly disappointed that there will be no change in this ridiculously outdated law.

As it stands, there are restrictions on trading for shops over 280m². They may only open for 6 consecutive hours between 10am and 6pm2 and there are restrictions on loadings and deliveries. There are some exceptions (such as registered pharmacies, service station outlets, and farms) but pretty much all retail ceases in the UK at 4pm on a Sunday; go to any major supermarket at 3.50pm on a Sunday and you’ll find it packed as people rush to make their purchases before closing time. This is only a fairly recent development though; prior to 1994, the vast majority of shops couldn’t open at all on a Sunday! Thatcher tried to change this in 1986 but was defeated by Labour (protecting workers rights) and her own MPs (concerned with church attendence)3.

In his July budget after the 2015 election, George Osborne announced that the Government wanted to devolve control of Sunday Trading restrictions to local councils so they could decide whether shops could remain open for longer. I personally would have preferred a complete abolition of these rules (as happened during the run-up to the 2012 Olympic Games) but would have been happy with at least some move in the right direction. However, the vote was lost last night with Labour, the SNP, and 27 Conservative MPs voting against the motion.

I find this completely unbelievable in the modern age and massively hypocritical on the part of the SNP when Scotland have no restrictions on Sunday Trading4. Opposition gathered around a “Keep Sunday Special” motto but to my mind there is absolutely nothing special about Sunday. In the past, you could argue on religious grounds but that is irrelevant in the UK today when Atheism has overtaken Christianity5 and the number of actual practicing Christians is on a massive decline (just look at Church attendance).

Commenting on the vote yesterday, Mike Cherry, the policy director of the Federation of Small Businesses, said:

The current system can be seen as a great British compromise which allows families to spend time together, employees to work if they wish to, and provides much needed support for smaller retailers within their communities.

This is absolutely crazy. Families are not spending more time together because of these restrictions and Government should not be restricting free trade on this basis. It also isn’t supporting smaller retailers as large supermarkets have opened small stores on high streets to get around these restrictions. There is already sufficient protections6 against working on Sundays for workers which would not have changed with this bill. All this has done is penalise workers who wish to work longer hours on a Sunday and consumers (many of whom may also work on a Sunday) from making their purchases.

Consider a nurse, police officer, retail employee, or even a freelancer; if they finish their shift at 6pm on a Sunday, then they can’t go and do a weekly supermarket shop because the size of the store is deemed too big. I often work on a Sunday and then have to dash off to the local supermarket at 3.30pm when I realise I haven’t got any food for the evening. Whilst there are smaller newsagents or even smaller versions of supermarkets such as Tesco Metro, these often charge higher prices or don’t have the same amount of choice.

There is also the issue of online shopping; it is perfectly acceptable for somebody to make a purchase online at 7pm on a Sunday night but it isn’t legal for a retailer to sell them something from a physical building larger than 280m² outside of specific hours.

At a time when the economy needs a boost and there are regular complaints about a lack of jobs, it seems to me utterly stupid that there is a law preventing large retailers from creating more jobs. Whilst a separate issue, I’ve never understood why banks aren’t open after around 1pm on a Saturday; there are plenty of people who need work and it seems to me that opening for more hours would solve this.

Whilst I identify as a Conservative, I’m really more of a Libertarian. I believe the Government should have as little to do with people as possible and this is one of those areas where it really shows; a Government should not be able to stop a shop from selling goods at a certain time because of the size of the building it operates from. Scottish politicians should not be able to prevent shops in England from creating more jobs.

Sunday isn’t special. It is no different from any other day, especially if you are a shift worker or a freelancer that works whenever they can.

It is time for Sunday Trading restrictions to be totally abolished.

  1. I have a degree in Politics and have a number of strongly-held views but I don’t like to discuss them on my website which is really to advertise my freelance services. I do tweet about politics regularly though at @bendodson↩︎

  2. Most shops tend to open 10am-4pm although some will be 11am-5pm or even midday-6pm. ↩︎

  3. When I was studying Politics at A-Level, I couldn’t believe that Thatcher’s government had only lost 4 votes in 11 years and one was about the trivial issue of Sunday Trading. ↩︎

  4. Incidentally, I believe this should have been voted on separately to the Enterprise Bill in order to trigger the ‘English Votes for English Laws’ procedure which would have prevented the SNP from having any say over this. ↩︎

  5. The BSA survery in 2014 showed 49% identified as “no religion” with Christianity coming in at 42%. ↩︎

  6. Specifically, staff can “opt out” of working on Sundays even if they had previously agreed in their contract to work on those days. You also can’t be dismissed for not working on a Sunday. The Sunday Working page on the gov.uk website has all of the information. ↩︎

The Divide #9 - Board Game Tangents

Also known as “MithRail: One does not simply ride to Mordor”, the 9th episode of The Divide podcast is now available. This week, we discuss board games including such gems as 1861: The Railways of the Russian Empire, Terra Mystica, Takenoko, and Betrayal at the House on the Hill. We also have time to mention Super Hot, Deadpool, the HTC Vive, and some PC games that I’ve supported on Kickstarter!

You can get The Divide from these fine outlets:

Don’t forget to leave a review on iTunes and follow us on Twitter via @PodcastDivide.

Storefront Additions: A simple way to convert SKCloudServiceController store identifiers into country codes

In my article a few days ago, I noted that SKCloudServiceController would give you a storefront identifier but that there was very little information about how to use that identifier when using the iTunes Search API. As it turns out, Apple do provide a list of store identifiers with their respective ISO country codes on their iTunes Affiliate Links website - a big thank you to Loreto Parisi for directing me to it.

In order to make things a bit easier for other developers, I’ve put together a simple class and plist file that will automatically return a country code for the current user’s store. It’s incredibly simple:

StorefrontAssistant.countryCode { (countryCode, error) in
    if let error = error {
        NSLog("Error: \(error)")
    }
    if let countryCode = countryCode {
        NSLog("Country code: \(countryCode)")
    }
}

Storefront Assistant will automatically request permissions to access the Media Library and then fetch the current storefront identifier for the logged in user. If there are any issues (i.e. permissions denied, no connectivity, country code can’t be found) then an NSError will be returned.

Once you have the country code, you can then use the iTunes Search API to search for tracks in the correct country; these can then be used with MPMusicPlayerController for immediate playback or MPMediaLibrary for saving to the user’s Media Library.

The full code is available on GitHub.

Update, 10th Mar 2016: Loreto Parisi has put together some code in order to provide this list as a JSON file instead of a plist; he also has a Node JS implementation to scrape this information regularly from the iTunes Affiliate Link Website. Check it out on GitHub.

Update, 31st Mar 2016: Thanks to Matt Abras it turns out that the above code isn’t necessary; you can just use the undocumented s=143444 instead of country=gb when using the iTunes Search API.

« Older Entries Newer Entries »