HPE Anywhere Developer Forum
Showing results for 
Search instead for 
Do you mean 

How to use cordova in HPA?

Occasional Advisor

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
Honored 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.
Valued 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
Occasional Advisor

Re: How to use cordova in HPA?

Thank you  Efrat!

Occasional Contributor

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)

Frequent Advisor

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