UI Handler SMS
Handles abstract UI presentation coming from the applications and presents it to the user in form of SMS (Short Message Service) message.
Artefact: SMS UI Handler | |
---|---|
Maven artefact | org.universAAL.ui / ui.handler.sms |
Pax Composite bundle | scan-composite:mvn:org.universAAL.ui/ui.handler.sms/x.y.0/composite |
Karaf Feature | uAAL-UI.handler.sms |
Maven Site | https://universaal.github.io/ui/ui.handler.sms/index.html |
Handles dialogs containing sms message and a number to send this message to and forwards it via designated SMS Gateway server to the receiver's mobile phone. This UI handler is somewhat specific in sense that it is not full-scale UI Handler (it does not have the capability to render all abstract representations of the UI data model). It uses bulksms server to forward SMS messages internationaly. Note: current implementation uses trial account of bulksms which allows sending of only 5 sms messages per account (see here prices for buying more credits: http://bulksms.vsms.net/w/pricing.htm). For testing purposes simply create new trial account when free sms messages are depleted.
Check credits by logging in here http://bulksms.vsms.net/ Account info is read from the external configuration file in configurations/ui.handler.sms.
Default account info is following: user=uAAL pass=universaal
All that is needed for sending sms (apart from including SMS Handler bundle in the launch configuration with working account for bulksms and working internet connection) is including following code into your application:
//create dialog to send to SMS handler
Form f = Form.newDialog((String) null, (Resource) null);
new SimpleOutput(f.getIOControls(), null, null, mobileNumber);
new SimpleOutput(f.getIOControls(), null, null, sms);
//create UIRequest
UIRequest uiRequest = new UIRequest(new User(userURI), f,null, Locale.ENGLISH, PrivacyLevel.insensible);
// set modality (in general this is not done in applications but in DM but since SMS
// handler this "recommendation" from the application will not be changed by the DM)
uiRequest.setPresentationModality(Modality.sms);
//send UIRequest to the UI Bus
sendUIRequest(uiRequest);
Since SMS is also one of the identified I/O channels for delivering information to the end user it is a responsibility of this expert group to address it.