Android Open Source - NFCAndroid Helper






From Project

Back to project page NFCAndroid.

License

The source code is released under:

Copyright (c) 2012, Wireless Sensor Technologies, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following ...

If you think the Android project NFCAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.gototags.nfc;
//from  www  .j a  v a 2 s .c o  m
import java.util.Formatter;

final class Helper {
  static String toHex(byte[] data) {
    if (data == null || data.length == 0)
      return null;
    
    StringBuilder stringBuilder = new StringBuilder(data.length * 2);

    Formatter formatter = null;
    
    try {
      formatter = new Formatter(stringBuilder);
      
      for (byte b : data) {
        formatter.format("%02x", b);
      }

      return "0x" + stringBuilder.toString();
    } finally {
      if (formatter != null)
        formatter.close();
    }
  }
}




Java Source Code List

com.gototags.nfc.Helper.java
com.gototags.nfc.NfcTag.java
com.gototags.nfc.app.BaseActivity.java
com.gototags.nfc.app.MainActivity.java
com.gototags.nfc.ndef.ParsedNdefRecord.java
com.gototags.nfc.ndef.TextNdefRecord.java
com.gototags.nfc.ndef.UriNdefRecord.java
com.gototags.nfc.records.NdefRecordParser.java
com.gototags.nfc.records.PhoneRecord.java
com.gototags.nfc.records.RecordType.java
com.gototags.nfc.records.Record.java
com.gototags.nfc.records.TextRecord.java
com.gototags.nfc.records.WebsiteRecord.java