title: Embedded web server with REST API framework for Android
body: <p>I am using Backbone.js to build a 'hybrid' web app, which will be served as a native app using Phonegap. One thing I need is offline support for a large amount of data, and so we are considering using native code to synchronise the offline data with the server, and just transfer the bits of data we need to the web app when necessary. (An alternative approach we considered was using the Phonegap storage plugin but this is backed by WebSQL which seems to have a 5MB quota, which is too small for what we need).</p>
  
  <p>As the app is based on Backbone.js, which expects a RESTful API as its backend, we are toying with the idea of embedding a <a href="https://github.com/mattstevens/RoutingHTTPServer" rel="nofollow">RoutingHTTPServer</a> into the native layer - essentially this allows us to embed a local web server in the app, so that the web layer can request data using standard RESTful calls to the local server. The beauty here is that the Backbone app doesn't know any different - the workflow is entirely the same as requesting data from a remote server.</p>
  
  <p>I was wondering if there is an equivalent of <a href="https://github.com/mattstevens/RoutingHTTPServer" rel="nofollow">RoutingHTTPServer</a> for Android? I have seen projects like <a href="http://code.google.com/p/i-jetty/" rel="nofollow">iJetty</a>, but ideally I would like something which gives the REST-API bit out of the box too (like RoutingHTTPServer does). Would something like <a href="http://www.sparkjava.com/" rel="nofollow">Spark</a> work on Android?</p>