I am currently in the processes of learning to write android applications. To aid in the learning, I have decided I am going to create an application that displays the posts and reviews on this site. This might well be the wrong way to go about these things, but I first needed to think about what sort of data I’m going to show, and how I’m going to get the data from its source. I know what I want to show, it’s just the “how” I needed to decide upon.
I could of course use some sort of SQL library and connect directly to the database from within the android application itself. This however, with the intention of the application being distributed to any number of devices, is not a good option. One I don’t want hundreds of separate database connections, and two I don’t want to have to code in database connections strings and passwords into the application itself. So the obvious solution was to create some sort of service that the application communicates with to retrieve the data. There are many out there but the one I decided to use, partly as it seems to become a widely used standard, and partly because I knew nothing about it, was OData.
So, background over, I’m going to briefly go through the steps I took to create my OData service. I will attempt to show you how easy it was to create, and then how difficult it was to actually deploy to a hosted service where I have no control of the IIS machine. I will also tell you how I solved said difficulties and got it working.