Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
Catchers
Triggers
README.md
deploy.sh

README.md

##Association Hello World

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

Navigation

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
./configure
make
make install
  • Install mongodb
sudo apt-get install mongodb-org
  • Start mongodb
mongod
  • 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.

Shake&Go

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.
            ...
            if(!file2.exists()){
		    	 	Log.d("MyApp", "File Does not Exist.");
		    --->	final String string = new String("http://192.168.10.21:7000/Catchers/");  
		    	 	FileOutputStream fos = this.openFileOutput("url.txt", Context.MODE_PRIVATE);
		    	 	fos.write(string.getBytes());
		    	 	fos.close();
			}else{
            ...

Complements

Top

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

https://github.com/mediascape/discovery-self/tree/master/complements/discovery-agent-REST

Namedwebsockets Proxy

https://github.com/mediascape/discovery-self/tree/master/complements/namedwebsockets-proxy

run

Top

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):

    http://localIP:7000/Triggers/
    http://localIP:7000/Catchers/

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