HPE Anywhere Developer Forum
cancel

How to use cordova in HPA?

isay101
Regular Contributor.

How to use cordova in HPA?


I initially developed an app using Phonegap IDE.
I just finished transferring the HTML, CSS, and JS codes to HPA IDE.
Upon testing at the chrome simulator, the codes seem to work fine.

May I know if we can still use and how to use the cordova library in HPA such as its onDeviceReady, onCreate functions, screen.height?
I used to display splash page using cordova's setIntegerProperty too.

 

5 REPLIES
Yossi_Gutin
Outstanding Contributor.

Re: How to use cordova in HPA?

Hi,
Thank you for contacting HP Anywhere.
We are checking the issues you raised and we will do our best to answer you shortly.
Thank you for your patience

--------------------------------------------------------------------------------------
If some answer solves your problem, please mark it as a solution.
Efrat
Super Contributor.

Re: How to use cordova in HPA?

You can still use any plugin of PhoneGap

We load version 3.0.0

You can access it via window.parent

For example:

 

if (window.parent.navigator && window.parent.navigator.camera) {
            flag = true;
            options = {
                quality: 25,
                destinationType: window.parent.Camera.DestinationType.FILE_URI,
                encodingType: window.parent.Camera.EncodingType.JPEG,
                allowEdit: true,
                targetWidth: 640,
                targetHeight: 960,
                correctOrientation: (window.parent.device.platform === 'iOS') ? true : false
            };
            window.parent.navigator.camera.getPicture(success, failure, options);
        }

 

Highlighted
isay101
Regular Contributor.

Re: How to use cordova in HPA?

Thank you  Efrat!

RamanK
New Member.

Re: How to use cordova in HPA?

I am also getting error  as undefined for

window.parent.navigator.camera.PictureSourceType. It seems to be issue on loading cordova.

http://localhost:8080/WebShell/cordova-2.3.0.js 404 (Not Found)

Lenient
Respected Contributor.

Re: How to use cordova in HPA?

window.parent.Camera.PictureSourceType, guess you may need to be aware of case-sensitive of Camera.
Simple is best