X

Developer Partner Community

  • November 16, 2016

Plugging into Devices with Oracle JET on Cordova (Part 1) by Geertjan

Juergen Kress
PaaS & Middleware Partner Adoption
image

In a previous blog entry, I discussed how to create AngularJS applications that access the native resources on devices, such as the camera on Android, via Cordova. Let's now do the same thing with an Oracle JET application. Start by using Yeoman to scaffold your hybrid (i.e. Cordova-based) Oracle JET application. Now you're good to go with the instructions that follow.

Take the following steps:

  1. In the "hybrid" folder in your application, you'll find a file named "config.xml", which is the central configuration file for all your Cordova-related work. Underneath the Cordova Whitelist plugin, add the Cordova Camera plugin, as shown below:
2.       <content src="index.html" />
3.       <plugin name="cordova-plugin-whitelist" spec="1" />
4.       <plugin name="cordova-plugin-camera" spec="1" />
<access origin="*" />

Then build the application, as shown in the earlier YouTube clip on this topic, i.e., "grunt build --platform android" and you'll find the "cordova-plugin-camera" folder has been added for you:

  1. Open the "incidents.html" file, which is in "src/js/views", and add a button that has its "click" event bound to a function named "takePicture":
6.       <button data-bind="click: takePicture">Take Picture!</button>
  1. Open the "incidents.js" file, which is in "src/js/viewModels", and add the function that you referenced in your HTML file, making use of the Cordova Camera API: Read the complete article here.

WebLogic Partner Community

For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.

Blog Twitter LinkedIn Forum Wiki

:

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.