Access bluetooth devices.
Access native overlays.
Navigate between pages.
Access features from popular social networks.
Control audio within the app.
Capture a photo from the camera, and call back the specified function with the resulting filename, or blank if cancelled
var uActions = require('u-actions');
new uActions.Action('take a photo', takeAPhoto).register();
function takeAPhoto() {
uActions.cameraCapture('captureResult');
}
function captureResult(filePath) {
if (filePath=='') {
uActions.showPopup('Photo Cancelled!');
} else {
uActions.showPopup('Photo taken: ' + filePath);
}
}
Make a phone call using the default dialer app.
var uActions = require('u-actions');
new uActions.Action('dial number', dialNumber).register();
function dialNumber() {
uActions.dialNumber('063564120');
}
Show a location on the map using the default map app.
var uActions = require('u-actions');
new uActions.Action('open google map', openGoogleMap).register();
function openGoogleMap() {
uActions.openMap('60 Princess Street, Palmerston North Central, Palmerston North');
}
Address of the location to show.
Send an email
var uActions = require('u-actions');
new uActions.Action('send email to Umajin', sendEmailToUmajin).register();
function sendEmailToUmajin() {
uActions.sendEmail('admin@umajin.com');
}
Send an SMS message using the default SMS app.
var uActions = require('u-actions');
new uActions.Action('send message', sendMessage).register();
function sendMessage() {
uActions.sendSMS('063564120');
}
Show a combo box.
var uActions = require('u-actions');
var Action = uActions.Action;
var stringArray=['red','blue','green'];
new Action('Show combo',showCombo).register();
function showCombo(){
uActions.showCombo('callback_function', stringArray);
}
function callback_function(index, value) {
print('index: '+ index+ ' value: '+value);
}
The name of the callback function.
An Array of item names as Strings.
Display a popup with a message.
var uActions = require('u-actions');
new uActions.Action('Say hello', sayHello).register();
function sayHello() {
uActions.showPopup('Hello!');
}
The message to display in the popup.
Show a web page using the default web browser app.
var uActions = require('u-actions');
new uActions.Action('Show front page', showFrontPage).register();
function showFrontPage() {
uActions.showWebPage('https://umajin.com/');
}
The url to show.
Actions are a fundamental building block of a Umajin App.
The
u-actions
module lets you create your own actions that can be used like regular actions in Umajin Editor. The module also gives you access to all the built-in actions.