In this chapter, we’re going to look at using the camera. While in previous chapters I’ve endeavored to make the examples applicable to both retail and LOB app use, basic use of the camera is more LOB than retail.
The issue with the camera in retail is that just taking a photo is
actually very easy. All you need to use is the
CameraCaptureUI, and it’ll return a file
containing the photo. (You can also use this class to capture video,
although we won’t be looking at that in detail in this chapter.)
In LOB applications, or more specifically in field service applications (i.e., people in the field undertake work for the organization), there are some basic use cases for the camera. You typically need to use the camera to capture work that needs to be done (e.g., inspectors visit an estate and proactively look for problems to solve like graffiti or trash), or to capture the state of something before and/or after work has been done (e.g., you take a photo of a broken sink before you fix it, and again after you fix it). A common related use case is to capture a photograph of the premises if the operative gets to the site but cannot gain access.
All of those scenarios follow roughly the same process: take a photo, store it on a device, and send it to the server when you can.
This chapter will mainly center on building out the functionality to create new problem reports, which will include, among other things, capturing a photo and storing on disk, as well as storing ...