Learn the powerful enterprise adaptable database:

Getting Started With ADABAS & Natural

Friday, May 12, 2017

209 Build.PhoneGap.com with Cordova File


.
209 Build.PhoneGap.com with Cordova File

1) Check Version

As at 2017-11-14
PhoneGap Version:
PhoneGap (iOS / Android / Windows)
cli-6.5.0 (4.3.1 / 6.1.2 / 4.4.3)
Plugin Version:
<plugin name="cordova-plugin-file" spec="4.3.3" />

2) Startup Files

config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.notarazi.bpg" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <name>BPG </name>
  <description>
      Build Phone Gap Example
  </description>
  <author email="notarazi@gmail.com" href="http://fb.me/notarazi.blogs">
      Notarazi Team
  </author>
  <content src="index.html" />
  <access origin="*" />
  <allow-intent href="http://*/*" />
  <allow-intent href="https://*/*" />
  <allow-intent href="tel:*" />
  <allow-intent href="sms:*" />
  <allow-intent href="mailto:*" />
  <allow-intent href="geo:*" />
  <platform name="android">
      <allow-intent href="market:*" />
  </platform>
  <platform name="ios">
      <allow-intent href="itms:*" />
      <allow-intent href="itms-apps:*" />
  </platform>
  <engine name="android" spec="^6.2.3" />
  <engine name="ios" spec="^4.4.0" />
<plugin name="cordova-plugin-file" spec="4.3.3" />
</widget>
index.html
<!DOCTYPE html>
<html>
 <head>
   <title>BPG Example</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() {
    console.log(
cordova.file);
     document.getElementById('appmessage').innerHTML=
            JSON.stringify(cordova.file);
   }
   </script>
 </head>
 <body>
  <div id='appmessage'style=' width:200px;word-wrap: break-word;'>
   ...
   </div>
 </body>
</html>

3) Zip, Upload and Build the project

4) Test Output

Console Output
Screen Output

Download

Reference


.

208 Build.PhoneGap.com with Cordova Dialogs


.
208 Build.PhoneGap.com with Cordova Dialogs

1) Check Version

As at 2017-11-14
PhoneGap Version:
PhoneGap (iOS / Android / Windows)
cli-6.5.0 (4.3.1 / 6.1.2 / 4.4.3)
Plugin Version:
<plugin name="cordova-plugin-dialogs" spec="1.3.4" />

2) Startup Files

config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.notarazi.bpg" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <name>BPG </name>
  <description>
      Build Phone Gap Example
  </description>
  <author email="notarazi@gmail.com" href="http://fb.me/notarazi.blogs">
      Notarazi Team
  </author>
  <content src="index.html" />
  <access origin="*" />
  <allow-intent href="http://*/*" />
  <allow-intent href="https://*/*" />
  <allow-intent href="tel:*" />
  <allow-intent href="sms:*" />
  <allow-intent href="mailto:*" />
  <allow-intent href="geo:*" />
  <platform name="android">
      <allow-intent href="market:*" />
  </platform>
  <platform name="ios">
      <allow-intent href="itms:*" />
      <allow-intent href="itms-apps:*" />
  </platform>
  <engine name="android" spec="^6.2.3" />
  <engine name="ios" spec="^4.4.0" />
<plugin name="cordova-plugin-dialogs" spec="1.3.4" />
</widget>
index.html
<!DOCTYPE html>
<html>
 <head>
   <title>BPG Example</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() {
    console.log(navigator.notification);
     document.getElementById('appmessage').innerHTML= JSON.stringify(navigator.notification);

   }
   </script>
 </head>
 <body>
  <div id='appmessage'style=' width:200px;word-wrap: break-word;'>
   ...
   </div>
 </body>
</html>

3) Zip, Upload and Build the project

4) Test Output

Console Output

Download

Reference


.

207 Build.PhoneGap.com with Cordova Device Orientation


.
207 Build.PhoneGap.com with Cordova Device Orientation

1) Check Version

As at 2017-11-14
PhoneGap Version:
PhoneGap (iOS / Android / Windows)
cli-6.5.0 (4.3.1 / 6.1.2 / 4.4.3)
Plugin Version:
<plugin name="cordova-plugin-device-orientation" spec="2.0.0" />

2) Startup Files

config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.notarazi.bpg" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <name>BPG </name>
  <description>
      Build Phone Gap Example
  </description>
  <author email="notarazi@gmail.com" href="http://fb.me/notarazi.blogs">
      Notarazi Team
  </author>
  <content src="index.html" />
  <access origin="*" />
  <allow-intent href="http://*/*" />
  <allow-intent href="https://*/*" />
  <allow-intent href="tel:*" />
  <allow-intent href="sms:*" />
  <allow-intent href="mailto:*" />
  <allow-intent href="geo:*" />
  <platform name="android">
      <allow-intent href="market:*" />
  </platform>
  <platform name="ios">
      <allow-intent href="itms:*" />
      <allow-intent href="itms-apps:*" />
  </platform>
  <engine name="android" spec="^6.2.3" />
  <engine name="ios" spec="^4.4.0" />
<plugin name="cordova-plugin-device-orientation" spec="2.0.0" />
</widget>
index.html
<!DOCTYPE html>
<html>
 <head>
   <title>BPG Example</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() {
    console.log(navigator.compass);
     document.getElementById('appmessage').innerHTML= JSON.stringify(
navigator.compass);

   }
   </script>
 </head>
 <body>
  <div id='appmessage'style=' width:200px;word-wrap: break-word;'>
   ...
   </div>
 </body>
</html>

3) Zip, Upload and Build the project

4) Test Output

Console Output

Download

Reference


.

206 Build.PhoneGap.com with Cordova Device Motion


.
206 Build.PhoneGap.com with Cordova Device Motion

1) Check Version

As at 2017-11-14
PhoneGap Version:
PhoneGap (iOS / Android / Windows)
cli-6.5.0 (4.3.1 / 6.1.2 / 4.4.3)
Plugin Version:
<plugin name="cordova-plugin-device-motion" spec="2.0.0" />

2) Startup Files

config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.notarazi.bpg" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <name>BPG </name>
  <description>
      Build Phone Gap Example
  </description>
  <author email="notarazi@gmail.com" href="http://fb.me/notarazi.blogs">
      Notarazi Team
  </author>
  <content src="index.html" />
  <access origin="*" />
  <allow-intent href="http://*/*" />
  <allow-intent href="https://*/*" />
  <allow-intent href="tel:*" />
  <allow-intent href="sms:*" />
  <allow-intent href="mailto:*" />
  <allow-intent href="geo:*" />
  <platform name="android">
      <allow-intent href="market:*" />
  </platform>
  <platform name="ios">
      <allow-intent href="itms:*" />
      <allow-intent href="itms-apps:*" />
  </platform>
  <engine name="android" spec="^6.2.3" />
  <engine name="ios" spec="^4.4.0" />
<plugin name="cordova-plugin-device-motion" spec="2.0.0" />
</widget>
index.html
<!DOCTYPE html>
<html>
 <head>
   <title>BPG Example</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() {
     console.log(navigator.accelerometer);
      document.getElementById('appmessage').innerHTML=
JSON.stringify(navigator.accelerometer);

   }
   </script>
 </head>
 <body>
  <div id='appmessage'style=' width:200px;word-wrap: break-word;'>
   ...
   </div>
 </body>
</html>

3) Zip, Upload and Build the project

4) Test Output

Console Output
Screen Output
{}

Download

Reference


.

205 Build.PhoneGap.com with Cordova Device


.
205 Build.PhoneGap.com with Cordova Device

1) Check Version

As at 2017-11-14
PhoneGap Version:
PhoneGap (iOS / Android / Windows)
cli-6.5.0 (4.3.1 / 6.1.2 / 4.4.3)
Plugin Version:
<plugin name="cordova-plugin-device" spec="1.1.7" />

2) Startup Files

config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.notarazi.bpg" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <name>BPG </name>
  <description>
      Build Phone Gap Example
  </description>
  <author email="notarazi@gmail.com" href="http://fb.me/notarazi.blogs">
      Notarazi Team
  </author>
  <content src="index.html" />
  <access origin="*" />
  <allow-intent href="http://*/*" />
  <allow-intent href="https://*/*" />
  <allow-intent href="tel:*" />
  <allow-intent href="sms:*" />
  <allow-intent href="mailto:*" />
  <allow-intent href="geo:*" />
  <platform name="android">
      <allow-intent href="market:*" />
  </platform>
  <platform name="ios">
      <allow-intent href="itms:*" />
      <allow-intent href="itms-apps:*" />
  </platform>
  <engine name="android" spec="^6.2.3" />
  <engine name="ios" spec="^4.4.0" />
<plugin name="cordova-plugin-device" spec="1.1.7" />
</widget>
index.html
<!DOCTYPE html>
<html>
 <head>
   <title>BPG Example</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() {
     console.log(device);
      document.getElementById('appmessage').innerHTML=JSON.stringify(device);
   }
   </script>
 </head>
 <body>
  <div id='appmessage'style=' width:200px;word-wrap: break-word;'>
   ...
   </div>
 </body>
</html>

3) Zip, Upload and Build the project

4) Test Output

Console Output
Screen Output

Download

Reference



.

204 Build.PhoneGap.com with Cordova Contacts


.
204 Build.PhoneGap.com with Cordova Contacts

1) Check Versions

As at 2017-11-14
PhoneGap Version:
PhoneGap (iOS / Android / Windows)
cli-6.5.0 (4.3.1 / 6.1.2 / 4.4.3)
Plugin Version:
<plugin name="cordova-plugin-contacts" spec="2.3.1" />

2) Test Files

config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.notarazi.bpg" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <name>BPG </name>
  <description>
      Build Phone Gap Example
  </description>
  <author email="notarazi@gmail.com" href="http://fb.me/notarazi.blogs">
      Notarazi Team
  </author>
  <content src="index.html" />
  <access origin="*" />
  <allow-intent href="http://*/*" />
  <allow-intent href="https://*/*" />
  <allow-intent href="tel:*" />
  <allow-intent href="sms:*" />
  <allow-intent href="mailto:*" />
  <allow-intent href="geo:*" />
  <platform name="android">
      <allow-intent href="market:*" />
  </platform>
  <platform name="ios">
      <allow-intent href="itms:*" />
      <allow-intent href="itms-apps:*" />
  </platform>
  <engine name="android" spec="^6.2.3" />
  <engine name="ios" spec="^4.4.0" />
   <plugin name="cordova-plugin-contacts" spec="2.3.1"  />
</widget>
index.html
<!DOCTYPE html>
<html>
 <head>
   <title>BPG Example</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() {
      console.log(navigator.contacts);
      document.getElementById('appmessage').innerHTML=
        JSON.stringify(navigator.contacts);
    }

   </script>
 </head>
 <body>
   <div id='appmessage'>...</div>
 </body>
</html>

3) Zip, Upload and Build the project

4) Test Output

Console Output
Screen Output

Download

Reference



.