Lj Pearson
Lj Pearson

Reputation: 115

Will using web view be able to use camera and other cordova functions?

I'm trying to develop a mobile app, and was wondering if its easier to using webview and develop the app on a webserver. but I need to use camera and other cordova functions from phonegap, will this work?

what is the fallback on this?

Upvotes: 0

Views: 301

Answers (1)

Rajesh
Rajesh

Reputation: 15774

PhoneGap uses Javascript interfaces to invoke native methods. Thus the web content bundled with the app can invoke these Javascript functions to access the hardware features. Same origin policy prevents invoking Javascript functions from a different origin (such as a hosted web page). Thus it is not possible to access the hardware features from a hosted web page.

What is usually done is that the static HTML content is bundled with the app and dynamic content is fetched through AJAX calls. You can create web services from the server side and consume these in your PhoneGap app.

Upvotes: 1

Related Questions