Saturday, 9 May 2015



(1)install plugins using CLI:

cordova plugin add org.apache.cordova.dialogs

(2)install plugins using CLI:

cordova plugin add org.apache.cordova.vibration

(3) CODE example:

<!DOCTYPE html>
    <title>Notification Example</title>

    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8">

    // Wait for device API libraries to load
    document.addEventListener("deviceready", onDeviceReady, false);

    // device APIs are available
    function onDeviceReady() {
        // Empty

    // alert dialog dismissed
        function alertDismissed() {
            // do something

    // Show a custom alertDismissed
    function showAlert() {
            'You are the winner!',  // message
            alertDismissed,         // callback
            'Game Over',            // title
            'Done'                  // buttonName

    <p><a href="#" onclick="showAlert(); return false;">Show Alert</a></p>

No comments:

Post a Comment