How can I read data from CT10 bluetooth barcode scanner in Phonegap?

Beas Consultancy and Services

I have a requirement that, there is a Barcode scanner. I have to implement that, the data read by barcode scanner have to display my phonegap application. I use the Bluetoothserial plugin in my project. But when I want to read or readUntil what the barcode scanner scan then the readUntil method shows no buffer. I used the function like

private String readUntil(String c) {
    LOG.d(TAG, "parameter = " + c);
    String data = "";
    int index = buffer.indexOf(c, 0);
    LOG.d(TAG, "index position = " + String.valueOf(buffer));
    if (index > -1) {
        data = buffer.substring(0, index + c.length());
        buffer.delete(0, index + c.length());
    }
    LOG.d(TAG, "action = " + data);
    return data;
}

Thanks in advance. Please help with code or any tutorial where may I get some help in code.

Banshidhari

This is possible with a short trick. You don't need to require make connection from your app. You just connect your bluetooth device from your phone manually. Then take a text box in you application and make this text box with height to one and place it at the top left corner with z index negative value such that no end use can see this text box. Now write a recursive program which always make focus on the text box. Since if the scanner connect with your phone then if the barcode scanner reads anything then it will print in your text box and recursive or timeout function works if any thing write on the text box. I give you setTimeout function code given below:

function focusOnScanner()
{
    if($("#scannerTxt").length == 1)
    {
        document.getElementById('scannerTxt').focus();
        var scannedData = $("#scannerTxt").val();
        if(scannedData.length > 0)
        {
            $("#scannerTxt").val('');
            //Here do your work
        }
     }
     setTimeout(focusOnScanner, 5000);
}
setTimeout(focusOnScanner, 5000);

I think this will help you to solve your problem without taking any plugin or making any connection.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How can I read a crash file from /var/crash

분류에서Dev

How can I fix the "Cannot find module 'bplist-parser'" error with PhoneGap?

분류에서Dev

How to make center of barcode scanner transparent?

분류에서Dev

Python: How can I read csv and clean my data in a loop

분류에서Dev

How can I read from a CSV file into 2 ArrayLists depending on the data type I have got in the File?

분류에서Dev

how can i delete an entry from Dictionary data structure in Typescript based on the key?

분류에서Dev

How can I read a crash file from /var/crash

분류에서Dev

Can I read in binary data with istream in c++?

분류에서Dev

to implement code which can receive continuous data from bluetooth health device and I'm getting runtime error on eclipse.

분류에서Dev

How can I read the body of a messages in a Gmail account from Perl?

분류에서Dev

How can I add extra column in datagridview when I fetch data from database

분류에서Dev

How can I read a CLongBinary field from my database and write it into a CFile object?

분류에서Dev

I can't access native iOS from javascript in phonegap 2.7.0 using CDVPlugin?

분류에서Dev

how can I read from an uploaded text file

분류에서Dev

How to read a Data Matrix barcode

분류에서Dev

how to use textChanged event when from barcode reader

분류에서Dev

How to Read Specific data from to InputStream object?

분류에서Dev

How can I read a text file from the terminal and save the output to another file in java?

분류에서Dev

How can I read a CSV from Webserver using c# with LINQ? (ClickOnce deployment)

분류에서Dev

AngularJS - How can I get data from GET method

분류에서Dev

How can I sync my data from an external database in Rails?

분류에서Dev

How can I open another app made for me from webintent in phonegap?

분류에서Dev

How can I retrieve original data from a signature with GnuPG?

분류에서Dev

How to read Data from WebSite into R

분류에서Dev

How can I get bluetooth to work on Windows Server 2012?

분류에서Dev

How can I read and extract information from a DDS-1 tape today?

분류에서Dev

What Psensor data can you read from an intel gpu?

분류에서Dev

Barcode scanner work in browser

분류에서Dev

How can I format a linux liveusb so that grub can read it?

Related 관련 기사

  1. 1

    How can I read a crash file from /var/crash

  2. 2

    How can I fix the "Cannot find module 'bplist-parser'" error with PhoneGap?

  3. 3

    How to make center of barcode scanner transparent?

  4. 4

    Python: How can I read csv and clean my data in a loop

  5. 5

    How can I read from a CSV file into 2 ArrayLists depending on the data type I have got in the File?

  6. 6

    how can i delete an entry from Dictionary data structure in Typescript based on the key?

  7. 7

    How can I read a crash file from /var/crash

  8. 8

    Can I read in binary data with istream in c++?

  9. 9

    to implement code which can receive continuous data from bluetooth health device and I'm getting runtime error on eclipse.

  10. 10

    How can I read the body of a messages in a Gmail account from Perl?

  11. 11

    How can I add extra column in datagridview when I fetch data from database

  12. 12

    How can I read a CLongBinary field from my database and write it into a CFile object?

  13. 13

    I can't access native iOS from javascript in phonegap 2.7.0 using CDVPlugin?

  14. 14

    how can I read from an uploaded text file

  15. 15

    How to read a Data Matrix barcode

  16. 16

    how to use textChanged event when from barcode reader

  17. 17

    How to Read Specific data from to InputStream object?

  18. 18

    How can I read a text file from the terminal and save the output to another file in java?

  19. 19

    How can I read a CSV from Webserver using c# with LINQ? (ClickOnce deployment)

  20. 20

    AngularJS - How can I get data from GET method

  21. 21

    How can I sync my data from an external database in Rails?

  22. 22

    How can I open another app made for me from webintent in phonegap?

  23. 23

    How can I retrieve original data from a signature with GnuPG?

  24. 24

    How to read Data from WebSite into R

  25. 25

    How can I get bluetooth to work on Windows Server 2012?

  26. 26

    How can I read and extract information from a DDS-1 tape today?

  27. 27

    What Psensor data can you read from an intel gpu?

  28. 28

    Barcode scanner work in browser

  29. 29

    How can I format a linux liveusb so that grub can read it?

뜨겁다태그

보관