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:
- 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:
- 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>
- 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.
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
: