The Photo class
The first new thing we need is a class to hold the data structure of a photo.
We will need the class to have four string members for the title and three tags. This is quite straightforward. The photo itself, however, is worth further discussion. We have seen in Chapter 22, Capturing Images, that we actually capture a bitmap from the camera. It is possible to store images directly in a database, but we can probably be more efficient than this while at the same time keeping our code a lot simpler.
When the camera app in an Android device takes a photo, it saves it in internal storage already. If there was a way to refer to this image in storage, then we could just store the location in our database and then load up the image from the regular internal storage when we need it.
Such a location is known as a URI. In a somewhat simplified way, we can think of a URI as a file path or address (like a web address) that points to a page, image, or other resource type. There is even a...