NFC Android Application with Delphi XE6 and XE7
Download Delphi XE6 Example Source Code
For the German Delphi Days last Weekend in Bonn i prepared a Workshop and a Session how to develop with Delphi a Android Application to read and write NFC tags. So i worked out a Delphi Example to do this. Delphi brings no ready components to do this out of the box. So i tried my first steps and i found it is not only necessary to add in classes.dex the NFC SDK Jar Files, no it was also necessary to change the NativeActivity in the AndroidManfifest.template (see later more in detail). I remember that my friend Brian Long, also a Embarcadero MVP have done this with XE5 and XE6 on his blog (LINK). So i called him and we suprise, he was also to test out NFC with Delphi for Android at the same time. So we decided everybody was work for 1 week seperate and then we merge our knowledge. It was really funny later he did found out what i am missing and i found out stuff he missed.
Brian Long also published his result here: LINK
Requirements
1. to run such Android Applications you need a Android Device WITH NFC ! So please check your device. I found also a nice webpage with a collection of NFC Android Devices on LINK/
2. Ready installed Delphi XE6 or XE7
3. Read AND understand (!) the Article published from Google in the Developer Network. Minimum read and understand the following parts in Chapter NFC Basics:
NFC Basics
- The Tag Dispatch System
- Requesting NFC Access in the Android Manifest
- Filtering for NFC Intents
- Creating Common Types of NDEF Records
4. Read dokwiki what is classes.dex in Delphi and how to patch this:
- XE6 Users: LINK
- XE7 Users: LINK
XE6 Users: A big new function in XE7 IDE is to drag and drop a jar file in your porject, and Delphi create on compile the classes.dex file for you automatic. So ist is extreme much easier to add your custom or 3rd Party JARS from other Hardware for your device into your Delphi Project
Ok let's rock Delphi to work with NFC on Android Devices
Before we create the Delphi Project, we need to pack all the NFC SDK stuff in a JAR file and create the Pascal files to use it.
The minimum version requirements, the NFC is to Android2.3 (Level 10) began to support the minimum version requirements must be specified as 10. Introduced in Android 4.0 (API level 14) we can all we need to read and write NFC and much more. This should also you minimum SDK on your Computer. So if you have not this SDK on your machine, please update your sdk folder with local "SDK Manager.exe" in your Android SDK folder Path.
Let's tals also for nun Java Friends how to generate a .java text file to a .jar file. It is very simple. For Delphi XE6 you need minimum java 1.6 and XE7 java 1.7 on your machine. Open a Command box and type "java -version". If java is installed correct you should a result like this:
crash session how to compile a jar file from a .java text file
- javac ABC.java <-- create a ABC.class from .java file
- jar cfv ABC.jar ABC.class <-- this create a .jar file from .class file
so wee need all NFC .java files in your
PATH_TO YOUR SDK FOLDER ..Android\sdk\sources\android-20\android\nfc\
After this two simple commands we have a ready jar file to generate the pascal file.
This inteface pascal file for this new Java classes. This is not so simple for XE6 Users. You can write it by hand but this will end in a horror never ending time. There are some 3rd party tools like Java2Pas and other, but this produce for each created .jar file a seperate .pas file. But mostly each file uses each other. So you have circular uses wich delphi can not compile this, so you must copy paste all .pas files in one file per hand. XE7 Users get a free tool Java2OP.exe (it should be possible to download in a few days). This tool handles all for you perfect - LINK TO JAVA2OP .
I think the generated files can be used also in XE6, but i have not tested out, cause the Embarcadero Java2OP.exe is not available now during the time i was writing this article. Also the Embarcadero Java2OP.exe should generate the Pascal files direct form the .java files, so compiling to jar is not necessary anymore, as the documentation is talk about it. but it was not possible to test.
Don't go in panic in my example download, the .pas file is ready to use. i have generated it with my own converter.
Ok what also we need and this we add in the classes.dex file:
to catch the event if a user is bring a NFC Card to the Phone i found out the application get a onNewIntent fired. But this Events we did not find translated to the firemonkey framework. but this is very simple to solve. we write a very small java class and add this class to our classes.dex.
This java class handles everything for us like onNewIntent, NFC enable/disable on pause, resume,...
With the line public native void onNewIntentNative(Intent NewIntent); we introduce a new method wich will be fired on the original onNewIntent method. Thanks to Brian Long to figure this out
- packagenet.developerexperts.nfc;
- importandroid.os.Bundle;
- importandroid.util.Log;
- importandroid.content.Intent;
- importandroid.nfc.NfcAdapter;
- importandroid.content.Intent;
- importandroid.app.PendingIntent;
- importandroid.app.AlertDialog;
- importandroid.content.DialogInterface;
- importandroid.content.DialogInterface.OnClickListener;
- publicclass NativeActivitySubclass extends com.embarcadero.firemonkey.FMXNativeActivity{
- staticfinalString TAG ="NativeActivitySubclass";
- private NfcAdapter nfcAdapter;
- private PendingIntent pendingIntent;
- @Override
- protectedvoid onCreate(Bundle savedInstanceState){
- super.onCreate(savedInstanceState);
- //Custom initialization
- nfcAdapter = NfcAdapter.getDefaultAdapter(this);
- Intent intent =new Intent(this, getClass());
- pendingIntent = PendingIntent.getActivity(this, 0,
- intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
- }
- publicnativevoid onNewIntentNative(Intent NewIntent);
- @Override
- protectedvoid onNewIntent(Intent intent)
- {
- super.onNewIntent(intent);
- onNewIntentNative(intent);
- }
- @Override
- publicvoid onPause()
- {
- super.onPause();
- disableForegroundDispatch();
- }
- @Override
- publicvoid onResume()
- {
- super.onResume();
- enableForegroundDispatch(pendingIntent);
- }
- publicvoid enableForegroundDispatch(PendingIntent pendingIntent)
- {
- nfcAdapter.enableForegroundDispatch(this, pendingIntent, null, null);
- }
- publicvoid disableForegroundDispatch()
- {
- nfcAdapter.disableForegroundDispatch(this);
- }
- publicvoid showDialog(finalString title, finalString msg)
- {
- Log.d(TAG, "Displaying dialog");
- runOnUiThread(newRunnable(){
- publicvoid run(){
- AlertDialog.Builder builder =new AlertDialog.Builder(NativeActivitySubclass.this);
- builder.setMessage(msg).
- setTitle(title).
- setCancelable(true).
- setPositiveButton("OK", new OnClickListener(){
- publicvoid onClick(DialogInterface dialog, int which)
- {
- dialog.dismiss();
- }
- }).show();
- }
- });
- }
- }
for this small new onNewIntentNative we add later a method in our mainform:
- procedure OnNewIntentNative(PEnv: PJNIEnv; This: JNIObject; NewIntent: JNIObject);cdecl;
- begin
- Log.d('Queuing native routine to run synchronized');
- TThread.Queue(nil,
- procedure
- begin
- frmMain.OnNewIntent(TJIntent.Wrap(NewIntent));//CALL the next procedure
- end);
- end;
- procedure TfrmMain.OnNewIntent(Intent: JIntent);
- begin
- //here we add later code what ever we like to do if a NFC Card is found
- end;
to register the native event we this code in delphi
- procedure TfrmMain.RegisterDelphiNativeMethods;
- var
- PEnv: PJNIEnv;
- ActivityClass: JNIClass;
- NativeMethod: JNINativeMethod;
- begin
- Log.d('Starting the registration JNI stuff');
- PEnv := TJNIResolver.GetJNIEnv;
- Log.d('Registering interop method');
- NativeMethod.Name:='onNewIntentNative';
- NativeMethod.Signature:='(Landroid/content/Intent;)V';
- NativeMethod.FnPtr:=@OnNewIntentNative;
- ActivityClass := PEnv^.GetObjectClass(PEnv, PANativeActivity(System.DelphiActivity).clazz);
- PEnv^.RegisterNatives(PEnv, ActivityClass,@NativeMethod,1);
- PEnv^.DeleteLocalRef(PEnv, ActivityClass);
- end;
Ok let's go back to add our small jar file into XE6
To generate in XE6 your custom classes.dex file Brian Long have written a wonderful batch file:
- @echo off
- setlocal
- // CHANGE IN NEXT LINE YOUR SDK ROOT FOLDER
- if x%ANDROID% == x set ANDROID=c:\Android\sdk\
- set ANDROID_PLATFORM=%ANDROID%\platforms\android-19
- set DX_LIB=%ANDROID%\build-tools\android-4.4\lib
- set DX_BATCH=%ANDROID%\build-tools\android-4.4
- set EMBO_DEX="C:\Program Files (x86)\Embarcadero\Studio\14.0\lib\android\debug\classes.dex"
- set PROJ_DIR="%CD%"
- set VERBOSE=0
- echo.
- echo Compiling the Java activity source file
- echo.
- mkdir output 2>nul
- mkdir output\classes 2>nul
- if x%VERBOSE% == x1 SET VERBOSE_FLAG=-verbose
- javac %VERBOSE_FLAG% -source 1.6 -target 1.6 -Xlint:deprecation -cp %ANDROID_PLATFORM%\android.jar;classes.jar -d output\classes src\net\developerexperts\nfc\NativeActivitySubclass.java
- echo.
- echo Creating jar containing the new classes
- echo.
- mkdir output\jar 2>nul
- if x%VERBOSE% == x1 SET VERBOSE_FLAG=v
- jar c%VERBOSE_FLAG%f output\jar\test_classes.jar -C output\classes net
- echo.
- echo Converting from jar to dex...
- echo.
- mkdir output\dex 2>nul
- if x%VERBOSE% == x1 SET VERBOSE_FLAG=--verbose
- call%DX_BATCH%\dx --dex %VERBOSE_FLAG% --output=%PROJ_DIR%\output\dex\test_classes.dex --positions=lines %PROJ_DIR%\output\jar\test_classes.jar
- echo.
- echo Merging dex files
- echo.
- java -cp %DX_LIB%\dx.jar com.android.dx.merge.DexMerger %PROJ_DIR%\output\dex\classes.dex %PROJ_DIR%\output\dex\test_classes.dex %EMBO_DEX%
- echo Tidying up
- echo.
- del output\classes\net\developerexperts\nfc\NativeActivitySubclass*.class
- rmdir output\classes\net\developerexperts\nfc
- rmdir output\classes\net\developerexperts
- rmdir output\classes\net
- rmdir output\classes
- del output\dex\test_classes.dex
- del output\jar\test_classes.jar
- rmdir output\jar
- echo.
- echo Now we have the end result, which is output\dex\classes.dex
- :Exit
- endlocal
Important: if you have installed on your machine Java 1.7 or higher you must compile for Delphi XE6 in java 1.6 this you do like in the batch file:
javac %VERBOSE_FLAG% -source 1.6 -target 1.6 -Xlint:deprecation......
This batch file is not needed for XE7 users cause as i have written you can easy drag and drop the jar files in your project under the project tree in android section.
WOW what a hard work, but if you understand this you are now a hero. now you can add every other jar file in your classes.dex and can easy call.
Now we can with Delphi and welcome back to pascal code
Generate a new Delphi FMX Project and change it to Android. Save and open the AndroidManifest.template.xml
there we found in the activity area and have to change:
- <activityandroid:name="com.embarcadero.firemonkey.FMXNativeActivity"
- android:label="%activityLabel%"
- android:configChanges="orientation|keyboardHidden">
Replace with our new Added class to receive our onNewIntent
- <activityandroid:name="net.developerexperts.nfc.NativeActivitySubclass"
- android:label="%activityLabel%"
- android:configChanges="orientation|keyboardHidden"
- android:launchMode="singleTop">
Also we add all NFC enhancements what we like to use in our Delphi Application, as you have readed in the Google Developer docs (see requirements on the top of this article). So your AndroidManifest.template.xml sould look like this:
- <?xmlversion="1.0"encoding="utf-8"?>
- <!-- BEGIN_INCLUDE(manifest) -->
- <manifestxmlns:android="http://schemas.android.com/apk/res/android"
- package="%package%"
- android:versionCode="%versionCode%"
- android:versionName="%versionName%">
- <!-- This is the platform API where NativeActivity was introduced. -->
- <!--<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="%targetSdkVersion%" /> -->
- <!-- <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="11" /> -->
- <uses-sdkandroid:minSdkVersion="%minSdkVersion%"android:targetSdkVersion="%targetSdkVersion%"/>
- <%uses-permission%>
- <applicationandroid:persistent="%persistent%"
- android:restoreAnyVersion="%restoreAnyVersion%"
- android:label="%label%"
- android:installLocation="%installLocation%"
- android:debuggable="%debuggable%"
- android:largeHeap="%largeHeap%"
- android:icon="%icon%"
- android:theme="%theme%"
- android:hardwareAccelerated="%hardwareAccelerated%">
- <!-- Our activity is a subclass of the built-in NativeActivity framework class.
- This will take care of integrating with our NDK code. -->
- <activityandroid:name="net.developerexperts.nfc.NativeActivitySubclass"
- android:label="%activityLabel%"
- android:configChanges="orientation|keyboardHidden"
- android:launchMode="singleTop">
- <!-- Tell NativeActivity the name of our .so -->
- <meta-dataandroid:name="android.app.lib_name"
- android:value="%libNameValue%"/>
- <intent-filter>
- <actionandroid:name="android.intent.action.MAIN"/>
- <categoryandroid:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- <intent-filter>
- <actionandroid:name="android.nfc.action.NDEF_DISCOVERED"/>
- <categoryandroid:name="android.intent.category.DEFAULT"/>
- <dataandroid:mimeType="text/plain"/>
- </intent-filter>
- <intent-filter>
- <actionandroid:name="android.nfc.action.NDEF_DISCOVERED"/>
- <categoryandroid:name="android.intent.category.DEFAULT"/>
- <dataandroid:scheme="http"/>
- </intent-filter>
- <intent-filter>
- <actionandroid:name="android.nfc.action.NDEF_DISCOVERED"/>
- <categoryandroid:name="android.intent.category.DEFAULT"/>
- <dataandroid:scheme="dav"/>
- </intent-filter>
- <intent-filter>
- <actionandroid:name="android.nfc.action.TECH_DISCOVERED"/>
- <categoryandroid:name="android.intent.category.DEFAULT"/>
- </intent-filter>
- <meta-dataandroid:name="android.nfc.action.TECH_DISCOVERED"
- android:resource="@xml/nfc_tech_filter"/>
- </activity>
- <receiverandroid:name="com.embarcadero.firemonkey.notifications.FMXNotificationAlarm"/>
- </application>
- </manifest>
- <!-- END_INCLUDE(manifest) -->
Also in in Deployment Options (Menu: Project - Deployment) it is important to disable (only XE6, XE7 do it four you automatic as you learned) the original classes.dex file and deploy your new generated classes.dex file.
Next important step is to enable in your Application under Menu Project - Options the NFC rights.
I think it is not necessary to discuss all the source lines, but lets try to explain all the new NFC new line. In my Project you find two units:
DeveloperExperts.Android.nfc.pas
this is the generated interface unit to the NFC Android imported SDK we like to use and call
DeveloperExperts.Android.nfc.Helper.pas
this unit handles the most important stuff to work with NFC and Delphi
- TDXNFCHelper =class
- private
- public
- classfunction getNFCManager: JNfcManager;
- classfunction checkNFC:boolean;
- classfunction getNFCDefaultAdapter: JNfcAdapter;
- classfunction NdefRecordsJavaBytesToString(jbytes: TJavaArray<Byte>;const MimeType: TDXMimeType): TDXStringRecord;
- classfunction GetDXMimeTypeFromString(const sMimeType:string): TDXMimeType;
- classfunction GetURIType(const _uriID:integer): TDXUriResult;
- classfunction StringToJavaArrayOfBytes(sText:string): TJavaArray<System.Byte>; static;
- classprocedure JavaArrayByteCopy(src: TJavaArray<System.Byte>; srcPos:integer; dest: TJavaArray<System.Byte>; destPos:integer; _length:integer);
- classprocedure WriteTextRecordsToNfcCard(NdefRecordsText: TList<string>; IsoLangCode:string; _tag: JTag);
- end;
this helper class with class methods (for delphi beginners: you do not need to create this class) gives you some methods:
class function checkNFC: boolean;
check is NFC is available an possible to access
class function getNFCManager: JNfcManager;
like described in the Google Developer NFC Guide you get back a NFCManager over this you can access for example the default Adapter to read and write the NFC Card stuff
class function getNFCDefaultAdapter: JNfcAdapter;
direct access to the NFC Default Adapter
class procedure WriteTextRecordsToNfcCard(NdefRecordsText: TList; IsoLangCode: string; _tag: JTag);
write all strings from the Input Parameter TList to text records to the NCF card
all other methods are helper to convert String to Java Array, getMimeTypes, URIType and much more...
Lets analyse the main form
You find a ListBox with 2 items:
checkNFC: call the HelperClass checkNFC to check is NFC available
writeNFC: set a local variable NextNFCTagScanWaitingDataToWrite:=true
so next NFC card touched to the device will be written. Every time a NFC card touched to the device OnNewIntent will be fired (you remember we introduced our java class to get this event)
- procedure TfrmMain.OnNewIntent(Intent: JIntent);
- begin
- SharedActivity.setIntent(Intent);
- CurrentNFCTag := Intent.getParcelableExtra(TJNFCAdapter.JavaClass.EXTRA_TAG);
- ifnot NextNFCTagScanWaitingDataToWrite then
- ReadAllInfomationsFromCurrentNFCIntent
- else
- begin
- WriteWaitingDataToNfcTag;
- end;
- end;
There you can found the local variable NextNFCTagScanWaitingDataToWrite check if we read or write the NFC Card.
Writing is very simple.
- procedure TfrmMain.WriteWaitingDataToNfcTag;
- var
- _tag: JTag;
- sRecords: TList<string>;
- begin
- NextNFCTagScanWaitingDataToWrite :=false;
- displayResult('start writing data',true);
- _tag := TJTag.Wrap((CurrentNFCTag as ILocalObject).GetObjectID);
- ifAssigned(_tag)then
- begin
- sRecords:=TList<string>.Create;
- sRecords.Add('This record is from Elmo');
- sRecords.Add('This record is from Bert');
- sRecords.Add('This record is from Cookiemonster');
- TDXNFCHelper.WriteTextRecordsToNfcCard(sRecords,'en',_tag);
- displayResult('finished writing data',true);
- end
- else
- begin
- displayResult('Tag instance not found');
- end;
- end;
We generate a TList with all the string we write to the NFC Records. The Helper class make us easy to write:
TDXNFCHelper.WriteTextRecordsToNfcCard(sRecords,'en',_tag);
1. Parameter = the list of strings
2. given a Language Code of our text
3. the _tag (our NFC Card access)
Reading:
- procedure TfrmMain.ReadNFCRecords;
- var
- Intent: JIntent;
- jIntentName: JString;
- IntentName:string;
- rawMsgs: Androidapi.JNIBridge.TJavaArray<JParcelable>;
- msg: JNdefMessage;
- msgRecords: Androidapi.JNIBridge.TJavaObjectArray<JNdefRecord>;
- i:Integer;
- _NdefRecordRaw: JNIObject;
- _NdefRecord: JNdefRecord;
- recBytes: Androidapi.JNIBridge.TJavaArray<Byte>;
- _currentRecord: TDXStringRecord;
- begin
- Intent := SharedActivity.getIntent;
- if Intent <> nilthen
- begin
- jIntentName := Intent.getAction;
- IntentName := JStringToString(jIntentName);
- if(TJNFCAdapter.JavaClass.ACTION_NDEF_DISCOVERED.equals(Intent.getAction))or(TJNFCAdapter.JavaClass.ACTION_TECH_DISCOVERED.equals(Intent.getAction))then
- begin
- try
- rawMsgs := Intent.getParcelableArrayExtra(TJNFCAdapter.JavaClass.EXTRA_NDEF_MESSAGES);
- if rawMsgs <> nilthen
- begin
- if rawMsgs.Length> 0then
- begin
- msg := TJNdefMessage.Wrap((rawMsgs[0]as ILocalObject).GetObjectID);
- msgRecords := msg.getRecords;
- for i :=0to msgRecords.Length-1do
- begin
- _NdefRecordRaw := msgRecords.GetRawItem(i);
- _NdefRecord := TJNdefRecord.Wrap(_NdefRecordRaw);
- recBytes := _NdefRecord.getPayload;
- _currentRecord := TDXNfcHelper.NdefRecordsJavaBytesToString(recBytes, TDXNfcHelper.GetDXMimeTypeFromString(JStringToString(_NdefRecord.toMimeType)));
- ifnot _currentRecord.UriResult.UriIsValidthen
- begin
- // mimetype text
- displayResult('Record '+ i.ToString);
- displayResult('MIME: '+ JStringToString(_NdefRecord.toMimeType));
- displayResult('ISO CODE: '+ _currentRecord.ISOCode);
- displayResult(_currentRecord.payload);
- end
- else
- begin
- // mimetype URI
- displayResult('Record '+ i.ToString);
- displayResult('URI: '+ _currentRecord.UriResult.UriText+ _currentRecord.payload);
- end;
- end;
- end;
- end;
- except
- on E: Exception do
- begin
- //Log however you like
- end;
- end;
- end;
- end;
- end;
First we check over the intent name if ACTION_NDEF_DISCOVERED (remmeber Google Article NFC Basics). If NFC Intent equals ACTION_NDEF_DISCOVERED so we know we have standard records. So we must read out the the message. The message contains none to many records. we loop over each record and read out the mime time and display the result. In my example i analyse only text and URI types, but you can easy extend to every valid type.
Now you know the most basic steps. You find much more in my example. So take your time to play and work with it.
Summary
You learned how to:
- import android sdk framework stuff
- convert your self written java to jar's
- add your jar's to classes.dex
- how to generate pascal interface files
- call from delphi such stuff
Download Delphi XE6 Example Source Code
What's coming next? Waiting to catch a iPhone 6 to use Delphi and NFC on iOS. This Article will be continued after i have this device in my hand
regards
daniel magin
Embarcadero MVP
@ the end here the wrapped NFC Pascal file (also included in download)
- // File generated on 29.07.2014 12:05:01 by DeveloperExperts
- unit DeveloperExperts.Android.nfc;
- interface
- uses
- Androidapi.JNIBridge,
- Androidapi.JNI.Analytics,
- Androidapi.JNI.ApkExpansion,
- Androidapi.JNI.App,
- Androidapi.JNI.Dalvik,
- Androidapi.JNI.Embarcadero,
- Androidapi.JNI.GraphicsContentViewText,
- Androidapi.JNI.Hardware,
- Androidapi.JNI.InputMethodService,
- Androidapi.JNI.JavaTypes,
- Androidapi.JNI.Licensing,
- Androidapi.JNI.Location,
- Androidapi.JNI.Media,
- Androidapi.JNI.Net,
- Androidapi.JNI.OpenGL,
- Androidapi.JNI.Os,
- Androidapi.JNI.PlayServices,
- Androidapi.JNI.Provider,
- Androidapi.JNI.Support,
- Androidapi.JNI.Telephony,
- Androidapi.JNI.Util,
- Androidapi.JNI.VideoView,
- Androidapi.JNI.Webkit,
- Androidapi.JNI.Widget;
- type
- { Class forward declarations }
- JCardEmulation =interface;{ android/nfc/cardemulation/CardEmulation }
- JHostApduService =interface;{ android/nfc/cardemulation/HostApduService }
- JOffHostApduService =interface;{ android/nfc/cardemulation/OffHostApduService }
- JFormatException =interface;{ android/nfc/FormatException }
- JNdefMessage =interface;{ android/nfc/NdefMessage }
- JNdefRecord =interface;{ android/nfc/NdefRecord }
- JNfcAdapter_CreateBeamUrisCallback =interface;{ android/nfc/NfcAdapter$CreateBeamUrisCallback }
- JNfcAdapter_CreateNdefMessageCallback =interface;{ android/nfc/NfcAdapter$CreateNdefMessageCallback }
- JNfcAdapter_OnNdefPushCompleteCallback =interface;{ android/nfc/NfcAdapter$OnNdefPushCompleteCallback }
- JNfcAdapter_ReaderCallback =interface;{ android/nfc/NfcAdapter$ReaderCallback }
- JNfcAdapter =interface;{ android/nfc/NfcAdapter }
- JNfcEvent =interface;{ android/nfc/NfcEvent }
- JNfcManager =interface;{ android/nfc/NfcManager }
- JTag =interface;{ android/nfc/Tag }
- JTagLostException =interface;{ android/nfc/TagLostException }
- JBasicTagTechnology =interface;{ android/nfc/tech/BasicTagTechnology }
- JIsoDep =interface;{ android/nfc/tech/IsoDep }
- JMifareClassic =interface;{ android/nfc/tech/MifareClassic }
- JMifareUltralight =interface;{ android/nfc/tech/MifareUltralight }
- JNdef =interface;{ android/nfc/tech/Ndef }
- JNdefFormatable =interface;{ android/nfc/tech/NdefFormatable }
- JNfcA =interface;{ android/nfc/tech/NfcA }
- JNfcB =interface;{ android/nfc/tech/NfcB }
- JNfcBarcode =interface;{ android/nfc/tech/NfcBarcode }
- JNfcF =interface;{ android/nfc/tech/NfcF }
- JNfcV =interface;{ android/nfc/tech/NfcV }
- JTagTechnology =interface;{ android/nfc/tech/TagTechnology }
- JCardEmulationClass =interface(JObjectClass)
- ['{43DA51E2-EA67-4A69-A20F-1DD312214C2E}']
- { Property methods }
- function _GetACTION_CHANGE_DEFAULT: JString;
- function _GetCATEGORY_OTHER: JString;
- function _GetCATEGORY_PAYMENT: JString;
- function _GetEXTRA_CATEGORY: JString;
- function _GetEXTRA_SERVICE_COMPONENT: JString;
- function _GetSELECTION_MODE_ALWAYS_ASK:Integer;
- function _GetSELECTION_MODE_ASK_IF_CONFLICT:Integer;
- function _GetSELECTION_MODE_PREFER_DEFAULT:Integer;
- { Methods }
- function getInstance(adapter: JNfcAdapter): JCardEmulation;cdecl;
- { Properties }
- property ACTION_CHANGE_DEFAULT: JString read _GetACTION_CHANGE_DEFAULT;
- property CATEGORY_OTHER: JString read _GetCATEGORY_OTHER;
- property CATEGORY_PAYMENT: JString read _GetCATEGORY_PAYMENT;
- property EXTRA_CATEGORY: JString read _GetEXTRA_CATEGORY;
- property EXTRA_SERVICE_COMPONENT: JString read _GetEXTRA_SERVICE_COMPONENT;
- property SELECTION_MODE_ALWAYS_ASK:Integerread _GetSELECTION_MODE_ALWAYS_ASK;
- property SELECTION_MODE_ASK_IF_CONFLICT:Integerread _GetSELECTION_MODE_ASK_IF_CONFLICT;
- property SELECTION_MODE_PREFER_DEFAULT:Integerread _GetSELECTION_MODE_PREFER_DEFAULT;
- end;
- [JavaSignature('android/nfc/cardemulation/CardEmulation')]
- JCardEmulation =interface(JObject)
- ['{79EFB1E2-A217-4FA3-BF59-5E79FE67A54B}']
- { Methods }
- function getSelectionModeForCategory(category: JString):Integer;cdecl;
- function isDefaultServiceForAid(service: JComponentName; aid: JString):Boolean;cdecl;
- function isDefaultServiceForCategory(service: JComponentName; category: JString):Boolean;cdecl;
- end;
- TJCardEmulation =class(TJavaGenericImport<JCardEmulationClass, JCardEmulation>)
- end;
- JHostApduServiceClass =interface(JObjectClass)
- ['{D81BC39F-9EC2-4FF2-80C2-AA000344F762}']
- { Property methods }
- function _GetDEACTIVATION_DESELECTED:Integer;
- function _GetDEACTIVATION_LINK_LOSS:Integer;
- function _GetSERVICE_INTERFACE: JString;
- function _GetSERVICE_META_DATA: JString;
- { Methods }
- function init: JHostApduService;cdecl;
- { Properties }
- property DEACTIVATION_DESELECTED:Integerread _GetDEACTIVATION_DESELECTED;
- property DEACTIVATION_LINK_LOSS:Integerread _GetDEACTIVATION_LINK_LOSS;
- property SERVICE_INTERFACE: JString read _GetSERVICE_INTERFACE;
- property SERVICE_META_DATA: JString read _GetSERVICE_META_DATA;
- end;
- [JavaSignature('android/nfc/cardemulation/HostApduService')]
- JHostApduService =interface(JObject)
- ['{C0BA2359-5768-4B3B-9404-2AFFD6F6541B}']
- { Methods }
- procedure notifyUnhandled;cdecl;
- function onBind(intent: JIntent): JIBinder;cdecl;
- procedure onDeactivated(Param0:Integer);cdecl;
- function processCommandApdu(Param0: TJavaArray<Byte>; Param1: JBundle): TJavaArray<Byte>;cdecl;
- procedure sendResponseApdu(responseApdu: TJavaArray<Byte>);cdecl;
- end;
- TJHostApduService =class(TJavaGenericImport<JHostApduServiceClass, JHostApduService>)
- end;
- JOffHostApduServiceClass =interface(JObjectClass)
- ['{F4642B6A-DEFB-49D6-9A3A-D90BB03600AF}']
- { Property methods }
- function _GetSERVICE_INTERFACE: JString;
- function _GetSERVICE_META_DATA: JString;
- { Methods }
- function init: JOffHostApduService;cdecl;
- { Properties }
- property SERVICE_INTERFACE: JString read _GetSERVICE_INTERFACE;
- property SERVICE_META_DATA: JString read _GetSERVICE_META_DATA;
- end;
- [JavaSignature('android/nfc/cardemulation/OffHostApduService')]
- JOffHostApduService =interface(JObject)
- ['{94CBB2DE-3E84-4557-B253-2747C82EBBBA}']
- { Methods }
- function onBind(Param0: JIntent): JIBinder;cdecl;
- end;
- TJOffHostApduService =class(TJavaGenericImport<JOffHostApduServiceClass, JOffHostApduService>)
- end;
- JFormatExceptionClass =interface(JObjectClass)
- ['{558F4E4C-2DE0-4352-B626-2C9B0D482504}']
- { Methods }
- function init: JFormatException;cdecl;overload;
- function init(&message: JString): JFormatException;cdecl;overload;
- function init(&message: JString; e: JThrowable): JFormatException;cdecl;overload;
- end;
- [JavaSignature('android/nfc/FormatException')]
- JFormatException =interface(JObject)
- ['{9F16ED2E-6826-4A40-959E-8858D07D7EF4}']
- end;
- TJFormatException =class(TJavaGenericImport<JFormatExceptionClass, JFormatException>)
- end;
- JNdefMessageClass =interface(JObjectClass)
- ['{1FFA39B2-A5DB-47A9-9737-7C5821DD97ED}']
- { Property methods }
- function _GetCREATOR: JParcelable_Creator;
- procedure _SetCREATOR(Value: JParcelable_Creator);
- { Methods }
- function init(data: TJavaArray<Byte>): JNdefMessage;cdecl;overload;
- function init(&record: JNdefRecord; records: TJavaObjectArray<JNdefRecord>): JNdefMessage;cdecl;overload;
- function init(records: TJavaObjectArray<JNdefRecord>): JNdefMessage;cdecl;overload;
- { Properties }
- property CREATOR: JParcelable_Creator read _GetCREATOR write _SetCREATOR;
- end;
- [JavaSignature('android/nfc/NdefMessage')]
- JNdefMessage =interface(JObject)
- ['{6F6F2C4B-72AA-4F38-9253-A2EF427721C6}']
- { Methods }
- function describeContents:Integer;cdecl;
- function equals(obj: JObject):Boolean;cdecl;
- function getByteArrayLength:Integer;cdecl;
- function getRecords: TJavaObjectArray<JNdefRecord>;cdecl;
- // function getRecords: TJavaArray<JNdefRecord>; cdecl;
- function hashCode:Integer;cdecl;
- function toByteArray: TJavaArray<Byte>;cdecl;
- function toString: JString;cdecl;
- procedure writeToParcel(dest: JParcel; flags:Integer);cdecl;
- end;
- TJNdefMessage =class(TJavaGenericImport<JNdefMessageClass, JNdefMessage>)
- end;
- JNdefRecordClass =interface(JObjectClass)
- ['{A378AA8C-A1F5-4846-9983-EA96BB1E87E4}']
- { Property methods }
- function _GetCREATOR: JParcelable_Creator;
- procedure _SetCREATOR(Value: JParcelable_Creator);
- function _GetRTD_ALTERNATIVE_CARRIER: TJavaArray<Byte>;
- procedure _SetRTD_ALTERNATIVE_CARRIER(Value: TJavaArray<Byte>);
- function _GetRTD_HANDOVER_CARRIER: TJavaArray<Byte>;
- procedure _SetRTD_HANDOVER_CARRIER(Value: TJavaArray<Byte>);
- function _GetRTD_HANDOVER_REQUEST: TJavaArray<Byte>;
- procedure _SetRTD_HANDOVER_REQUEST(Value: TJavaArray<Byte>);
- function _GetRTD_HANDOVER_SELECT: TJavaArray<Byte>;
- procedure _SetRTD_HANDOVER_SELECT(Value: TJavaArray<Byte>);
- function _GetRTD_SMART_POSTER: TJavaArray<Byte>;
- procedure _SetRTD_SMART_POSTER(Value: TJavaArray<Byte>);
- function _GetRTD_TEXT: TJavaArray<Byte>;
- procedure _SetRTD_TEXT(Value: TJavaArray<Byte>);
- function _GetRTD_URI: TJavaArray<Byte>;
- procedure _SetRTD_URI(Value: TJavaArray<Byte>);
- function _GetTNF_ABSOLUTE_URI:SmallInt;
- function _GetTNF_EMPTY:SmallInt;
- function _GetTNF_EXTERNAL_TYPE:SmallInt;
- function _GetTNF_MIME_MEDIA:SmallInt;
- function _GetTNF_UNCHANGED:SmallInt;
- function _GetTNF_UNKNOWN:SmallInt;
- function _GetTNF_WELL_KNOWN:SmallInt;
- { Methods }
- function init(tnf:SmallInt;&type: TJavaArray<Byte>; id: TJavaArray<Byte>; payload: TJavaArray<Byte>): JNdefRecord;cdecl;overload;
- function init(data: TJavaArray<Byte>): JNdefRecord;cdecl;overload; deprecated;
- function createApplicationRecord(packageName: JString): JNdefRecord;cdecl;
- function createExternal(domain: JString;&type: JString; data: TJavaArray<Byte>): JNdefRecord;cdecl;
- function createMime(mimeType: JString; mimeData: TJavaArray<Byte>): JNdefRecord;cdecl;
- function createUri(uriString: JString): JNdefRecord;cdecl;overload;
- function createUri(uri: Jnet_Uri): JNdefRecord;cdecl;overload;
- { Properties }
- property CREATOR: JParcelable_Creator read _GetCREATOR write _SetCREATOR;
- property RTD_ALTERNATIVE_CARRIER: TJavaArray<Byte> read _GetRTD_ALTERNATIVE_CARRIER write _SetRTD_ALTERNATIVE_CARRIER;
- property RTD_HANDOVER_CARRIER: TJavaArray<Byte> read _GetRTD_HANDOVER_CARRIER write _SetRTD_HANDOVER_CARRIER;
- property RTD_HANDOVER_REQUEST: TJavaArray<Byte> read _GetRTD_HANDOVER_REQUEST write _SetRTD_HANDOVER_REQUEST;
- property RTD_HANDOVER_SELECT: TJavaArray<Byte> read _GetRTD_HANDOVER_SELECT write _SetRTD_HANDOVER_SELECT;
- property RTD_SMART_POSTER: TJavaArray<Byte> read _GetRTD_SMART_POSTER write _SetRTD_SMART_POSTER;
- property RTD_TEXT: TJavaArray<Byte> read _GetRTD_TEXT write _SetRTD_TEXT;
- property RTD_URI: TJavaArray<Byte> read _GetRTD_URI write _SetRTD_URI;
- property TNF_ABSOLUTE_URI:SmallIntread _GetTNF_ABSOLUTE_URI;
- property TNF_EMPTY:SmallIntread _GetTNF_EMPTY;
- property TNF_EXTERNAL_TYPE:SmallIntread _GetTNF_EXTERNAL_TYPE;
- property TNF_MIME_MEDIA:SmallIntread _GetTNF_MIME_MEDIA;
- property TNF_UNCHANGED:SmallIntread _GetTNF_UNCHANGED;
- property TNF_UNKNOWN:SmallIntread _GetTNF_UNKNOWN;
- property TNF_WELL_KNOWN:SmallIntread _GetTNF_WELL_KNOWN;
- end;
- [JavaSignature('android/nfc/NdefRecord')]
- JNdefRecord =interface(JObject)
- ['{0E552F6E-B67C-4A19-9BD0-82864906025B}']
- { Methods }
- function describeContents:Integer;cdecl;
- function equals(obj: JObject):Boolean;cdecl;
- function getId: TJavaArray<Byte>;cdecl;
- function getPayload: TJavaArray<Byte>;cdecl;
- function getTnf:SmallInt;cdecl;
- function getType: TJavaArray<Byte>;cdecl;
- function hashCode:Integer;cdecl;
- function toByteArray: TJavaArray<Byte>;cdecl; deprecated;
- function toMimeType: JString;cdecl;
- function toString: JString;cdecl;
- function toUri: Jnet_Uri;cdecl;
- procedure writeToParcel(dest: JParcel; flags:Integer);cdecl;
- end;
- TJNdefRecord =class(TJavaGenericImport<JNdefRecordClass, JNdefRecord>)
- end;
- JNfcAdapter_CreateBeamUrisCallbackClass =interface(IJavaClass)
- ['{BFE6DE18-1854-4C2C-A523-6425F39AE21C}']
- end;
- [JavaSignature('android/nfc/NfcAdapter$CreateBeamUrisCallback')]
- JNfcAdapter_CreateBeamUrisCallback =interface(IJavaInstance)
- ['{609C5FF3-B699-4E05-AF60-567A0BBF0E01}']
- { Methods }
- function createBeamUris(Param0: JNfcEvent): TJavaObjectArray<Jnet_Uri>;cdecl;
- end;
- TJNfcAdapter_CreateBeamUrisCallback =class(TJavaGenericImport<JNfcAdapter_CreateBeamUrisCallbackClass, JNfcAdapter_CreateBeamUrisCallback>)
- end;
- JNfcAdapter_CreateNdefMessageCallbackClass =interface(IJavaClass)
- ['{51DBF0BD-EF76-40F6-9570-4CA6C447E19A}']
- end;
- [JavaSignature('android/nfc/NfcAdapter$CreateNdefMessageCallback')]
- JNfcAdapter_CreateNdefMessageCallback =interface(IJavaInstance)
- ['{A72FD9C9-8A67-499D-B3B0-10E8EC2D6139}']
- { Methods }
- function createNdefMessage(Param0: JNfcEvent): JNdefMessage;cdecl;
- end;
- TJNfcAdapter_CreateNdefMessageCallback =class(TJavaGenericImport<JNfcAdapter_CreateNdefMessageCallbackClass, JNfcAdapter_CreateNdefMessageCallback>)
- end;
- JNfcAdapter_OnNdefPushCompleteCallbackClass =interface(IJavaClass)
- ['{D859E3F0-641A-410A-9876-DD609FA72DAD}']
- end;
- [JavaSignature('android/nfc/NfcAdapter$OnNdefPushCompleteCallback')]
- JNfcAdapter_OnNdefPushCompleteCallback =interface(IJavaInstance)
- ['{01D93D7A-2E1E-4C87-ABE1-77EE7D98C77B}']
- { Methods }
- procedure onNdefPushComplete(Param0: JNfcEvent);cdecl;
- end;
- TJNfcAdapter_OnNdefPushCompleteCallback =class(TJavaGenericImport<JNfcAdapter_OnNdefPushCompleteCallbackClass, JNfcAdapter_OnNdefPushCompleteCallback>)
- end;
- JNfcAdapter_ReaderCallbackClass =interface(IJavaClass)
- ['{823E7F01-FCE8-43A5-96D4-57B348EDCDF2}']
- end;
- [JavaSignature('android/nfc/NfcAdapter$ReaderCallback')]
- JNfcAdapter_ReaderCallback =interface(IJavaInstance)
- ['{F7435248-FC54-4183-923D-BE74FF7E3D40}']
- { Methods }
- procedure onTagDiscovered(Param0: JTag);cdecl;
- end;
- TJNfcAdapter_ReaderCallback =class(TJavaGenericImport<JNfcAdapter_ReaderCallbackClass, JNfcAdapter_ReaderCallback>)
- end;
- JNfcAdapterClass =interface(JObjectClass)
- ['{16C97862-EAB8-4A85-A481-2DBF26084379}']
- { Property methods }
- function _GetACTION_ADAPTER_STATE_CHANGED: JString;
- function _GetACTION_NDEF_DISCOVERED: JString;
- function _GetACTION_TAG_DISCOVERED: JString;
- function _GetACTION_TECH_DISCOVERED: JString;
- function _GetEXTRA_ADAPTER_STATE: JString;
- function _GetEXTRA_ID: JString;
- function _GetEXTRA_NDEF_MESSAGES: JString;
- function _GetEXTRA_READER_PRESENCE_CHECK_DELAY: JString;
- function _GetEXTRA_TAG: JString;
- function _GetFLAG_READER_NFC_A:Integer;
- function _GetFLAG_READER_NFC_B:Integer;
- function _GetFLAG_READER_NFC_BARCODE:Integer;
- function _GetFLAG_READER_NFC_F:Integer;
- function _GetFLAG_READER_NFC_V:Integer;
- function _GetFLAG_READER_NO_PLATFORM_SOUNDS:Integer;
- function _GetFLAG_READER_SKIP_NDEF_CHECK:Integer;
- function _GetSTATE_OFF:Integer;
- function _GetSTATE_ON:Integer;
- function _GetSTATE_TURNING_OFF:Integer;
- function _GetSTATE_TURNING_ON:Integer;
- { Methods }
- function getDefaultAdapter(context: JContext): JNfcAdapter;cdecl;
- { Properties }
- property ACTION_ADAPTER_STATE_CHANGED: JString read _GetACTION_ADAPTER_STATE_CHANGED;
- property ACTION_NDEF_DISCOVERED: JString read _GetACTION_NDEF_DISCOVERED;
- property ACTION_TAG_DISCOVERED: JString read _GetACTION_TAG_DISCOVERED;
- property ACTION_TECH_DISCOVERED: JString read _GetACTION_TECH_DISCOVERED;
- property EXTRA_ADAPTER_STATE: JString read _GetEXTRA_ADAPTER_STATE;
- property EXTRA_ID: JString read _GetEXTRA_ID;
- property EXTRA_NDEF_MESSAGES: JString read _GetEXTRA_NDEF_MESSAGES;
- property EXTRA_READER_PRESENCE_CHECK_DELAY: JString read _GetEXTRA_READER_PRESENCE_CHECK_DELAY;
- property EXTRA_TAG: JString read _GetEXTRA_TAG;
- property FLAG_READER_NFC_A:Integerread _GetFLAG_READER_NFC_A;
- property FLAG_READER_NFC_B:Integerread _GetFLAG_READER_NFC_B;
- property FLAG_READER_NFC_BARCODE:Integerread _GetFLAG_READER_NFC_BARCODE;
- property FLAG_READER_NFC_F:Integerread _GetFLAG_READER_NFC_F;
- property FLAG_READER_NFC_V:Integerread _GetFLAG_READER_NFC_V;
- property FLAG_READER_NO_PLATFORM_SOUNDS:Integerread _GetFLAG_READER_NO_PLATFORM_SOUNDS;
- property FLAG_READER_SKIP_NDEF_CHECK:Integerread _GetFLAG_READER_SKIP_NDEF_CHECK;
- property STATE_OFF:Integerread _GetSTATE_OFF;
- property STATE_ON:Integerread _GetSTATE_ON;
- property STATE_TURNING_OFF:Integerread _GetSTATE_TURNING_OFF;
- property STATE_TURNING_ON:Integerread _GetSTATE_TURNING_ON;
- end;
- [JavaSignature('android/nfc/NfcAdapter')]
- JNfcAdapter =interface(JObject)
- ['{DADBBFEC-CED5-4E38-8BCD-A45F01CE3EFE}']
- { Methods }
- procedure disableForegroundDispatch(activity: JActivity);cdecl;
- procedure disableForegroundNdefPush(activity: JActivity);cdecl; deprecated;
- procedure disableReaderMode(activity: JActivity);cdecl;
- procedure enableForegroundDispatch(activity: JActivity; intent: JPendingIntent; filters: TJavaObjectArray<JIntentFilter>; techLists: TJavaObjectArray<JString>);cdecl;
- procedure enableForegroundNdefPush(activity: JActivity;&message: JNdefMessage);cdecl; deprecated;
- procedure enableReaderMode(activity: JActivity; callback: JNfcAdapter_ReaderCallback; flags:Integer; extras: JBundle);cdecl;
- function isEnabled:Boolean;cdecl;
- function isNdefPushEnabled:Boolean;cdecl;
- procedure setBeamPushUris(uris: TJavaObjectArray<Jnet_Uri>; activity: JActivity);cdecl;
- procedure setBeamPushUrisCallback(callback: JNfcAdapter_CreateBeamUrisCallback; activity: JActivity);cdecl;
- procedure setNdefPushMessage(&message: JNdefMessage; activity: JActivity; activities: TJavaObjectArray<JActivity>);cdecl;
- procedure setNdefPushMessageCallback(callback: JNfcAdapter_CreateNdefMessageCallback; activity: JActivity; activities: TJavaObjectArray<JActivity>);cdecl;
- procedure setOnNdefPushCompleteCallback(callback: JNfcAdapter_OnNdefPushCompleteCallback; activity: JActivity; activities: TJavaObjectArray<JActivity>);cdecl;
- end;
- TJNfcAdapter =class(TJavaGenericImport<JNfcAdapterClass, JNfcAdapter>)
- end;
- JNfcEventClass =interface(JObjectClass)
- ['{83B91408-3117-4EC6-AC92-6D62F859ADCF}']
- end;
- [JavaSignature('android/nfc/NfcEvent')]
- JNfcEvent =interface(JObject)
- ['{AB045C54-D04D-418B-921A-6D63C2F234A4}']
- { Property methods }
- function _GetnfcAdapter: JNfcAdapter;
- procedure _SetnfcAdapter(Value: JNfcAdapter);
- { Properties }
- property nfcAdapter: JNfcAdapter read _GetnfcAdapter write _SetnfcAdapter;
- end;
- TJNfcEvent =class(TJavaGenericImport<JNfcEventClass, JNfcEvent>)
- end;
- JNfcManagerClass =interface(JObjectClass)
- ['{7C17404C-DC8B-45BF-95F5-89BB7C8ACD7B}']
- end;
- [JavaSignature('android/nfc/NfcManager')]
- JNfcManager =interface(JObject)
- ['{CC1C67F6-DB7C-422E-AEED-8BE978E38F82}']
- { Methods }
- function getDefaultAdapter: JNfcAdapter;cdecl;
- end;
- TJNfcManager =class(TJavaGenericImport<JNfcManagerClass, JNfcManager>)
- end;
- JTagClass =interface(JObjectClass)
- ['{70D70482-9B7C-4FED-8F69-531F49E8F179}']
- { Property methods }
- function _GetCREATOR: JParcelable_Creator;
- procedure _SetCREATOR(Value: JParcelable_Creator);
- { Properties }
- property CREATOR: JParcelable_Creator read _GetCREATOR write _SetCREATOR;
- end;
- [JavaSignature('android/nfc/Tag')]
- JTag =interface(JObject)
- ['{F0137B87-18CA-4D88-A95B-0E02B5A8448C}']
- { Methods }
- function describeContents:Integer;cdecl;
- function getId: TJavaArray<Byte>;cdecl;
- function getTechList: TJavaObjectArray<JString>;cdecl;
- function toString: JString;cdecl;
- procedure writeToParcel(dest: JParcel; flags:Integer);cdecl;
- end;
- TJTag =class(TJavaGenericImport<JTagClass, JTag>)
- end;
- JTagLostExceptionClass =interface(JObjectClass)
- ['{1FFE5C44-ABD4-487B-9755-0F5250B7C1F5}']
- { Methods }
- function init: JTagLostException;cdecl;overload;
- function init(&message: JString): JTagLostException;cdecl;overload;
- end;
- [JavaSignature('android/nfc/TagLostException')]
- JTagLostException =interface(JObject)
- ['{FD51EE40-3222-4B5F-96E5-E03C32DF270C}']
- end;
- TJTagLostException =class(TJavaGenericImport<JTagLostExceptionClass, JTagLostException>)
- end;
- JBasicTagTechnologyClass =interface(JObjectClass)
- ['{EAB8AA93-40FD-4CD1-9D54-794094E3242E}']
- end;
- [JavaSignature('android/nfc/tech/BasicTagTechnology')]
- JBasicTagTechnology =interface(JObject)
- ['{783BBD0E-6377-4C10-9D11-0D6F496F9180}']
- { Methods }
- procedure close;cdecl;
- procedure connect;cdecl;
- function getTag: JTag;cdecl;
- function isConnected:Boolean;cdecl;
- end;
- TJBasicTagTechnology =class(TJavaGenericImport<JBasicTagTechnologyClass, JBasicTagTechnology>)
- end;
- JIsoDepClass =interface(JObjectClass)
- ['{CFC924FE-2D4A-49A6-AB30-BAF82FEBD2A6}']
- { Methods }
- function get(tag: JTag): JIsoDep;cdecl;
- end;
- [JavaSignature('android/nfc/tech/IsoDep')]
- JIsoDep =interface(JObject)
- ['{2DC3AA71-4565-4D17-99DA-9B82DB9FFD06}']
- { Methods }
- procedure close;cdecl;
- procedure connect;cdecl;
- function getHiLayerResponse: TJavaArray<Byte>;cdecl;
- function getHistoricalBytes: TJavaArray<Byte>;cdecl;
- function getMaxTransceiveLength:Integer;cdecl;
- function getTag: JTag;cdecl;
- function getTimeout:Integer;cdecl;
- function isConnected:Boolean;cdecl;
- function isExtendedLengthApduSupported:Boolean;cdecl;
- procedure setTimeout(timeout:Integer);cdecl;
- function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>;cdecl;
- end;
- TJIsoDep =class(TJavaGenericImport<JIsoDepClass, JIsoDep>)
- end;
- JMifareClassicClass =interface(JObjectClass)
- ['{354CDE1A-A65C-43A7-A03F-11614913B0EB}']
- { Property methods }
- function _GetBLOCK_SIZE:Integer;
- function _GetKEY_DEFAULT: TJavaArray<Byte>;
- procedure _SetKEY_DEFAULT(Value: TJavaArray<Byte>);
- function _GetKEY_MIFARE_APPLICATION_DIRECTORY: TJavaArray<Byte>;
- procedure _SetKEY_MIFARE_APPLICATION_DIRECTORY(Value: TJavaArray<Byte>);
- function _GetKEY_NFC_FORUM: TJavaArray<Byte>;
- procedure _SetKEY_NFC_FORUM(Value: TJavaArray<Byte>);
- function _GetSIZE_1K:Integer;
- function _GetSIZE_2K:Integer;
- function _GetSIZE_4K:Integer;
- function _GetSIZE_MINI:Integer;
- function _GetTYPE_CLASSIC:Integer;
- function _GetTYPE_PLUS:Integer;
- function _GetTYPE_PRO:Integer;
- function _GetTYPE_UNKNOWN:Integer;
- { Methods }
- function get(tag: JTag): JMifareClassic;cdecl;
- { Properties }
- property BLOCK_SIZE:Integerread _GetBLOCK_SIZE;
- property KEY_DEFAULT: TJavaArray<Byte> read _GetKEY_DEFAULT write _SetKEY_DEFAULT;
- property KEY_MIFARE_APPLICATION_DIRECTORY: TJavaArray<Byte> read _GetKEY_MIFARE_APPLICATION_DIRECTORY write _SetKEY_MIFARE_APPLICATION_DIRECTORY;
- property KEY_NFC_FORUM: TJavaArray<Byte> read _GetKEY_NFC_FORUM write _SetKEY_NFC_FORUM;
- property SIZE_1K:Integerread _GetSIZE_1K;
- property SIZE_2K:Integerread _GetSIZE_2K;
- property SIZE_4K:Integerread _GetSIZE_4K;
- property SIZE_MINI:Integerread _GetSIZE_MINI;
- property TYPE_CLASSIC:Integerread _GetTYPE_CLASSIC;
- property TYPE_PLUS:Integerread _GetTYPE_PLUS;
- property TYPE_PRO:Integerread _GetTYPE_PRO;
- property TYPE_UNKNOWN:Integerread _GetTYPE_UNKNOWN;
- end;
- [JavaSignature('android/nfc/tech/MifareClassic')]
- JMifareClassic =interface(JObject)
- ['{AB88587E-A31A-4797-BF79-F178123160E3}']
- { Methods }
- function authenticateSectorWithKeyA(sectorIndex:Integer; key: TJavaArray<Byte>):Boolean;cdecl;
- function authenticateSectorWithKeyB(sectorIndex:Integer; key: TJavaArray<Byte>):Boolean;cdecl;
- function blockToSector(blockIndex:Integer):Integer;cdecl;
- procedure close;cdecl;
- procedure connect;cdecl;
- procedure decrement(blockIndex:Integer; Value:Integer);cdecl;
- function getBlockCount:Integer;cdecl;
- function getBlockCountInSector(sectorIndex:Integer):Integer;cdecl;
- function getMaxTransceiveLength:Integer;cdecl;
- function getSectorCount:Integer;cdecl;
- function getSize:Integer;cdecl;
- function getTag: JTag;cdecl;
- function getTimeout:Integer;cdecl;
- function getType:Integer;cdecl;
- procedure increment(blockIndex:Integer; Value:Integer);cdecl;
- function isConnected:Boolean;cdecl;
- function readBlock(blockIndex:Integer): TJavaArray<Byte>;cdecl;
- procedure restore(blockIndex:Integer);cdecl;
- function sectorToBlock(sectorIndex:Integer):Integer;cdecl;
- procedure setTimeout(timeout:Integer);cdecl;
- function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>;cdecl;
- procedure transfer(blockIndex:Integer);cdecl;
- procedure writeBlock(blockIndex:Integer; data: TJavaArray<Byte>);cdecl;
- end;
- TJMifareClassic =class(TJavaGenericImport<JMifareClassicClass, JMifareClassic>)
- end;
- JMifareUltralightClass =interface(JObjectClass)
- ['{6677366A-EC35-4855-9D4A-29833A20930B}']
- { Property methods }
- function _GetPAGE_SIZE:Integer;
- function _GetTYPE_ULTRALIGHT:Integer;
- function _GetTYPE_ULTRALIGHT_C:Integer;
- function _GetTYPE_UNKNOWN:Integer;
- { Methods }
- function get(tag: JTag): JMifareUltralight;cdecl;
- { Properties }
- property PAGE_SIZE:Integerread _GetPAGE_SIZE;
- property TYPE_ULTRALIGHT:Integerread _GetTYPE_ULTRALIGHT;
- property TYPE_ULTRALIGHT_C:Integerread _GetTYPE_ULTRALIGHT_C;
- property TYPE_UNKNOWN:Integerread _GetTYPE_UNKNOWN;
- end;
- [JavaSignature('android/nfc/tech/MifareUltralight')]
- JMifareUltralight =interface(JObject)
- ['{25C8EEF0-D566-4014-8DF8-6FF039A88DEB}']
- { Methods }
- procedure close;cdecl;
- procedure connect;cdecl;
- function getMaxTransceiveLength:Integer;cdecl;
- function getTag: JTag;cdecl;
- function getTimeout:Integer;cdecl;
- function getType:Integer;cdecl;
- function isConnected:Boolean;cdecl;
- function readPages(pageOffset:Integer): TJavaArray<Byte>;cdecl;
- procedure setTimeout(timeout:Integer);cdecl;
- function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>;cdecl;
- procedure writePage(pageOffset:Integer; data: TJavaArray<Byte>);cdecl;
- end;
- TJMifareUltralight =class(TJavaGenericImport<JMifareUltralightClass, JMifareUltralight>)
- end;
- JNdefClass =interface(JObjectClass)
- ['{952E5F09-C924-419A-AEA0-802C8F4B018C}']
- { Property methods }
- function _GetMIFARE_CLASSIC: JString;
- function _GetNFC_FORUM_TYPE_1: JString;
- function _GetNFC_FORUM_TYPE_2: JString;
- function _GetNFC_FORUM_TYPE_3: JString;
- function _GetNFC_FORUM_TYPE_4: JString;
- { Methods }
- function get(tag: JTag): JNdef;cdecl;
- { Properties }
- property MIFARE_CLASSIC: JString read _GetMIFARE_CLASSIC;
- property NFC_FORUM_TYPE_1: JString read _GetNFC_FORUM_TYPE_1;
- property NFC_FORUM_TYPE_2: JString read _GetNFC_FORUM_TYPE_2;
- property NFC_FORUM_TYPE_3: JString read _GetNFC_FORUM_TYPE_3;
- property NFC_FORUM_TYPE_4: JString read _GetNFC_FORUM_TYPE_4;
- end;
- [JavaSignature('android/nfc/tech/Ndef')]
- JNdef =interface(JObject)
- ['{07CB3172-9D1B-48BE-A9A6-01884C306109}']
- { Methods }
- function canMakeReadOnly:Boolean;cdecl;
- procedure close;cdecl;
- procedure connect;cdecl;
- function getCachedNdefMessage: JNdefMessage;cdecl;
- function getMaxSize:Integer;cdecl;
- function getNdefMessage: JNdefMessage;cdecl;
- function getTag: JTag;cdecl;
- function getType: JString;cdecl;
- function isConnected:Boolean;cdecl;
- function isWritable:Boolean;cdecl;
- function makeReadOnly:Boolean;cdecl;
- procedure writeNdefMessage(msg: JNdefMessage);cdecl;
- end;
- TJNdef =class(TJavaGenericImport<JNdefClass, JNdef>)
- end;
- JNdefFormatableClass =interface(JObjectClass)
- ['{FD2507AE-8201-4056-9603-01834A2E375D}']
- { Methods }
- function get(tag: JTag): JNdefFormatable;cdecl;
- end;
- [JavaSignature('android/nfc/tech/NdefFormatable')]
- JNdefFormatable =interface(JObject)
- ['{08C293E6-9130-457A-BE7D-0EFCCB5AB8AF}']
- { Methods }
- procedure close;cdecl;
- procedure connect;cdecl;
- procedureformat(firstMessage: JNdefMessage);cdecl;
- procedure formatReadOnly(firstMessage: JNdefMessage);cdecl;
- function getTag: JTag;cdecl;
- function isConnected:Boolean;cdecl;
- end;
- TJNdefFormatable =class(TJavaGenericImport<JNdefFormatableClass, JNdefFormatable>)
- end;
- JNfcAClass =interface(JObjectClass)
- ['{C7CC1347-7CCB-4ED5-9A2C-1D82FA20AD1B}']
- { Methods }
- function get(tag: JTag): JNfcA;cdecl;
- end;
- [JavaSignature('android/nfc/tech/NfcA')]
- JNfcA =interface(JObject)
- ['{6EAD7DA0-95A6-4230-B33E-FDDF98D80ACD}']
- { Methods }
- procedure close;cdecl;
- procedure connect;cdecl;
- function getAtqa: TJavaArray<Byte>;cdecl;
- function getMaxTransceiveLength:Integer;cdecl;
- function getSak:SmallInt;cdecl;
- function getTag: JTag;cdecl;
- function getTimeout:Integer;cdecl;
- function isConnected:Boolean;cdecl;
- procedure setTimeout(timeout:Integer);cdecl;
- function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>;cdecl;
- end;
- TJNfcA =class(TJavaGenericImport<JNfcAClass, JNfcA>)
- end;
- JNfcBClass =interface(JObjectClass)
- ['{3AA0A259-27DC-4442-BA25-B5C44DE8FC1D}']
- { Methods }
- function get(tag: JTag): JNfcB;cdecl;
- end;
- [JavaSignature('android/nfc/tech/NfcB')]
- JNfcB =interface(JObject)
- ['{ECEFD061-2CE5-4B51-AC25-C98A28C79FB5}']
- { Methods }
- procedure close;cdecl;
- procedure connect;cdecl;
- function getApplicationData: TJavaArray<Byte>;cdecl;
- function getMaxTransceiveLength:Integer;cdecl;
- function getProtocolInfo: TJavaArray<Byte>;cdecl;
- function getTag: JTag;cdecl;
- function isConnected:Boolean;cdecl;
- function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>;cdecl;
- end;
- TJNfcB =class(TJavaGenericImport<JNfcBClass, JNfcB>)
- end;
- JNfcBarcodeClass =interface(JObjectClass)
- ['{969DCC14-1526-486B-A41B-3E7DC426DB36}']
- { Property methods }
- function _GetTYPE_KOVIO:Integer;
- function _GetTYPE_UNKNOWN:Integer;
- { Methods }
- function get(tag: JTag): JNfcBarcode;cdecl;
- { Properties }
- property TYPE_KOVIO:Integerread _GetTYPE_KOVIO;
- property TYPE_UNKNOWN:Integerread _GetTYPE_UNKNOWN;
- end;
- [JavaSignature('android/nfc/tech/NfcBarcode')]
- JNfcBarcode =interface(JObject)
- ['{0E0D7BC3-EE8B-4E84-A497-E42FEE88A6F4}']
- { Methods }
- procedure close;cdecl;
- procedure connect;cdecl;
- function getBarcode: TJavaArray<Byte>;cdecl;
- function getTag: JTag;cdecl;
- function getType:Integer;cdecl;
- function isConnected:Boolean;cdecl;
- end;
- TJNfcBarcode =class(TJavaGenericImport<JNfcBarcodeClass, JNfcBarcode>)
- end;
- JNfcFClass =interface(JObjectClass)
- ['{A61ADBBC-6687-442F-9005-48CFBAA1D3BF}']
- { Methods }
- function get(tag: JTag): JNfcF;cdecl;
- end;
- [JavaSignature('android/nfc/tech/NfcF')]
- JNfcF =interface(JObject)
- ['{76433696-EF45-4D38-A3C2-15C5B9D6817D}']
- { Methods }
- procedure close;cdecl;
- procedure connect;cdecl;
- function getManufacturer: TJavaArray<Byte>;cdecl;
- function getMaxTransceiveLength:Integer;cdecl;
- function getSystemCode: TJavaArray<Byte>;cdecl;
- function getTag: JTag;cdecl;
- function getTimeout:Integer;cdecl;
- function isConnected:Boolean;cdecl;
- procedure setTimeout(timeout:Integer);cdecl;
- function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>;cdecl;
- end;
- TJNfcF =class(TJavaGenericImport<JNfcFClass, JNfcF>)
- end;
- JNfcVClass =interface(JObjectClass)
- ['{30E78EF3-BA54-43EA-A30B-E7DB2F13F635}']
- { Methods }
- function get(tag: JTag): JNfcV;cdecl;
- end;
- [JavaSignature('android/nfc/tech/NfcV')]
- JNfcV =interface(JObject)
- ['{79448CB5-93BC-49D4-8424-B1CEE62FA71F}']
- { Methods }
- procedure close;cdecl;
- procedure connect;cdecl;
- function getDsfId:Byte;cdecl;
- function getMaxTransceiveLength:Integer;cdecl;
- function getResponseFlags:Byte;cdecl;
- function getTag: JTag;cdecl;
- function isConnected:Boolean;cdecl;
- function transceive(data: TJavaArray<Byte>): TJavaArray<Byte>;cdecl;
- end;
- TJNfcV =class(TJavaGenericImport<JNfcVClass, JNfcV>)
- end;
- JTagTechnologyClass =interface(IJavaClass)
- ['{3C1A028A-02C0-4AEC-9EAC-5CFA949C5ACF}']
- end;
- [JavaSignature('android/nfc/tech/TagTechnology')]
- JTagTechnology =interface(IJavaInstance)
- ['{C191C90F-0D45-468B-8DFC-463313DFA51D}']
- { Methods }
- procedure close;cdecl;
- procedure connect;cdecl;
- function getTag: JTag;cdecl;
- function isConnected:Boolean;cdecl;
- end;
- TJTagTechnology =class(TJavaGenericImport<JTagTechnologyClass, JTagTechnology>)
- end;
- const
- TJCardEmulation_ACTION_CHANGE_DEFAULT ='android.nfc.cardemulation.action.ACTION_CHANGE_DEFAULT';
- TJCardEmulation_CATEGORY_OTHER ='other';
- TJCardEmulation_CATEGORY_PAYMENT ='payment';
- TJCardEmulation_EXTRA_CATEGORY ='category';
- TJCardEmulation_EXTRA_SERVICE_COMPONENT ='component';
- TJCardEmulation_SELECTION_MODE_ALWAYS_ASK =1;
- TJCardEmulation_SELECTION_MODE_ASK_IF_CONFLICT =2;
- TJCardEmulation_SELECTION_MODE_PREFER_DEFAULT =0;
- TJHostApduService_DEACTIVATION_DESELECTED =1;
- TJHostApduService_DEACTIVATION_LINK_LOSS =0;
- TJHostApduService_SERVICE_INTERFACE ='android.nfc.cardemulation.action.HOST_APDU_SERVICE';
- TJHostApduService_SERVICE_META_DATA ='android.nfc.cardemulation.host_apdu_service';
- TJOffHostApduService_SERVICE_INTERFACE ='android.nfc.cardemulation.action.OFF_HOST_APDU_SERVICE';
- TJOffHostApduService_SERVICE_META_DATA ='android.nfc.cardemulation.off_host_apdu_service';
- TJNdefRecord_TNF_ABSOLUTE_URI =3;
- TJNdefRecord_TNF_EMPTY =0;
- TJNdefRecord_TNF_EXTERNAL_TYPE =4;
- TJNdefRecord_TNF_MIME_MEDIA =2;
- TJNdefRecord_TNF_UNCHANGED =6;
- TJNdefRecord_TNF_UNKNOWN =5;
- TJNdefRecord_TNF_WELL_KNOWN =1;
- TJNfcAdapter_ACTION_ADAPTER_STATE_CHANGED ='android.nfc.action.ADAPTER_STATE_CHANGED';
- TJNfcAdapter_ACTION_NDEF_DISCOVERED ='android.nfc.action.NDEF_DISCOVERED';
- TJNfcAdapter_ACTION_TAG_DISCOVERED ='android.nfc.action.TAG_DISCOVERED';
- TJNfcAdapter_ACTION_TECH_DISCOVERED ='android.nfc.action.TECH_DISCOVERED';
- TJNfcAdapter_EXTRA_ADAPTER_STATE ='android.nfc.extra.ADAPTER_STATE';
- TJNfcAdapter_EXTRA_ID ='android.nfc.extra.ID';
- TJNfcAdapter_EXTRA_NDEF_MESSAGES ='android.nfc.extra.NDEF_MESSAGES';
- TJNfcAdapter_EXTRA_READER_PRESENCE_CHECK_DELAY ='presence';
- TJNfcAdapter_EXTRA_TAG ='android.nfc.extra.TAG';
- TJNfcAdapter_FLAG_READER_NFC_A =1;
- TJNfcAdapter_FLAG_READER_NFC_B =2;
- TJNfcAdapter_FLAG_READER_NFC_BARCODE =16;
- TJNfcAdapter_FLAG_READER_NFC_F =4;
- TJNfcAdapter_FLAG_READER_NFC_V =8;
- TJNfcAdapter_FLAG_READER_NO_PLATFORM_SOUNDS =256;
- TJNfcAdapter_FLAG_READER_SKIP_NDEF_CHECK =128;
- TJNfcAdapter_STATE_OFF =1;
- TJNfcAdapter_STATE_ON =3;
- TJNfcAdapter_STATE_TURNING_OFF =4;
- TJNfcAdapter_STATE_TURNING_ON =2;
- TJMifareClassic_BLOCK_SIZE =16;
- TJMifareClassic_SIZE_1K =1024;
- TJMifareClassic_SIZE_2K =2048;
- TJMifareClassic_SIZE_4K =4096;
- TJMifareClassic_SIZE_MINI =320;
- TJMifareClassic_TYPE_CLASSIC =0;
- TJMifareClassic_TYPE_PLUS =1;
- TJMifareClassic_TYPE_PRO =2;
- TJMifareClassic_TYPE_UNKNOWN =-1;
- TJMifareUltralight_PAGE_SIZE =4;
- TJMifareUltralight_TYPE_ULTRALIGHT =1;
- TJMifareUltralight_TYPE_ULTRALIGHT_C =2;
- TJMifareUltralight_TYPE_UNKNOWN =-1;
- TJNdef_MIFARE_CLASSIC ='com.nxp.ndef.mifareclassic';
- TJNdef_NFC_FORUM_TYPE_1 ='org.nfcforum.ndef.type1';
- TJNdef_NFC_FORUM_TYPE_2 ='org.nfcforum.ndef.type2';
- TJNdef_NFC_FORUM_TYPE_3 ='org.nfcforum.ndef.type3';
- TJNdef_NFC_FORUM_TYPE_4 ='org.nfcforum.ndef.type4';
- TJNfcBarcode_TYPE_KOVIO =1;
- TJNfcBarcode_TYPE_UNKNOWN =-1;
- implementation
- end.