Web-App Simulation

Right from the start, it was obvious that debugging the server is going to be hard to do. The data we are dealing with (mostly geo-location coordinates (latitude/longitude)) is not human readable, and very hard to understand. We realized we are in need of a tool that will help us visualize this data on a map.

Moreover, debugging the server would require a mobile client on the road, sending real GPS data for us to work with. And sending a person out for a test drive each time we got to working on the project wasn’t an option. So as they say, never send a human to do a machine’s work. We decided to develop an application that will simulate an actual mobile device on the road, a “robot” sending virtual location reports to the server.

The web-app simulator features & GUI are explained in the Features & GUI section.



Technology & Tools
Following are the technologies & tools we chose to work with to implement the web-app simulator:

Google App Engine Launcher
To speed things up, we realized we can’t handle working with the production server on Google cloud, while still in development, since uploading the code after each change would be a nightmare. Luckily, Google offers a desktop utility called Google App Engine Launcher which allowed us to run a local server on our network, and have the simulator connect to it while we debug. Later, the Android client connected to is as well.

http://localhost:8080/simulator - on our local server, and later:
http://busy-hour.appspot.com/simulator - on the production server

Java-Script (and HTML/CSS)
JavaScript is an object oriented scripting language and is primarily used in the form of client-side JavaScript, implemented as part of a web browser in order to provide enhanced user interfaces and dynamic websites.

We decided to use JavaScript because:
  • Portability - The simulator could be loaded into any browser in any OS by just entering it’s URL. 
  • We already had the server to host the web-app on. 
  • JavaScript has been long supported by Google Maps API, which is another tool we intended to use (more about it - next). 


Google Maps JavaScript API
The Maps API is a free service, available by Google, for any web site that is free to consumers. Google Maps has a wide array of APIs that let you embed the robust functionality of Google Maps into websites and applications, and overlay data on top of them.

We embedded Google Maps objects into the simulator to visualize the robots locations on it. As they moved on the map, we animated their position from one place to the other, based on the simulation path.

jQuery
jQuery is a free, open source, cross-browser JavaScript library designed to simplify the client-side scripting of HTML. Today, it is the most popular JavaScript library in use