Android-SmartWebView icon indicating copy to clipboard operation
Android-SmartWebView copied to clipboard

QRCode camera

Open williamont opened this issue 4 years ago • 9 comments

hello, sorry for my english. I'm having trouble implementing a qrcode reader, I tried instscan (https://github.com/schmich/instascan) and Zxing (https://github.com/yushulx/zxing-cpp-emscripten), both use js .

In conventional browsers (firefox, chrome) work normally and I have not found the reason for giving an error in SmartView.

The screen runs out of content, as if it were not allowed to charge the camera.

My SmartWebView

`/* -- PERMISSION VARIABLES -- */ static boolean ASWP_JSCRIPT = true; // enable JavaScript for webview static boolean ASWP_FUPLOAD = true; // upload file from webview static boolean ASWP_CAMUPLOAD = true; // enable upload from camera for photos static boolean ASWP_ONLYCAM = false; // incase you want only camera files to upload static boolean ASWP_MULFILE = true; // upload multiple files in webview static boolean ASWP_LOCATION = true; // track GPS locations static boolean ASWP_CP = true; // enable copy/paste within webview

static boolean ASWP_RATINGS       = false;         // show ratings dialog; auto configured ; edit method get_rating() for customizations

static boolean ASWP_PULLFRESH     = true;         // pull refresh current url
static boolean ASWP_PBAR          = true;         // show progress bar in app
static boolean ASWP_ZOOM          = false;        // zoom control for webpages view
static boolean ASWP_SFORM         = true;        // save form cache and auto-fill information
static boolean ASWP_OFFLINE       = false;        // whether the loading webpages are offline or online
static boolean ASWP_EXTURL        = true;         // open external url with default browser instead of app webview

static boolean ASWP_TAB           = true;         // instead of default browser, open external URLs in chrome tab
static boolean ASWP_ADMOB         = true;         // to load admob or not

static boolean ASWP_EXITDIAL	  = true;		  // confirm to exit app on back press

/* -- SECURITY VARIABLES -- */
static boolean ASWP_CERT_VERI     = false;         // verify whether HTTPS port needs certificate verification`

williamont avatar Apr 05 '20 20:04 williamont

photo_2020-04-05_17-06-44 photo_2020-04-05_17-06-58

williamont avatar Apr 05 '20 20:04 williamont

i have same problem, this is about requested permission, how to allow html5 qr scanner in webview?

jakfarza avatar Apr 07 '20 15:04 jakfarza

add this inside webchromeclient, it works!

@Override public void onPermissionRequest(android.webkit.PermissionRequest request) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { request.grant(request.getResources()); } }

jakfarza avatar Apr 07 '20 16:04 jakfarza

oh gods, only work on emulator, not work on real device

jakfarza avatar Apr 07 '20 18:04 jakfarza

I'm sorry @jakfarza but you made me chuckle, thanks for that and the suggestion. I've been real lazy, but hope to test your solution out on real devices.

Be safe and take care you both.

mgks avatar Apr 09 '20 07:04 mgks

Ok sir.please give me solution... why not work in real device...😀

jakfarza avatar Apr 09 '20 07:04 jakfarza

I couldn't even in the emulator :(

williamont avatar Apr 15 '20 20:04 williamont

@jakfarza managed to implement?

williamont avatar Apr 22 '20 00:04 williamont

Has anyone managed to implement QRCODE reader?

williamont avatar Jan 11 '21 11:01 williamont