Otto is an awesome event bus library that allows us to decouple our application’s components.
We start off by integrating Otto into our application, and creating a handful of event objects that we will be using.
This video integrates the events that we defined in the last video into our change password dialog.
Now we can start implementing our “fake” in memory service layer that allows us to simulate a real web API without a connection to the Internet.
To make writing “fake” services easier, we factor out some code into a base in memory service class. We also finish implementing the fake API calls in our account service.
The first thing we need to do to finish our login and register activities, is to create the API calls requires to make them work in the form of the request/response event classes.
With our login and register events created, we have to create a fake/testing implementation of the calls themselves.
Finally, we we hook our register and login screens into our shiny new service layer.
With our auth token being saved, we now have to write code that will perform an auto-login if the auth token is still valid.