Android Question Inline Java

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hi

this code does not compile.

B4X:
#If JAVA
   public String ByteArrayToHexString(byte [] inarray)
   
     {
   
    int i, j, in;
    String [] hex = {"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"};
    String out= "";

    For(j = 0 ; j < inarray.length ; ++j)
       {
    in = (int) inarray[j] & 0xff;
    i = (in >> 4) & 0x0f;
    out += hex[i];
    i = in & 0x0f;
    out += hex[i];
    }
    Return out;
   }
#End If

I get the following error:

upload_2015-7-21_14-18-0.png


All help appreciated.

Regards

John.
 

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hi Erel

I am trying to convert, android.nfc.extra.ID=[B@41ad7298, to the UID as I am experiencing problems with the NFC record reader when I store GPS data and some text in a tag. I have also used a combination of UltraLight & MifareUltralight. with MifareUltralight when reading a page it seems to read for then 4 bytes per page.

So I am trying to understand the data so I can read it manually.

We have a project to scan many different tags types and store them in an SQL server so a presentation windows app can display the data.

Regards

John.
 
Upvote 0
Top