I am developing a project for Android, I use Delphi and at the same time I want to use libraries written in Java. Specifically, I'm interested in the TJAudioRecord class. I manage to call methods of classes defined in the Java library, but I can't figure out how to intercept events. How to describe in your code in Delphi and how to register listeners implementing interfaces described in these libraries? In Java, the listener I need looks like this:

public OnRecordPositionUpdateListener mListener = new OnRecordPositionUpdateListener() { public void onPeriodicNotification(AudioRecord recorder) { // мой код } public void onMarkerReached(AudioRecord recorder) { // мой код } }; 

How to write the title of the corresponding listener and his methods on Delphi and how to register such a listener so that he can receive events?

  • I do not understand ... you can spend a couple of hundred characters and explain what you want? - Barmaley
  • @Barmaley Man, apparently, wants to use Java-libraries in the project, which he does on the Delphi for android. If this my guess is correct, then the question (inho) has the right to exist, only the title needs to be changed. - m. vokhm
  • You can, for example, look at aziga.x10.mx/delphi/… - m in this direction . vokhm
  • @ m. Vokhm, you are right, I use Java-libraries (unit Androidapi.JNI.Media; class TJAudioRecord) in a project on a delphi for android. I looked aziga ...., - Joro
  • @ m. Vokhm, you are right, I use Java-libraries (unit Androidapi.JNI.Media; class TJAudioRecord) in a project on a delphi for android. functions in my project works, but I cannot figure it out. The code on the top of C does what I need, it creates a two-part event. I do not know how it will be at Delphi? I looked at the aziga ...., it is not very simple, except to start from scratch. - Joro

0