I am happy to announce the Ti.OneTok module for Android. This joins the iOS module created a few months ago.
The Module
The Ti.OneTok module provides a wrapper around the OneTok SDK allowing you to call it from your Titanium Project. The Ti.OneTok module is available for download from the github project.
The Code
The complete code, documentation, and example app.js is available for download on github
Android – Module, Documentation, and example
iOS– Module, Documentation, and example
Ti.OneTok is available under the Apache 2 license so feel free to fork, extended, and contribute.
The Example
function startRecording(){ var oneTokOutput = []; //This method is called on error function onError(e){ Ti.API.info(e); alert('Errored while recording'); }; //This method is called as OneTok processes your //speak results. This will be called several times before finish function onResults(e){ Ti.API.info("results=" + JSON.stringify(e)); //We add the pending results to be used later. oneTokOutput.push(e); //You can check the result_type to determine if //a valid result has been returned if(e.result_type=='valid'){ Ti.API.info("Valid Results=" + JSON.stringify(e)); } }; //This method is called when the recording session has finished function onFinish(e){ alert('Recording Completed'); Ti.API.info(JSON.stringify(oneTokOutput)); }; if(!Ti.Network.online){ alert("I'm sorry a network connection is needed to use this module"); }else{ oneTokSession.startRecording({ onResults:onResults, //Add callback to process results, called many times onError:onError, //Add callback to handle error messages onFinish:onFinish //Add callback to handle when recording has finished }); } };