Android Question WebChromeClient & HTML5 camera

carloz

Member
Licensed User
Longtime User
Hello again !!

i am using the html5 camera input in a html page, requirement was to enable user to take picture and upload. Loaded it in a xcode uiwebview and it works perfectly. Taking this approach so i do not have to resubmit the apps to the stores again.

B4X:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <!-- Change this if you want to allow scaling -->
    <meta name="viewport" content="width=default-width; user-scalable=no" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title>PGCamera</title>
</head>
<body>    
  <img style="width:60px;height:60px" id="test_img" src="" />
  <!-- for testing, add the buttons below -->
<form action="endpoint.php" method="post" enctype="multipart/form-data">

  <input type="file" name="qqfile" accept="image/*" capture>

  <input type="submit" value="Upload">

</form>


  </body>
</html>

Did the same in b4a webview.. added webviewxtras.. added webchromeclient to webview..
webview loads the page , allows to select image from gallery and all other locations, but refuses to show/launch camera.
Needless to say it works perfectly well on my device browser too.

Added camera permissions to manifest too.

What am i missing here?

regards
carloz
 

carloz

Member
Licensed User
Longtime User
Erel,

If i use the camera library on b4a then ill have to do something similar for the xcode IOS version of the app.. correct? I do not want to resubmit the app for this change, thats why am trying this.

regards
carloz
 
Upvote 0

carloz

Member
Licensed User
Longtime User
both android and ios apps only have a webview .. the rest of the entire content is loaded from php & jquery mobile. thus i need to keep common functionality across..
 
Upvote 0

jazzzzzzz

Active Member
Licensed User
Longtime User
Why cant you use cordova like environment to do these type of hybrid projects? (If you are using fullscreen webview for your app)
 
Upvote 0
Top