How to open Barcode scanner from web page

Hi everybody,

Greeting for the day,

Actually i am newbie for POYNT, my concerns is only that how i can communicate with existing POYNT application with my web page which will be opened into POYNT device itself.
Suppose, i have one button to open scanner, after clicking on it, how i can open Barcode scanner of POYNT and get responses.

Thanks
Mehtab

Hi Mehtab,

I’m not exactly clear what your question is. When you say existing Poynt application, are you referring to Poynt Register? As for initiating the code scanner in the PoyntOS SDK, check out the sample code here – and after the scan is done, the responses can be found in the event onCodeScanned – shown here.

Thanks,
Neil

Thanks for your prompt reply Neil,

Actually we are creating Web application,and our requirement is that if i want to open any existing functionality of POYN.
And our application which will be running into POYNT browser.
Then how we can communicate with POYNT applications.

Thanks
Mehtab

Just to clarify – your app will be a web application, that you’ll be running an Android WebView, correct? And if so, I think you’re asking how your app would communicate with the PoyntOS services or hardware components, correct? It’s actually not so difficult – however, you’ll still need to create an Android application that will generate the WebView, and in that application, you’ll create functions that map to the Android & PoyntOS SDK methods… like this:

import android.widget.Toast;


@JavascriptInterface public void showToast(String toast) { Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show(); }

And in your HTML/JS that’s loaded in the WebView, you can execute that Android toast method with something like this:

<script>Android.showToast("Hello World");</script>

Even though WebViews seem very handy to re-use what you’ve already built, Poynt strongly advocates that you implement best practices (and tools) for delivering a fast, near-native experience. Also, additional security measure are required to ensure that merchants/users are only accessing resources that you intend them on accessing – and not browsing arbitrary web sites.

Thanks,
Neil