Sound effects in mobile apps can reinforce functionality and make an app more fun to use. MobileTogether makes it easy and convenient for mobile developers to add a standard set of sounds to user interface actions across all mobile platforms. For instance, developers might want to add sound effects to signify the success or failure of a file transfer or database transaction. Or simply add a keyclick sound to a button as feedback for a user tap.
The MobileTogether Actions dialog includes an Audio action with access to 16 different sounds available for immediate playback:
We built a simple app with a control panel of 16 buttons to try out each sound across platforms:
When we run the app on an iOS phone, Android tablet, as a Windows app, and even in a Web browser window, the sounds are consistent across every platform.
Note the switch at the bottom of the screen that enables or disables sound effects as a user preference. If a user is in a library or the quiet car on a train, sound effects in mobile apps will not be appreciated. And there will always be some users who prefer to operate silently.
By the way, the volume of sound playback is determined by the client device volume setting when the app is executed.
The Control Actions for the buttons in our demo app were defined to play each sound. We set the visibility property for the entire table so that the buttons can only be viewed and pressed when sound is enabled. When the table isn’t visible the buttons can’t be clicked, so there was no need to set any enable/disable properties for the buttons themselves.
Add Sound to an Action Group
In most cases you will want to combine sound with other actions. For instance, the MobileTogether New Patient sample app demonstrates how to collect data in a standardized form. Once the user has entered data, the form can be printed or emailed.
In this app, we might want to add a sound effect to indicate a printer error. The app already has an action group named PrintTo that handles document printing with provisions for various types of errors. If any of four different error types are encountered, another Action Group called PrintToError is called. In the original version, the PrintToError Action Group simply displayed a message box. Here are the revised actions to add sound:
The New Patient app includes a set of control buttons along the top of each page. It would be easy to add a new button to allow users to set the sound effects on or off:
An app can even determine which sound to play by evaluating an XPath expression. In the screen shot below, the XPath expression is simply a data element called anySound that can contain a string matching the name of any of the 16 built in sounds.
If you need more than 16 sounds, you can upload your own sound files and play them back within your app. Details for handling custom sound files for each mobile client platform are covered in the integrated MobileTogether Help.
You can create your own cross-platform sound effects in mobile apps by downloading the free-to-use MobileTogether Designer, which comes with integrated help, tutorials, and many sample apps.