The TodayWatchFaceService
class does all of the work, including setting the layout, reading the configuration values, and painting the UI for every tick of the second. It isn't realistic to discuss over 700 lines of code in this chapter. So, we'll look at important snippets taken from this class definition:
public class TodayWatchFaceService extends CanvasWatchFaceService { @Override public Engine onCreateEngine() { return new Engine(); } private class Engine extends CanvasWatchFaceService.Engine implements DataApi.DataListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { ... } }