Updating the Model Layer
Figure 20.6 shows the relationship between CrimeFragment, Crime, and Photo.
Figure 20.6 Model objects and CrimeFragment
Adding a Photo class
Create a new class in the com.bignerdranch.android.criminalintent package. Name it Photo and leave its superclass as java.lang.Object.
In Photo.java, add the fields and methods shown in Listing 20.8.
Listing 20.8 The Photo
class (Photo.java
)
... public class Photo { private static final String JSON_FILENAME = "filename"; private String mFilename; /** Create ...
Get Android Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.