Monday, March 26, 2018

202 Build PhoneGap com with Cordova Camera

202 Build PhoneGap com with Cordova Camera



.
202 Build.PhoneGap.com with Cordova Camera

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-camera"  spec="2.4.1"/>

2) Test Files

config.xml
<?xml version=1.0 encoding=utf-8?>
<widget id="com.notarazi.bpg" version="1.0.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-camera"  spec="2.4.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.camera);
     document.getElementById(appmessage).innerHTML=
        JSON.stringify(
navigator.camera);
   }
   </script>
 </head>
 <body>
   <div id=appmessage>...</div>
 </body>
</html>

3) Zip, Upload and Build the project

(Refer http://programming-steps.blogspot.my/2017/05/build-app-with-buildphonegapcom.html )

4) Test Output

Console Output
Screen Output

Download

202-bpg-cordova-camera.zip

Reference


http://cordova.apache.org/docs/en/latest/reference/cordova-plugin-camera/index.html

.

visit link download

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.