September 2010

iOS Asset Library photo browsing experiments

Filed in iDevBlogADay, iOS Development | Comments (0) |

My photo browsing work has gone in fits and starts over the last two weeks, but I have made some progress through experimentation. Since upgrading to an iPhone 4, and the subsequent announced availability of iOS 4.2 on the iPad, I can now use the Asset Library framework in my prototypes. I want to use other photo sources eventually, but my first version will use the photo albums available on the device.

Experiments with Asset Library lead to experimenting with blocks and Grand Central Dispatch

One of features I want in my app is a photo stream that moves automatically across the device in some fashion, but still allows the user to control the pace. The first step was to build a simple prototype that browsed through the photo albums currently synced to the device.

The Asset Library framework is fairly small and handles all access to on device photos, videos, and the associated albums. Each photo or video is an “asset” in the library. The entry point is through the enumerateGroupsWithTypes:usingBlock:failureBlock: method in the ALAssetLibrary class. As you can tell by the method name, this method makes use of blocks to accomplish its work.

Objective-C blocks are very clean and crisp, taking care of otherwise messy implementation details such as automatically retaining and releasing objects referenced by the block. The syntax for the simplest executable block is:

^{}

which obviously doesn’t do very much, but clearly is not encumbered by extra baggage. A block is a closure that captures the state of any references external to the block and maintains them during the life of the block. Many languages and environments offer closures, and if you come from the Java world like I do, they are a welcome relief from the not-quite-good-enough nature of anonymous inner classes. It is very nice to be able to work with them in iOS.

Another feature of the latest versions of iOS that comes in handy with browsing the photo albums is Grand Central Dispatch (GCD). GCD was introduced to OS X in Snow Leopard, and to iOS in version 4.0. Many of the tasks that used to require creating separate threads can now be handled much easier and cleaner with GCD and blocks.

Here is one method from a very simple example that loads all the asset references on my phone into a mutable array ‘assets’ in the background while updating a simple status label on the main thread with the current asset count:

- (void) updateCount {
    self.statusLabel.text = [NSString stringWithFormat:@"Count: %u", [assets count]];;
}

- (void) loadLibrary {
    dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);

    dispatch_async(queue, ^{
        void (^assetEnumerator)(struct ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *asset, NSUInteger index, BOOL *stop) {
            if(asset != NULL) {
                [assets addObject:asset];
                dispatch_async(dispatch_get_main_queue(), ^{
                    [self updateCount];
                });
            }
        };

        void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) =  ^(ALAssetsGroup *group, BOOL *stop) {
            if(group != nil) {
                dispatch_async(queue, ^{
                    [group enumerateAssetsUsingBlock:assetEnumerator];
                });
            }
        };

        [library enumerateGroupsWithTypes:ALAssetsGroupAll
                               usingBlock:assetGroupEnumerator
                             failureBlock: ^(NSError *error) {
                                 NSLog(@"failure");
                             }];
    });
}

I do not completely understand all the interactions between GCD queue, the main thread, and the asset library enumeration. There is not a lot of information in Apple’s documentation about exactly what is going on, but it appears that each enumeration happens on the main thread, even if the caller is run from an asynchronous queue which is *not* on the main thread.

To ensure the loading does not tie up the main thread, and thus prevent GUI updates, I enclosed the call to “group enumerateAssetsUsingBlock…” in a block (lines 20-22) and put that block on the default queue to be run in the background as well. This particular pattern will load each asset in the background, but update the status label in the main thread properly.

Lines 12-14 illustrate the GCD method of running code on the main thread. It looks cleaner to me than calling performSelectorOnMainThread, and is certainly more flexible since it can include any code you wish.

Feedback from non-techies

In addition to experimenting with several different ideas and prototypes based on the Asset Library, I also was able to show a simple photo stream demo to an avid iPad user (my daughter!) while we were visiting my grandson last week. I think I conveyed my ideas fairly well to her, and although she doesn’t yet have an iPad (but wants one), nor does she yet have multiple thousands of photos, she is quickly heading that way. She is also the one who did much of the scanning and sorting a few years ago, so she has an idea of the pain point I am trying to address. She thought it a reasonable approach and as I turn my simplistic prototypes into a more complete app, I hope to get more detailed feedback from her and others.

360iDev Austin, November 7-10th

I finally sorted through my schedule for the fall and registered for 360iDev in Austin this November. If you are like me, and receive most of your iOS encouragement and growth virtually through the internet, you need to attend. I am as much a lone wolf as any developer out there, but the motivation and encouragement I receive from the iOS community through 360iDev keeps me coming back.

I am really looking forward to visiting with old friends and fellow iOS developers, to participate in the game jam, to learning more about iOS development and techniques for building an indie software business, and to being encouraged and motivated in my iOS development. You should register too!


As an indie developer, one of the best things you can do is to find like-minded developers that will provide encouragement and motivation while pursuing a commitment. A great collection of indie iOS developers have helped me stay on track, most of them are either developers associated with iDevBlogADay, or those I have met through the 360iDev conferences. If you can make it to Austin in November, I highly recommend it for its content, the friendships you’ll develop, and the passion it will bring to your iOS development.

Also, here is a little more information about me, Doug Sjoquist, and how I came to my current place in life. You should follow me on twitter and subscribe to my blog. Have a great day!

Useful podcasts for Indie iOS Developers

Filed in iDevBlogADay, iOS Development | Comments (0) |

Since it is time consuming to sort through all the resources on the internet and find useful stuff, I decided to share which podcasts I find useful as an indie for today’s iDevBlogADay post. (I have made progress on my iPad photo app, and hope to report on it next week.)

I do not have a fixed podcast listening schedule, but I eventually listen to almost every episode of the first five on my list. I only listen to selected episodes of the last three, partly because there are so many episodes. I usually listen to podcasts while working around the house or running errands since I prefer silence or music to help me focus while I work.  When I listen, these are my current selections and priorities:

  1. MDN Show
  2. Startups For the Rest of Us
  3. Dim Sum Thinking
  4. Core Intuition
  5. IRQ Conflict
  6. The Startup Success Podcast
  7. Small Business Marketing Blog from Duct Tape Marketing
  8. Mixergy

#1 MDN Show

At the top of my list is the Mac Developer Network show. It is hosted by Scotty (Steve Scott), @macdevnet and John Fox, @djembe.  The MDN show comes out roughly twice a month and each show is around 90 minutes long. It is a magazine format with a mix of regular segments, discussion of events in the Mac or iOS world, and developer interviews.

I enjoy the variety of segments and the community that Scotty has developed around MDN. The show is currently on summer break, but should be returning shortly — I look forward to the next episode.

From the MDN web site:

The Mac Developer Network Show (The MDN Show) is a one stop show for Mac, iPhone and iPad Software Developers. Enfolding, embracing and including some classic Mac developer podcasts such as Late Night Cocoa, The Mac Developer Roundtable, The Mac Software Business Podcast, Developer Lives and CocoaFusion as well as adding features such as news, views, reviews and the now infamous World According Gemmell in an easy to listen to magazine style format.

#2 Startups For the Rest of Us

This has become one of my favorite podcasts for advice and tips on indie based business. It is hosted by Mike Taber, @singlefounder, and Rob Walling, @robwalling, both of whom have solid backgrounds in micro-ISV businesses.

The focus is not platform specific, but each show has clear advice that you can easily adapt to your iOS based business. I do not keep most podcasts I listen to, but I have kept a number of their shows, including:

  • Episode 4, 8 Things We Wish We Knew When We Started Out
  • Episode 6, How to Get Traffic to Your Site
  • Episode 9, Our Biggest Startup Mistakes
  • Episode 11, The Five Biggest Hurdles to Getting Started

If you find any of the shows worthwhile, I would suggest start back with episode 1, and follow through to the present.

From Startups for the Rest of Us web site:

Welcome to Startups for the Rest of Us, the podcast that helps developers be awesome at launching software products. Whether you’ve built your first product or are just thinking about it. We are Mike Taber and Rob Walling. Combined we have over 20 years of experience as software entrepreneurs and we’re here to share those experiences to help you avoid the mistakes we’ve made.

#3 Dim Sum Thinking

This is a new podcast by Daniel Steinberg, @dimsumthinking. Each weekly show is relatively short and focused on a single topic related to professional and personal development told in a unique way.

I have really enjoyed Daniel’s story telling approach, and I look forward to new episodes.

From Daniel’s About page:

Apple gives third party developers the same advice. So many iPhone developers want to open up the development tools and start writing code. Apple’s advice is that you stop and identify carefully who your audience is and what problem they will be able to solve or task they will be able to accomplish with your app. Spend time prototyping your app on paper and really working on the human interaction before you write a line of code. Identify the audience and the story and story board your app just as someone might sketch out scenes in an animated feature.

#4 Core Intuition

Core Intuition is primarily a discussion between the hosts about a wide range of topics pertinent to developing for the Mac. It ranges from technical discussions of new Apple frameworks to conferences to handling user support to marketing your software. It is hosted by Daniel Jalkut, @danielpunkass, and Manton Reece, @manton.

I like the variety of the discussions, and even though not every show has something directly applicable to my day to day work, it helps give me a broader perspective on developing a software based business.

From Core Intuition’s web site:

Core Intuition is a podcast about the process and life of Mac development.

#5 IRQ Conflict

IRQ Conflict is a short podcast which began earlier this year and comes out roughly twice a month. The format is similar to the old “Siskel and Ebert” movie reviews where the two hosts, one a Microsoft developer, and the other a Mac developer, react to a series of tech items in the news. It is hosted by Justin Williams, @justin, and Mikel Berger, @mikelberger.

Living in an iOS world (and in my case an iOS and Java world), I can easily lose touch with the perspective outside those worlds. This short podcast is entertaining, and occasionally provides a perspective I might not have considered.

From IRQ Conflict’s web site:

Apple Developer. Microsoft Developer. FIGHT!

Debates about the 5 top tech stories from the past few weeks. All in about 10 minutes.

#6 The Startup Success Podcast

The Startup Success Podcast interviews someone different each week ranging from consumer startups using technology to enhance their core business to technical startups that sell software or services. It is hosted by Bob Walsh, @bobwalsh, and Patrick Foley, @patrickfoley.

I have been listening to the Startup Success Podcast longer than any other business oriented podcast, and even though I don’t listen to every show, I listen to most and usually benefit from the interviews.

From the Startup Podcast web site:

The mission of The Startup Success Podcast is simple: make microISVs, startups, Mac indies and everyone pursuing the dream, challenge and reality of starting their own software company more successful. Each week, we hope to bring you about 20 minutes of valuable information on the business, technical and social developments, tools and trends that will give you an assist in your startup.

#7 Small Business Marketing Blog from Duct Tape Marketing

Duct Tape Markerting is not a tech focused podcast by any means, but there is enough variety that you will find useful information here. It is hosted by John Jantsch, @ducttape.

I do not listen to every show but the content and interviewees in this bi-weekly podcast are diverse enough that I usually listen in full to an episode every month or so.

From the Duct Tape Marketing web site:

His blog was chosen as a Forbes favorite for marketing and small business and his podcast, a top ten marketing show on iTunes, was called a “must listen” by Fast Company magazine…His practical take on small business is often cited as a resource in publications such as the Wall St. Journal, New York Times, and CNNMoney.
“John Jantsch is the Peter Drucker of small business marketing tactics.” — Seth Godin, author of Linchpin
“Business blogger John Jantsch, a Kansas City marketing consultant, has built quite a following with his Duct Tape Marketing site. The blog provides small-business readers with successful marketing techniques that don’t require a large budget to execute.” — Harvard Business School

#8 Mixergy

Mixergy is really a video interview show, but I subscribe to the audio podcasts. There are far more shows than I could watch or listen to, even if they applied (multiple hour long shows per week), but I do subscribe to the feed to keep an eye out for interesting interviews. It is hosted by Andrew Warner, @AndrewWarner.

Many of the interviews do not appeal to me, but there is usually one or two a month that I really find useful or captivating. I have kept a couple of Mixergy interviews, including:

  • How Shopify Became Profitable By Helping Anyone Open An Online Boutique with Tobias Lütke
  • DODOcase: How An iPad Case Generated Almost $1 Mil In Revenue Within 3 Months with Patrick Buckley

From Mixergy’s web site:

The Mixergy Mission

The Mixergy Mission is to introduce you to doers and thinkers whose ideas and stories are so powerful that just hearing them will change you.

The Mixergy Mission is to give you an alternative to the “know-it-all, professional gurus.” I want to convince you that no single person knows it all. I want to show you that the best way to grow is to learn from a mix of smart people who are willing to share their expertise and experiences.

The Mixergy Mission is to infect you with a passion for business and then help you build your business.

The Mixergy Mission is to encourage YOU to have a mission, not just a startup, not just a company, but a calling.

The Mixergy Mission is to act as a counter-weight to all the venture capitalists who’ll try to convince you that the only reason to build a business today is so you can flip it tomorrow. The world isn’t changed by people who have an eye on the exit.

The Mixergy Mission is to convince you to follow a vision so big and important that you can’t do it alone. Then I want to give you a mix of wicked-smart people who will help you achieve it.

The Mixergy Mission is too big for me to achieve alone. If what I’m describing here calls to you, jump in and join me.


As an indie developer, one of the best things you can do is to find like-minded developers that will provide encouragement and motivation while pursuing a commitment. A great collection of indie iOS developers have helped me stay on track, most of them are either developers associated with iDevBlogADay, or those I have met through the 360iDev conferences. If you can make it to Austin in November, I highly recommend it for its content, the friendships you’ll develop, and the passion it will bring to your iOS development.

Also, here is a little more information about me, Doug Sjoquist, and how I came to my current place in life. You should follow me on twitter and subscribe to my blog. Have a great day!

A problem to solve

Filed in iOS Development | Comments (0) |

Finding the pain

Old Slides and PhotosI have a confession to make. I take a ton of photos.

From 1982 when I got married until about 1999 I took thousands of slides and prints (I have four children and dozens of extended family members.) Since 1999 I have been completely digital and taken thousands more. Most of our slides and prints are now scanned and I have over 15,000 digital photos — all synced to my iPad which has become a very fun family photo album.

In the last five years I have built a dozen slideshows for open houses, graduations, weddings, and anniversaries. Each of those slideshows turned out well, but required many hours of work. Scanning physical photos is a very labor intensive task, but fortunately I am close to 90% complete in that task.

I have tried many different photo organization methods over the years, but currently have a very simple method: I keep a separate folder for every slide tray, every print album, and every month of digital photos.

But, something that still takes much more time than I would like is finding the photos I want to include in a given slideshow.

I plan to build something to ease that pain point.

Past attempts to ease the pain

My first “major” slideshow was for my oldest daughter’s high school graduation and open house. We homeschooled our children, so this was a very personal and exciting time for us, and I wanted it to be special.

During that year I purchased a slide scanner, and she scanned in all our slides (from her birth in 1987 until my Pentax SuperME died in 1997), and select photos from the albums between my slides and digital camera era. By the time she was finished, we had over 10,000 photos to search through to produce the slideshow — a bit overwhelming.

I don’t remember exactly what software I tried during that time, but I know I looked at dozens and tried most of them at least a little. I do know that I could not find anything very useful for selecting the photos I wanted — so I did what any good hacker does, I rolled my own.

Through several iterations, I ended up with a simple Delphi application (once my favorite development environment!) that would allow her to quickly browse all those photos and identify all the ones where she appeared. It worked pretty well given it’s limitations, but by judicious use of workarounds and copying of directories, it helped us narrow the 10,000+ photos to around 3,000 that had her in them. We then used the same application to select out a subset of those 3,000 to produce a set of photos we wanted to use in the slideshow. I used slightly enhanced versions of that application and other simple methods for my oldest son’s graduation in 2007, second son in 2008, and youngest daughter in 2010.

For other slideshows I have used simple methods such as general file browsing using my MBP and copying the photos I wanted to a new directory. Not terribly difficult, but pretty time consuming.

What I really want

Until Google or someone develops image searching as good as the text web crawling available today, I do not think any completely automated method of finding photos will ever satisfy me. I would love to tag all my photos with names, events, places, etc., but even if facial recognition improves a great deal, doing so will remain an intensively manual process.

Now that I have an iPad with a copy of all my photos, it is amazing how quickly I can flow through photos and find individual photos I had forgotten about. I want to take that ease of browsing on my iPad and apply it to quickly select a set of photos that can then be turned into a slideshow.

My App idea

My target customer is someone who has thousands of digital photos, probably only loosely organized, and wants to select a subset of those photos for a slideshow or other display.

The initial requirements for my iPad app are:

  • create a project that will hold the state and can be edited later,
  • select photos from iPad albums,
  • attach a playlist,
  • play slideshow on iPad or through video out.

Current status

Initial MockupI first started mocking up something like this at the iPadDevCamp in San Jose last April. The purpose of iPadDevCamp was to show what could be done within the constraints of the existing platform, but since iOS 3.x does not allow access to to photo albums on the device, I shelved the idea. It has now been announced that iOS 4.2 will be available on the iPad, so my idea is viable again.

During iPadDevCamp, I came up with some screen ideas using iMockups that are my starting point this week. I shared those ideas with other developers there and received useful advice, and will take that into consideration as I develop some prototypes. I have talked with some local iPhone users about my idea, but not in detail, and none of them are iPad owners.

This week I began exploring the AssetsLibrary framework in the iPhone simulator, but will have to wait for a 4.2 beta SDK before I can play with the iPad simulator or device. Since I will need some photo sources in the meantime, I spent some time experimenting with other options, and decided to start with a simple ftp based photo loader for now.

What’s next

It is vital to find potential customers early so I can validate my ideas, but that will definitely be a challenge for me. I am reading through Steve Blank‘s book “The Four Steps to the Epiphany”, about his customer development process and even though it is probably geared towards multiple developer startups, it has given me some insight into how to begin.

Once I have a simple photo loader to simulate photo album access, I will begin prototyping various ideas. I have learned to treat my prototypes as disposable code so I can move quickly, hopefully I will stick to that.

My task list for this next week:

  • Prototype methods for quickly browsing a set of photos,
  • Begin building a customer development plan,
  • Find at least one local iPad user with a decent collection of photos.

Mini-review of Sun Scout app

Filed in Miscellaneous | Comments (0) |

I finally gave in and upgraded my phone (iPhone 3G) and my wife’s phone (older RAZR) to iPhone 4’s this week. Since I had skipped the 3GS, this was my first extended experience with all the new cool stuff like compass and video, and now with the iPhone 4 the gyroscope and retina display. (I am definitely enjoying the upgrade, but I did find out something about my wife that I did not know: her normal method of holding her phone is the dreaded “iPhone death grip.”)

I wanted to try out an app that took advantage of some of the new features and found Sun Scout by fellow indie developer, Benjohn Barnes of Splendid Things. SunScout’s website says:

Sun Scout shows you live what your phone’s camera sees, but augments the image with where the sun will be at each hour of the day. To see everything that might cast a shadow on you, simply sweep your phone across the sky from dawn to dusk.

and Benjohn also has a video tutorial on calibrating your iPhone compass so that SunScout works best.

Track of sun across the sky at hourly intervals, large arrow points the way to current sun track
SunScout is an augmented reality app with a clear, single purpose: Show me where the sun will be based on my current position. Once I calibrated my compass, I checked the image for 18:00 (my current time) and it was within a few degrees of the actual position of the sun. So SunScout fulfills it’s basic mission just fine. The sun track is displayed for each hour which seems to be enough information to be useful without overcrowding the image.

In cases where you cannot currently see the sun because it’s night, heavily overcast, or you live in the UK like Benjohn where it only comes out once in awhile, he has added a large yellow arrow that directs you back towards the sun’s arc for the day.

Like many iPhone users, I download and try quite a few apps that I delete shortly thereafter. But, this simple app is interesting and useful enough that it stays.

Putting more focus in my focus

Filed in iDevBlogADay, iOS Development | Comments (0) |

Time to focus!


Your focus needs more focus

Recently my wife and I saw the Karate Kid remake at the second-run theater (yes, I’m a cheap date), and the “your focus needs more focus” scene grabbed my attention. It prodded me to clarify where I am on my iOS development path.

One of the few drawbacks to being an indie developer is finding ways to make and keep myself accountable to someone. I made a commitment to make iOS development a major component of my work, and I am pleased with my progress. I am proficient in key areas; knowledgeable and growing in others; and am actively doing iOS contract work. But, I still have not published one of my own apps on the App Store. I could come up with a long list of reasons, but I don’t want to feed those thoughts.

Instead, I want to put some more focus in my iOS focus, so I will be using my iDevBlogADay posts as a method of accountability.

My options

I have sketched out dozens of app ideas both on paper and in iMockups. I have prototyped or brainstormed dozens of game mechanics and themes. I have downloaded dozens of apps and games looking for inspiration. One thing I know for sure: I no longer need more ideas, I need to choose.

In evaluating my current development skills and knowledge, I am:

  • very strong in overall development and design,
  • getting pretty good in iOS development,
  • not far past the novice stage in game design.

So, I believe my best option is to refine one of my non-game ideas, develop it into a viable app, polish until it shines, and release. I am not giving up on my game ideas, but my shortest path to a polished app in the store does not lie that way.

My plan

Early and continual engagement with real users is important, so an on-going task will be to involve a variety of other people. I hope to get at least one new person involved each week, as well as building on previous contacts throughout the process to:

  • solicit feedback on my ideas, sketches, and mockups,
  • watch new and old users try out the app with limited instruction,
  • ask what features are missing, and what ones should be dropped,
  • do usability testing.

I will keep each development iteration short to keep momentum and see regular bits of progress. I will not be able to devote myself full time to the project, so I need to do things that will keep me passionate about it.

To that end, by next week’s post, I will have:

  • chosen an initial app idea,
  • developed a clear focus for the first version,
  • produced one or two mockups to share,
  • built a description of my target customers,
  • discussed my idea with at least two people that fit that description.

Defeating the “Squirrel Factor”

I plan on posting each week on my progress, and hope for some feedback from others from time to time.

So, if you see me chasing after squirrels, I’d be thankful if you follow me on twitter and give me a tweet slap, or post comments demanding some progress so I don’t end up like Dug from Up!

Squirrel!


As an indie developer, one of the best things you can do is to find like-minded developers that will provide encouragement and motivation while pursuing a commitment. A great collection of indie iOS developers have helped me stay on track, most of them are either developers associated with iDevBlogADay, or those I have met through the 360iDev conferences. If you can make it to Austin in November, I highly recommend it for it’s content, the friendships you’ll develop, and the passion it will bring to your iOS development.

Also, here is a little more information about me, Doug Sjoquist, and how I came to my current place in life. You should follow me on twitter and subscribe to my blog. Have a great day!