A mobile application is bundled software that runs on a mobile device, presents a mobile user interface, and communicates with external APIs. Because users update bundled releases at different times, reliable API contracts help preserve a seamless experience. section 5.0
When API expectations drift
A movie-search mobile app requests /movies. The app changes its expected release field from a raw date to a year, while the API still returns a date. The mismatch appears only after deployment unless a consumer contract provides earlier feedback. section 5.0
A practical mobile application integration separates responsibilities:
- The data layer calls the external service through a MovieAPI interface and repository. section 5.1.2
- Retrofit maps the /movies response into MoviesDTO and Movie objects before passing data to the presentation layer. section 5.1.2
- An injectable client accepts its base URL, allowing tests to redirect requests to a Pact mock server. section 5.1.2
- Separate mobile and provider contracts let an API evolve for one consumer without silently breaking another. section 1.2
Figure 5.1 Mobile expected response with Year field and movies API actual response with Date field
Compare the mobile client's expected year field with the movies API's actual date field to see how an integration contract can drift. section 5.0
