Code example for NdefRecord

Methods: getPayload, getTnf, getType

0
    public String getSnippet(Context context, Locale locale) {
        return mType;
    } 
 
    public static MimeRecord parse(NdefRecord record) {
        Preconditions.checkArgument(record.getTnf() == NdefRecord.TNF_MIME_MEDIA);
        String type = new String(record.getType(), Charset.forName("US-ASCII"));
        byte[] payload = record.getPayload();
        return new MimeRecord(type, payload);
    } 
 
    public static boolean isMime(NdefRecord record) {
        try { 
            parse(record);
            return true; 
        } catch (IllegalArgumentException e) {
            return false; 
        } 
    } 
 
    public static NdefRecord newMimeRecord(String type, byte[] data) {