NFC Library for Android 4.1 Full Source

NFC Library for Android 4.1 Full Source
NFC Library for Android 4.1 Full Source | 71 Mb


Delphi and C++ Builder NFC library for Android.

FEATURES

Uses Android NFC API
Provides reading, writing and formatting NFC tags
Supports NDEF, NFC-A, NFC-V, MIFARE Classic and MIFARE Ultralight tags
Available for Delphi/C++ Builder XE7 - 10
Source code included in full version
Royalty free distribution in applications

type
TOnNfcIntent = procedure(Intent: JIntent);

function GetNfcAdapter: JNfcAdapter;
procedure RegisterNfc(OnNfcIntent: TOnNfcIntent);
procedure ShowNfcSettings;

function BytesToHex(Bytes: TJavaArray; Separator: Char = ':'): string;
function BytesToHex(const Bytes: TArray; Separator: Char = ':'): string;
function BytesToHex(const Bytes: TArray; From, Count: Integer; Separator: Char = ':'): string;

function BytesToHexReverse(Bytes: TJavaArray; Separator: Char = ':'): string;
function BytesToHexReverse(const Bytes: TArray; Separator: Char = ':'): string;
function BytesToHexReverse(const Bytes: TArray; From, Count: Integer; Separator: Char = ':'): string;

type
TNfcTag = class
constructor Create(Intent: JIntent);
constructor Create(Tag: JTag);
function Id(Separator: Char = ':'): string;

property MifareClassic: TMifareClassic read;
property MifareUltralight: TMifareUltralight read;
property Ndef: TNdef read;
property NdefFormatable: TNdefFormatable read;
property NfcA: TNfcA read;
property NfcV: TNfcV read;
property Tag: JTag read;
property TechList: TArray read;
end;

TNfcA = class
function Transceive(data: TArray): TArray;

property Atqa: TArray read;
property MaxTransceiveLength: Integer read;
property NfcA: JNfcA read;
property Sak: SmallInt read;
property Tag: JTag read;
property Timeout: Integer read write;
end;

TNfcV = class
function EasAlarm: TArray;
function GetSecurity(FirstBlock, BlockCount: Byte): TArray;
function LockAfi: TArray;
function LockBlock(Block: Byte): TArray;
function LockDsfid: TArray;
function LockEas: TArray;
function ReadBlock(Block: Byte): TArray;
function ReadBlocks(FirstBlock, BlockCount: Byte): TArray;
function ResetEas: TArray;
function ResetToReady: TArray;
function SetEas: TArray;
function Transceive(data: TArray): TArray;
function WriteAfi(AFI: Byte): TArray;
function WriteBlock(Block: Byte; data: TArray): TArray;
function WriteBlocks(FirstBlock, BlockCount: Byte; data: TArray): TArray;
function WriteDsfid(DSFID: Byte): TArray;

property BlockCount: Integer read;
property BlockSize: Integer read;
property DsfId: Byte read;
property Ic: Integer read;
property Inventory: TArray read;
property MaxTransceiveLength: Integer read;
property NfcV: JNfcV read;
property ResponseFlags: Byte read;
property SystemInformation: TArray read;
property Tag: JTag read;
end;

TNdef = class
function MakeReadOnly: Boolean;
function Write(NdefRecord: TNdefRecord): Boolean;
function Write(NdefRecords: TArray): Boolean;
function Write(NdefRecords: array of TNdefRecord): Boolean;

property CanMakeReadOnly: Boolean read;
property IsWritable: Boolean read;
property MaxSize: Integer read;
property Ndef: JNdef read;
property Records: TArray read;
property Tag: JTag read;
property &Type: string read;
end;

TNdefFormatable = class
function Format: Boolean;
function FormatReadOnly: Boolean;

property NdefFormatable: JNdefFormatable read;
property Tag: JTag read;
end;

TMifareUltralight = class
function Readdata: TArray;
function ReadPage(PageOffset: Integer): TArray;
function ReadPages: TArray procedure WritePage(PageOffset: Integer; data: TArray);
procedure WritePages(FirstPageOffset: Integer; data: TArray
property MaxTransceiveLength: Integer read;
property MifareUltralight: JMifareUltralight read;
property PageCount: Integer read;
property Tag: JTag read;
property Timeout: Integer read write;
property &Type: Integer read;
property TypeDescription: string read;
end;

TMifareClassic = class
property BlockCount: Integer read;
property BlockSize: Integer read;
property MifareClassic: JMifareClassic read;
property MaxTransceiveLength: Integer read;
property SectorCount: Integer read;
property Size: Integer read;
property Tag: JTag read;
property Timeout: Integer read write;
property &Type: Integer read;
property TypeDescription: string read;

function ReadBlock(Index: Integer): TArray;
function ReadBlocks: TArray function Readdata: TArray;
end;

TNdefRecord = class
class function CreateExternalRecord(const Domain, &Type: string; const data: TArray): TNdefRecord;
class function CreateApplicationRecord(const PackageName: string): TNdefRecord;
class function CreateMimeRecord(const MimeType: string; const Mimedata: TArray): TNdefRecord;
class function CreateTextRecord(const Text: string; const LanguageCode: string = 'en'): TNdefRecord;
class function CreateUriRecord(const Uri: string): TNdefRecord;

property ExternalText: string read;
property IsAbsoluteUri: Boolean read;
property IsEmpty: Boolean read;
property IsExternalType: Boolean read;
property IsMimeMedia: Boolean read;
property IsText: Boolean read;
property IsUnchanged: Boolean read;
property IsUnknown: Boolean read;
property IsUri: Boolean read;
property IsWellKnown: Boolean read;
property NdefRecord: JNdefRecord read;
property Payload: TArray read;
property PayloadUtf8: string read;
property Text: string read;
property TextLanguageCode: string read;
property TnfDescription: string read;
property Uri: string read;
end;


WHAT'S NEW

Version 4.1
added Delphi/C++ Builder 10 files


DOWNLOAD
Information
Users of Guests are not allowed to comment this publication.