saurjk
saurjk

Reputation: 993

phonegap android app cannot open camera

I am new to phonegap and am starting with phonegap 1.0.0 as the iOS app is already being made using that version. I am using the same code as the iOS app and am stuck on a problem.

Whenever I call the navigator.camera.getPicture method i get the error below

While testing on Samsung Captivate and HTC Wildfire

Uncaught TypeError: Cannot call method 'getPicture' of undefined at file:///android_asset/www/js/profile_pic_settings_page.js:95

What seems to be the problem ? I searched everywhere and could not find it. Help.

Upvotes: 0

Views: 2285

Answers (1)

Simon MacDonald
Simon MacDonald

Reputation: 23273

A couple of questions:

  1. Are you waiting for the "deviceready" event before calling navigator.camera.getPicture()?
  2. Does the html page that loads "profile_pic_settings_page.js" also load phonegap-1.0.0.js?
  3. Are you making sure you are using the Android version of phonegap-1.0.0.js?

Upvotes: 2

Related Questions