Re: How to use cordova in HPA? (389 Views)
Reply
Occasional Advisor
isay101
Posts: 8
Registered: ‎10-28-2013
Message 1 of 6 (459 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.

 

Honored Contributor
Yossi_Gutin
Posts: 209
Registered: ‎04-04-2013
Message 2 of 6 (432 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.
Valued Contributor
Efrat
Posts: 60
Registered: ‎04-08-2013
Message 3 of 6 (389 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);
        }

 

Occasional Advisor
isay101
Posts: 8
Registered: ‎10-28-2013
Message 4 of 6 (377 Views)

Re: How to use cordova in HPA?

Thank you  Efrat!

Occasional Contributor
RamanK
Posts: 3
Registered: ‎11-22-2013
Message 5 of 6 (315 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)

Frequent Advisor
Lenient
Posts: 45
Registered: ‎03-18-2013
Message 6 of 6 (308 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
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.