Take a Picture, it'll Last Longer

Introduction

One of the more exciting aspects of having a smart phone is the ability to capture a photo. (This function is actually available in feature phones as well, but the number of things you can do with the camera's results are limited.)

For the Futile Fishing application, it's important to be able to snap a photo when a fish has been caught. Besides, without photographic proof, your buddies may not be inclined to believe that you caught a six foot snapper. ;-)

There are two approaches for integrating the camera within a mobile application. One approach is to completely customize the experience. This involves creating custom surfaces, duplicating some of the built-in controls, and carefully managing a series of events. Yet, despite the extra work, this approach usually provides the most immersive experience. (Think about applications such as Instagram; the basic functionality of the app mandates a truly customized and smooth experience.) The second approach is to take advantage of some built-in services that are available on each mobile platform. This approach isn't a seamless user experience, but in many cases, it's the right combination of minimal development, and sufficient functionality.

For this article, I plan to take the second approach. I made this decision, because it's not vital to significantly alter the basic steps involved in capturing a picture. In fact, it could very well be a distraction for people who are used to using the built-in camera.

Platform Differences

In prior articles, I made the argument that it was usually best to implement similar views (or view controllers) in the same manner on both platforms. This, however, is a place where I make an exception. For iOS, I'll continue to use multiple view controllers. However, for Android, I'll use a new activity. I'm doing this for two reasons:

  1. The detailed steps around capturing a catch make it optimal for capturing it in an isolated activity.
  2. I've implemented the launching of (and returning from) an activity in a way that closely emulates the view controller model.

I could have used multiple view controllers, and it would not have been "wrong". However, given that multiple activities helps me isolate dependencies, I feel it's the better approach to this particular situation.