Cordova: Event Events

Source: Internet
Author: User



Deviceready:


When Cordova is fully loaded, you can call the Cordova API interface support platform: Amazon, Fire OS, Android, BlackBerry 10, IOS, Tizen, Windows Phone 8, Windows 8 Pause:The app switches to events that are monitored during the background runtime, such as opening other apps. Supported platforms: Amazon fire OS, Android, BlackBerry 10, IOS, Windows Phone 8, Windows 8 Resume:The app re-acquires the listening event support platform from the background: Amazon fire OS, Android, BlackBerry 10, IOS, Windows Phone 8, Windows 8ios when the app switches to the foreground, The function executed by the resume event is wrapped in settimeout (fn,0), otherwise the app will be suspended. Backbutton:Event support platform for listening when you press the phone back button: Amazon fire OS, Android, BlackBerry 10, Windows phone 8 Menubutton:Event support platform that listens when you press the menu button on your phone: Amazon fire OS, Android, BlackBerry 10 SearchButton:Event support platform for listening when you press the search button on your phone: Android Startcallbutton:Event support platform for listening when dialing button is pressed: BlackBerry 10 Endcallbutton:Event support platform for listening when you press the end call key: BlackBerry 10 Volumedownbutton:Monitor volume down event support platform: BlackBerry 10, Android Volumeupbutton:Monitoring volume plus key event support platform: BlackBerry 10, Android code example: [HTML]View PlainCopy


  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"  
  2.                       "http://www.w3.org/TR/html4/strict.dtd">  
  3. <html>  
  4.   <head>  
  5.     <title>Volume Up Button Example</title>  
  6.   
  7.     <script type="text/javascript" charset="utf-8" src="cordova.js"></script>  
  8.     <script type="text/javascript" charset="utf-8">  
  9.   
  10.     // Wait for device API libraries to load  
  11.     //  
  12.     function onLoad() {  
  13.         document.addEventListener("deviceready", onDeviceReady, false);  
  14.     }  
  15.   
  16.     // device APIs are available  
  17.     //  
  18.     function onDeviceReady() {  
  19.         // Register the event listener  
  20.         document.addEventListener("volumeupbutton", onVolumeUpKeyDown, false);  
  21.     }  
  22.   
  23.     // Handle the volume up button  
  24.     //  
  25.     function onVolumeUpKeyDown() {  
  26.     }  
  27.   
  28.     </script>  
  29.   </head>  
  30.   <body onload="onLoad()">  
  31.   </body>  
  32. </html>  


Cordova: Event Events


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.