Using Camera in Android

Still plugging away at this, and slowly getting somewhere:

I found in this document https://wiki.nsbasic.com/Using_the_PhoneGap_API#Camera that I needed to add the following line to the config.xml in the phonegap properties…

<gap:plugin name="cordova-plugin-camera" source="npm" >
  <variable name="CAMERA_USAGE_DESCRIPTION" value="{id} camera use" />
  <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="{id}  photo use" />
</gap:plugin>

<gap:plugin name="cordova-plugin-geolocation" source="npm"  >
  <variable name="GEOLOCATION_USAGE_DESCRIPTION" value="{id} Location use." />
 </gap:plugin>

Which I’ve now done. When installing the app, I am now told the app wants to access the camera etc. SUCCESS

Now I’m at another problem, I’ve added a button (Button1) which will call the TakePhoto() Function whcih is copied from the same link above…

Function Button1_onclick()
     TakePhoto()
End Function

Function TakePhoto()
  options={quality : 75, _
    destinationType : 1, _
    sourceType : 1, _
    allowEdit: True}
  navigator.camera.getPicture(onPictureReturned, onPictureError, options)
End Function

Function onPictureReturned(ImageURI)
  Image1.firstChild.src=ImageURI
End Function

Function onPictureError(message)
  MsgBox "Failed because " & message
End Function

This is of course similar to what @mexlum sugggested above.

This throws up an error - Cannot read property ‘getpicture’ of undefined in line 61 coloumn 20

Any ideas?

I’ll keep plugging away and post if I find out what I’m now doing wrong.