A Java HTTP client for consuming TheDavidBox Service API of Networked Media Tank devices
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


TheDavidBox client for Java (thedavidbox-client4j)

Build Status Coverage Status PayPal donate button
Bitcoin donation BTC: 13t5W36tcrirhwwMG8WkDDc5aa89acmJe5
Ethereum donation ETH: 0x7fC401f9ca6c707177Bc082d193A1C7120659C51

thedavidbox-client4j is a Java HTTP client for consuming TheDavidBox Service API on Networked Media Tank devices such as Popcorn Hour A200, A210, A300, A400, A410, C200, C300, PopBox 3D, PopBox V8 based in NMT system


java 1.5+

Getting Started

The latest thedavidbox-client4j artifacts are published to maven central. Bringing thedavidbox-client4j into your project should be as simple as adding the following to your maven pom.xml file:

      <version>1.2.1</version> <!-- or whatever the latest version is -->
  <!-- Maven dependency for an Android application project -->
      <version>1.2.1</version> <!-- or whatever the latest version is -->



Creating a client:

/** Create a client with default client options */
TheDavidBoxClient theDavidBoxClient = new TheDavidBoxClientImpl("IPorHostName");

/** Create a client with your custom default client options */
ClientOptions clientOptions = new ClientOptions.Builder()
	.defaultRotationDegree(RotationDegree.ROTATION_270)	//override default
	.defaultSlideInterval(23)							//override default
	.defaultDisplayMode(DisplayMode.SHOW)				//override default

TheDavidBoxClient theDavidBoxClient = new TheDavidBoxClientImpl("IPorHostName",

The thedavidbox-client4j operations are divided in ten modules: ModuleDownloadManager, ModuleDeployment, ModuleFile, ModuleNetworkBrowse, ModulePlayback, ModuleSetting, ModuleSystem, ModuleMetadata, ModuleMetadataDatabase, ModuleUpnp.

Create and execute an operation from a module:

//Get the module for the operation
ModulePlayback modulePlayback = theDavidBoxClient.getModulePlayback();

String audioPath = "file:///opt/sybhttpd/localhost.drives/SATA_DISK/music/mock.mp3";

/** Operation start audio on NMT. It is built using the DisplayMode specified in your
default client options so you don't need to specify it every time. */

/** Or redefine the attributes for the operation at any time */
StartAodOperation startAodOperation = modulePlayback.buildStartAodOperation(audioPath);
startAodOperation.setDisplayMode(DisplayMode.HIDE); //background mode

//Other operation examples
CreateDownloadTaskOperation operation = theDavidBoxClient.getModuleDownloadManager().
    buildCreateDownloadTaskOperation("http://movie.torrent", "MovieName");

ListNetworkResourceOperation operation = theDavidBoxClient.getModuleNetworkBrowse().

Using an operation listener will provide information about requests and responses from the NMT device:

public class OperationListener implements TheDavidboxOperationListener{

	public void onSendHttpRequest(String request) {

	public void onReceiveXmlResponse(String xmlResponse) {


//Use the constructor providing the listener
TheDavidBoxClient client = new TheDavidBoxClientImpl("IPorHostName",
      clientOptions, new OperationListener());

About the responses:

try {
	ResponseGetPlaybackSpeedVod response = theDavidBoxClient.getModulePlayback().

	//Check first that response is valid
	if (response.isValid()){
		logger.info("Speed: " + response.getSpeed());
	} else {
		//if it is not valid you can see a description for the problem
		logger.info("Problem description: " + response.getTypeReturnValue().
} catch (TheDavidBoxClientException e) {
	//NMT device is switched off, problem parsing xml response, unreachable IP address, etc...

Building / Testing

To build locally you must use Java 1.5+ for compiling and apache maven 3.0.3+

mvn compile

To run tests:

mvn test


If you find any issues please report them or better, send a pull request.


  • Rafael Iñigo (vikingBrain)


Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Disclaimer third parties

All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them. All specifications are subject to change without notice. Popcorn Hour, Popbox, Networked Media Tank and SayaTv are trademarks of Syabas Technology Inc., Registered in the U.S.