Mockup an android app which can talk to WebSocket backend.
The background of the challenge is to achieve realtime data synchronization bewteen the app and backend, e.g UI update when data changes.
To save your time setting up the test environment. We've prepared a preconfigured online server as well as a simple debug client
In your app, you may connect to the online server or setup one locally from socket-io-faker. And play it with ThreePin to get familiar with its behaviour.
The fake server will respond to following operation.
- version: setup the api version
- login: login to the system
- create: create new guest
- find: find a list of existing guests
- logout: logout the system
It will also publish an update on guest status every 10 seconds
Please note that
- 'login' is allowed only after setting up the api 'version'
- 'create' and 'find' are allowed only after 'login'
- after 'logout', 'create' and 'find' will not be allowed
Create an android app which can
- configure the server url and port
- connect to the server
- enter username and password
- login to the system (emit version then login)
- fetch the guest list and display their name and attended states
- update attended state when receiving message from server
All messages are emit and listened on event 'api'. The content of the message is as following
{
"op": "version",
"payload": "v1"
}
See sample messages for more.
The server will respond in following format
{
"op": "out",
"payload": {
"version": "v1",
"methods": ["create", "currentUser", "find", "findOne", "login",
"logout", "remove", "sync", "update", "version"
]
}
}
See answering rules of the fake server for details.
- Project will be evaluated on the basis of:
- fit with requirements
- datastructures and control structures used
- code conventions (comments, naming)
- unit tests provided
- code comments
- On the fake server, only
op
name is checked, but you should encapsulate necessary data, pretending to talk to a real server. - Please focus on the communication part rather than UI.