13.07.2015 Views

MobileBIT: - Instituto de Telecomunicações

MobileBIT: - Instituto de Telecomunicações

MobileBIT: - Instituto de Telecomunicações

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

It has a simple organization as follows:{"":{"config": {"":"",...},"in": {"":""|"/",...},"out": {"":"",...}},"":...}This structure can be seen as a collection ofkey/value pairs through which the blocks, that theend-user application will use, are i<strong>de</strong>ntified, andtheir basic configuration information is provi<strong>de</strong>d. Aslong as there is a correspon<strong>de</strong>nce between the representedblocks (CLASS in "") and Javaclasses (CLASS.class, in Java), the WFM will beable to instantiate and build the <strong>de</strong>fined system in runtime.This structure is not only easily read but can alsobe written or edited very simply. Future work will befocused on having this structure generated through avisual programming tool and fed to the applicationautomatically.Figure 1: Architecture of our <strong>de</strong>mo application, wherebiosignals are acquired from an external hardware <strong>de</strong>vice,displayed in a mobile <strong>de</strong>vice through a rich user interface,and sent to a remote server for efficient processing; the resultsof the processing stage is returned back to the phonefor presentation to the user.Conceptually, the framework uses three types ofblocks: a) the normal blocks, which take input data,perform a specific task, and output results; b) theSources, which are a special type of blocks that onlyhave outputs; c) Sinks, that are a special type of blockwhich only have inputs. Our framework has the un<strong>de</strong>rlyingassumption that the functional blocks aretriggered by the output data produced by the Sourceblocks, and thus, a normal system operational flowstarts on the sources and generally ends on Sinks (aspart 1 of Figure 1).All the information about the type, input/outputconnections and configuration of the blocks, which,overall, characterize a realization of a system, is representedusing a structure <strong>de</strong>fined according to theData Processing Language, which will be further <strong>de</strong>tailedin the next section.2.2 Data Processing LanguageThe <strong>de</strong>scription of a system to be instantiated by theWFM, is <strong>de</strong>scribed using a JSON-based specificationto which we called Data Processing Language (DPL).2.3 Workflow ManagerThe WFM is the core of the mobile framework, andit manages the execution and interaction between thedifferent blocks. It contains a handle to every importantinstance of the system, and it is through the WFMinstance that most of the others communicate.The most <strong>de</strong>manding task performed by the WFMis the initial network setup from the DPL structure.As soon as the end-user application starts, a JSONstructure, following the specification <strong>de</strong>scribed in theprevious section, is fed to the WFM. Then, using athe high performance JSON processing library, allblocks are instantiated sequentially, configured, andconnected among themselves through their input andoutput channels.Once the whole system is assembled, all that remainsto be done is to trigger it, namely by startingthe sources. Then, the arrival of the data itself to theinput of the next block triggers its operation, and soon. Finally, the processed data will arrive to a sinkwhich gets the flow to an end. Sinks end the flow eitherby saving, streaming or displaying their input.Usually, this action of starting the sources, istriggered by an UI event. Since the UI is shownthrough a Webview, which, in turn displays HTMLcontent, the native part of the application must beable to exchange events with the Javascript si<strong>de</strong>.Hence, the Webview class provi<strong>de</strong>s a method calledaddJavascriptInterface, that binds a Java objectto Javascript. This object turns out to be the interfacebetween the Java (the native Android) and Javascript

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!