Forum Replies Created
-
Hi Mike,
You can use this function to get byte array, after that, you can convert byte array to the string hex value:
public static byte[] toByteArray(int data, int length){
byte[] byteArr = ByteBuffer.allocate(INT_LENGTH).putInt(data).array();
if(length!=INT_LENGTH)
byteArr = Arrays.copyOfRange(byteArr, INT_LENGTH - length, INT_LENGTH);
return byteArr;
}
+ 0 | - 0
*If you want to get hex data as String
+ 0 | - 0
Hi Mike,
How you getting this id?
If command is correct, you should get the array of bytes. If you can get String text from that byte array you can use following code:
Java
public static String toHexString(byte[] buffer) {
String bufferString = "";
for (int i = 0; i < buffer.length; i++) {
String hexChar = Integer.toHexString(buffer & 0xFF);
if (hexChar.length() == 1) {
hexChar = "0" + hexChar;
}
bufferString += hexChar.toUpperCase() + " ";
}
bufferString = bufferString.substring(0, bufferString.length()-1);
return bufferString;
}
+ 0 | - 0
Re: Reply To: Can't use example for Android
9. May 2017 at 15:03 in reply to: Can't use example for AndroidI just copied the example. I didn't do any settings. Which setting I have to do for gradle? I don't have build folder, cuz I can't build project. I tried to follow every step by instruction (https://www.mifare.net/en/products/tools/taplinx-application-note/ ), but I can't do first compile. I have error what I sent in previous comments.
+ 0 | - 0
Re: Reply To: Can't use example for Android
8. May 2017 at 23:04 in reply to: Can't use example for AndroidI tried to compile android app from source (http://maven.taplinx.nxp.com/nexus/content/repositories/taplinxfiles/SampleAppSources/srcsamplenxpnfclib/1.2/ ) but I got error: image (https://i.imgur.com/4lNjmMD.png )
How can I resolve this issue?
+ 0 | - 0
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)