-
Create a new public git repo on Github
-
Create new project using your preferred development platform (i.e iOS dev use XCode, Android use Android Studio):
iOS:Create a XCode project with Cocoapods setup (https://cocoapods.org/)
Android:Create new Android Studio project with Gradle setup
-
Add a textfield which is width of the device and set the keyboard type to Done or Go
-
On keyboard return make a network request to validate the company name using the following API:
GET https://[COMPANY NAME].fusion-universal.com/api/v1/company.json
Note: please replace [COMPANY NAME] with the text from the textfield
- If the response is successful (status code 200) make the textfield green otherwise make it red
Replace the textfield text with the response name Company name request: fusion
Request example: https://fusion.fusion-universal.com/api/v1/company.json
Response example:
{"name": "Fuse","logo": "http://fusion.fusion-universal.com","custom_color":"#ea2184","password_changing":{"enabled":false,"secure_field": null}}
6. On textfield retry reset the textfield colour to white
- Commit code to Github once complete
- AppCompat
- ButterKnife
- Retrofit 2 with Gson converter
- Otto
- Waiting Dots
- Keyboard Action Go launches the call to the server by using an IntentService.
- The service runs the request using retrofit and passes the result to the Event Bus (Otto)
- MainActivity is subscribed to the Event Bus.
- Searching for "dev" is usually taking long.
- This can be used to test the behaviour after rotation while a search is performed.
- Having one only activity with such simple layout I decided no to include fragments.
- Instead of using color white on retry I have preferred to save the original Drawable and restore it