Re: How to use cordova in HPA? (184 Views)
Reply
Occasional Advisor
isay101
Posts: 8
Registered: ‎10-28-2013
Message 1 of 6 (257 Views)

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.

 

Please use plain text.
Honored Contributor
Yossi_Gutin
Posts: 209
Registered: ‎04-04-2013
Message 2 of 6 (239 Views)

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.
Please use plain text.
Valued Contributor
Efrat
Posts: 60
Registered: ‎04-08-2013
Message 3 of 6 (196 Views)

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);
        }

 

Please use plain text.
Occasional Advisor
isay101
Posts: 8
Registered: ‎10-28-2013
Message 4 of 6 (184 Views)

Re: How to use cordova in HPA?

Thank you  Efrat!

Please use plain text.
Occasional Contributor
RamanK
Posts: 3
Registered: ‎11-22-2013
Message 5 of 6 (122 Views)

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)

Please use plain text.
Frequent Advisor
Lenient
Posts: 41
Registered: ‎03-18-2013
Message 6 of 6 (115 Views)

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
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation