O'Reilly logo

iPhone JavaScript Cookbook by Arturo Fernandez Montoro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making a beep alert

The first recipe for this chapter is focused on how to play a simple beep sound as a response to an event or an action. Specifically, we'll play a sound when the user clicks on a simple button.

Usually, the beep sound is used for alerting the user. For example, you may want to launch an acoustic signal to indicate that pushing the button is an invalid action.

Instead of beeping, we can use another kind of notification such as an alert box as you've learned in Chapter 2 ,Building Interfaces.

Getting ready

This recipe requires the use of two different frameworks, UiUIKit and PhoneGap. UiUIKit will be used for building a consistent interface. PhoneGap will allow us to interact with the native hardware and play the beep sound.

Remember, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required