Java WebDAV Server Example for Android

This sample is a Class 2 WebDAV server that runs on Android. It uses modified NanoHTTPD as an application server and publishes files from a mobile application folder or from media folder. Locks and properties in SQLite database.

To see the documents a user opens a sample web page served by this server sample in a web browser on any machine in the local network. A user can open, edit and save documents back to the device as well as a user can upload, download and manage documents using any WebDAV client.

Requirements

  • Android API Level 19

Setting the License

To run the example, you will need a valid IT Hit WebDAV Server Engine License. You can download the license in the product download area. Note that the Engine is fully functional with a trial license and does not have any limitations. The trial license is valid for one month and the engine will stop working after this. You can check the expiration date inside the license file. Download the license file and specify it's content in License field under DavEngineOptions in /androidfsstorage/app/src/main/assets/webdavsettings.json file.

You can also run the sample without explicitly specifying a license for 5 days. In this case the Engine will automatically request the trial license from IT Hit website https://www.webdavsystem.com. Make sure it is accessible via firewalls, if any. After 5 days the Engine will stop working. To extend the trial period you will need to download a license in a product download area and specify it in webdavsettings.json

Accessing files via WebDAV

By default your server runs on port 8181. After running the application on Android you will see the following screen with the instructions about ho to connect:

Connection instructions are displayed when you run the Android WebDAV Server.

Open a web browser on any machine on the network and navigate to the WebDAV server. 

See Also:

 

 

Next Article:

WebDAV Server Example with Versioning, Java