aeroxr1 aeroxr1 - 4 months ago 21
Android Question

Develop an Android Webdav server

in my app I have a NanoHttpd server
but now I want to add a webdav support. I'm looking for some tutorial or advices to do that, but I found only jackrabbit library without any tutorial or guide.
Have you some suggest to give to me ?


A few people have integrated milton into their android apps to add webdav server capability. See here -

Links to tutorials are on the home page. Nothing specific for android, but it should be straight forward.

(as per comment below regarding nanohttpd) To integrate with nanohttpd you would need to implement the Request and Response interfaces, to wrap data from nanohttpd. And you would need to create an instance of miltons HttpManager, and pass the request and response objects to its process method for each request.

Note that milton is integrated with the Simple http container out of the box (called Simpleton), so you could use that instead of nanohttpd. Just create an instance of io.milton.simpleton.SimpletonServer and call its start() method

You can follow the Simpleton implementation code as a guide to integrating with nanohttpd if you want to use that:

This shows a fairly typical integration, from io.milton.grizzly.GrizzlyServer. Pretty simple really.

public void service(Request request, Response response) throws Exception {
    GrizzlyMiltonRequest req = new GrizzlyMiltonRequest(request);
    GrizzlyMiltonResponse resp = new GrizzlyMiltonResponse(response);
    httpManager.process(req, resp);