+
1 1 1
  1. #1
    Status
    Offline
      Rise Company
    Engineering and Technology
    Apr 2014
    Egypt
    4,637
    10

    function onDeviceReady index.js -


    / / function onDeviceReady index.js -
    Phone Gap / Cordova

    events native JS



    :
     document.addEventListener("deviceready", onDeviceReady, false);
    /

    :
    function onDeviceReady()
    / native





    :
    <script type="text/javascript" src="js/index.js"></script>
    <script type="text/javascript" src="cordova.js"></script>
    : cordova.js <script> .

    index.html

    index.html index.js

    :

    :
    <!DOCTYPE html>
    <html>
      <head>
        <title>Events</title>
        <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
        <script type="text/javascript" charset="utf-8">
    
        document.addEventListener("deviceready", onDeviceReady, false);
    
        function onDeviceReady() {
            document.addEventListener("pause", onPause, false);
            document.addEventListener("resume", onResume, false);
            document.addEventListener("online", onOnline, false);
            document.addEventListener("offline", onOffline, false);
            document.addEventListener("backbutton", onBackKeyDown, false);
            window.addEventListener("batterycritical", onBatteryCritical, false);
            window.addEventListener("batterylow", onBatteryLow, false);
            window.addEventListener("batterystatus", onBatteryStatus, false);
            document.addEventListener("menubutton", onMenuKeyDown, false);
            document.addEventListener("searchbutton", onSearchKeyDown, false);
            document.addEventListener("startcallbutton", onStartCallKeyDown, false);
            document.addEventListener("endcallbutton", onEndCallKeyDown, false);
            document.addEventListener("volumedownbutton", onVolumeDownKeyDown, false);
            document.addEventListener("volumeupbutton", onVolumeUpKeyDown, false);
        }
        function onPause() {
            alert("Application Pause");
        }
        function onResume() {
            alert("Application Resume");
        }
        function onOnline() {
            alert("Application Online");
        }
        function onOffline() {
            alert("Application Offline");
        }
        function onBackKeyDown() {
            alert("Application BackKeyDown");
        }
        function onBatteryCritical(info) {
            alert("Battery Level Critical " + info.level + "%\nRecharge Soon!");
        }
        function onBatteryLow(info) {
            alert("Battery Level Low " + info.level + "%");
        }
        function onBatteryStatus(info) {
            alert("Level: " + info.level + " isPlugged: " + info.isPlugged);
        }
        function onMenuKeyDown() {
            alert("Application MenuKeyDown");
        }
        function onSearchKeyDown() {
            alert("Application SearchKeyDown");
        }
        function onStartCallKeyDown() {
            alert("Application StartCallKeyDown");
        }
        function onEndCallKeyDown() {
            alert("Application EndCallKeyDown");
        }
        function onVolumeDownKeyDown() {
            alert("VolumeDownKeyDown");
        }
        function onVolumeUpKeyDown() {
            alert("VolumeUpKeyDown");
        }
        </script>
      </head>
      <body>
      </body>
    </html>
    / Functions

    ,
    .

    function onDeviceReady()
    function onPause()
    function onResume()

    function onOnline()
    function onOffline()

    function onBackKeyDown()
    function onBatteryCritical(info)
    function onBatteryLow(info)
    function onBatteryStatus(info)
    function onMenuKeyDown()
    function onSearchKeyDown()
    function onStartCallKeyDown()
    function onEndCallKeyDown()
    function onVolumeDownKeyDown()
    function onVolumeUpKeyDown()


    ------------------------------------------------------------------------
    Rise Company for Engineering & Technology
    ------------------------------------------------------------------------
    Web Hosting | Web Designing | E-Marketing

    # 1 Business Services

    Web Hosting - Business Emails

    Web Design - Google Adwords

    www.rise.company | www.rise.company/emails

    :
    ! .



  1. - cli - Phone Gap Build
    Rise Company Ionic/Cordova
    : 0
    : 25-07-2017, 15:39
  2. cordova plugin index.js -
    Rise Company Ionic/Cordova
    : 0
    : 25-07-2017, 15:06
  3. Orientation -
    Rise Company Ionic/Cordova
    : 0
    : 23-07-2017, 17:18
  4. Full Screen -
    Rise Company Ionic/Cordova
    : 0
    : 23-07-2017, 16:41
  5. Phone Gap / Cordova 60
    Rise Company Ionic/Cordova
    : 0
    : 27-06-2017, 23:00