Code example for NdefMessage

        public NdefMessage[] msgs;
        public TagDescription(String title, byte[] bytes) {
            this.title = title;
            try { 
                msgs = new NdefMessage[] {new NdefMessage(bytes)};
            } catch (final Exception e) {
                throw new RuntimeException("Failed to create tag description", e);
        public String toString() {
            return title;
    public void onCreate(Bundle savedState) {
Connect your IDE to all the code out there  Get Codota for Java