Barcode scanner for PhoneGap/cordova - javascript

I am building one android application using cordova/phonegap and Javascript. I am using scandit barcode scanner for scanning functionality. Scandit barcode scanner occupies entire screen while scaaning. But I need scanning only in perticular area/div in my application. How can I solve that issue? Is there any other scanner which can solve this issue?

If you are just calling BarcodeScanner via an intent you have no control. However if you are embedding the Java code from the BarcodeScanner app in your app you have all the java code and xml resources available and can edit them how you like. It will all be Java and native Android resource stuff though.. not html.
If you are embedding the layout is
http://code.google.com/p/zxing/source/browse/trunk/android/res/layout/capture.xml
and the activity that does the scanning you want to edit is
http://code.google.com/p/zxing/source/browse/trunk/android/src/com/google/zxing/client/android/CaptureActivity.java
If you add a button in the layout and call finish in the OnClickListener you set up in the activity it would be a back as you desire..

Related

Use native document picture scanner from the web

I am building a web application that needs to have document scanner functionalities. I made some research to do that fully with web technologies but it seems that it's a bit too complicated for what I need. Is it possible from within a web app to open ios Notes document scanner or Drive document scanner and receive the data the same way that it's possible to use the native camera?
Basically I need to open camera with document scanning mode, that way the document recognition and framing will be done with the native functionality and only my web app to save it.

Open mobile app (if installed) using javascript (without intent)

From web browser, I want the ability to open any app if installed (such as facebook, twitter etc) using java-script. I can't update intent file, want to do it solely from java-script. Is there a way from java-script to detect the installed apps (from IOS & Android) and open it?
You can use Firebase Dynamic Links https://firebase.google.com/docs/dynamic-links
It was designed to resolve the issues like yours.

JavaScript or HTML launching a new browser from hybrid app

So, I'm working on an app which is a web based app. The apps code base is mostly written in JavaScript and HTML. The app is also available on a native app which basically only contains a WebView displaying the HTML and JavaScript code.
My problem is that when a user is on the Android native version and launching an external link, it opens perfectly in the Android WebView but there is some cases where the launched page not is scrollable and other strange stuff.
So to solve this issue I need the native app to launch the in-build browser in the Android phone. Basically, the exact same effect that startActivity(new Intent(ACTION.VIEW,URI)) has.
The thing is that I can't modify the Android version though all the logic is written within the web app..
My question is:
Is there any way to simulate:
startActivity(new Intent(ACTION.VIEW,URI))
in JavaScript to get out of the native app and launch the browser instead?

Sending input/parameters from iPhone to Computer?

I have an iPhone app built with PhoneGap (driven by AngularJS) that scans and processes barcodes just the way I want it to. I also have a webapp (also powered by AngularJS) that needs to accept barcode input and do similar processing. Since using a webcam to scan a barcode is not very elegant and I don't want to buy a barcode scanner for the computer running the webapp, I am trying to use the iPhone to scan a barcode (which already works) and send that data to my web application. Can anybody
I have thought about tethering the iphone to the computer with bluetooth, but have no idea how to send/receive bluetooth data through JavaScript. Should it be over wifi and use the AngularJS $http service?
You could use WebSockets and a library like Pusher:
http://pusher.com/docs/javascript_quick_start
It allows events to fire based on execution on another page. So on your scan success callback you can trigger an event which can send information to another web page simultaneously.

How to interact with an android code using webpages?

Here is what I am doing:
I'm building a webpage which I'm going to use in [an] android [app] for [the main] UI.
I want [to] interact with the android code while working the webpage. What I need is when I click a button on the webpage on an android phone a piece of android code should get executed. Normally we use direct buttons from android but in this app I need it that way.
Please drop in any suggestions.
Thank you
You need to read the documentation: Building Web Apps in WebView

Categories