Chapter 6

Service Development


  • Understanding the many choices in service development
  • Learning the three-tier service architecture
  • Understanding Spring and Hibernate: A conservative service stack
  • Building a RESTful web service for contacts
  • Building a synchronization service for contacts
  • Learning best practices for service design


Please note that all the code examples in this chapter are available at and as a part of the book’s code download at on the Download Code tab.

This chapter provides a getting started tutorial that enables developers to write their first backend data service — making sure that the service integrates well with Android. The focus is on web service development that supports mobile applications with code running on a backend service host, not in an Android handset.

The discussion addresses mobile computing issues raised in earlier chapters. The following problems hold particular relevance when thinking about backend services for mobile clients:

  • The network is not always available.
  • Scalability requires efficiency in network use and power consumption.
  • Mobile network connectivity is intermittent, slow, or altogether gone (when users drive into tunnels or otherwise off the grid).

The chapter example implements the RESTful contacts interface introduced in the previous chapter, and also explores the patterns from the previous chapter ...

Get Enterprise Android: Programming Android Database Applications for the Enterprise now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.