The backend for this was set up by our engineers using Ruby on Rails, providing a communication interface for the Android app. An interesting fact is that the supported device types were selected based on a list of the most used devices of the actual website users.
The existing backend did not provide any APIs or web services, so our expert software engineers had to figure out how to establish an interface with it, before they could do anything else. Several API methods were created to this end. The good news for our engineers was that Ruby on Rails makes the task of implementing RESTful APIs quite easy and smooth. First of all the geographical coordinates for the received orders had to be added. We decided to stick with the geocoder gem to do this. Already a delayed job gem was used in the project so it was an easy task to move the coordinates into a background process. Thanks to the high level of expressiveness of Ruby on Rails, it took only a few lines of code to implement asynchronous coordinates resolving for the creation of orders.
As a developer, you are only as good as the existing code you have to work with, and since the quality of the backend code was quite high it was easy for us to develop several API methods for our application and to integrate it with the Google Cloud Messaging platform.
A lot of attention was paid to the fact that only orders with successfully processed payments had to be displayed. Recurring orders (e.g. cleaning tasks once a week) were also an interesting part of the app to handle. In order to implement geographical routing to the job`s location, we used Google Maps, which worked very well.
Our engineers managed to create a simple UI/UX for the mobile app, and all screens were designed by us and approved by Cleanagents.com. In order to ensure a consistent design and branding, the same icons and color schemes were used as on the existing website. As for the distance calculations and routing functions of the app, this part of the project was rather more fun to test, as it allowed us to walk out of the office with our devices and take a breather after a long day of coding.
As far as Android-specific programming is concerned, we used the GreenDAO library to automatically generate all entities and DAO’s. The interaction with the newly created APIs of the backend was handled by a Retrofit library, which automatically builds appropriate request/response processing methods according to the API descriptions provided. We also used the EventBus library to decouple application components as much as possible. Those solutions allowed us to develop the required application in about two weeks and the whole project needed less than 2500 lines of Java code. Which is good news, because less code usually means fewer bugs!