Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


##Association Hello World

This HelloWorld shows the association library developed for the MediaScape project in action.


Installation | Prerequisite | Deployment | Run

###Installation ####Prerequisite

  • Install git
sudo apt-get install git
  • Install npm
sudo apt-get install npm
cd node-v0.X.X
make install
  • Install mongodb
sudo apt-get install mongodb-org
  • Start mongodb
  • Download Association repository:
    git clone https://github.com/mediascape/association.git

####Deployment Top

Next to this file you will find a script called deploy.sh. This script will clone the git and install everything in a folder called deploy relative to the file itsself. It will copy the server and the API including this HelloWorld sample. After preparing the files, the script will install all needed dependencies for the backend and start a small setup-script to configure it.

Once the system has been deployed, you have to set your bit.ly user and password in
"deploy/public/Catchers/js/mediascape/Association/association.js" and
"deploy/public/Triggers/js/mediascape/Association/association.js" files to could short
the URLs in the shorten processes. Also you have to set the chromecast application ID and the 
path to the receiver.html.

Please dont execute it inside the git folder. Best practice is to download just the the .sh file and execute.


The Shake&Go association needs the use of Discovery Agent REST to detect the shake. But it is very important to set the landing webpage that has to open to accede to the start of catching. It can be done in two ways:

  • Editing the url that you will find into the file url.txt inside the folder "/data/data/com.example.discoveryagentrest/files" of the device.
  • Before install the Discovery Agent REST editing the URL you will find in the following piece of code of the file ServiceBoot.java.
		    	 	Log.d("MyApp", "File Does not Exist.");
		    --->	final String string = new String("");  
		    	 	FileOutputStream fos = this.openFileOutput("url.txt", Context.MODE_PRIVATE);



For a better use of this example, it is very important to open the web page in a device. This device must have installed Discovery Agent RESTFUL service and a namedwebsockets that you will find in:

Native REST Agent


Namedwebsockets Proxy




After everything is set up, and the node.js server is started, you can access the Catcher and Trigger demos using the urls (depending on your setup):


When the page is loaded, it should show you the detected components and capabilities of your current device. Starting another Browser with the same URL this data will be shared via the applicationContext between all sessions.

Any time later you can start the node.js server via:

node index.js