android - Aidl result via callback -


i have written application records audio signal. signal has processed plug-in installed on device. communication between main application , plug-in, use aidl interface.

as new interfaces, wonder if following work plug-in return result main application:

i created interface:

public interface mainappcallback {     public void onresult(string result); } 

i implement in recording thread:

mainappcallback callback = new mainappcallback() {     @override     public void onresult(string result) {         // add result member variable of recording thread     } }; 

in aidl interface, defined methods plug-in:

/** callback send results main application */ void registercallback(mainappcallback callback);  /** code documentation enough */ void unregistercallback(); 

i want in recording thread:

plugin.registercallback(callback); 

is correct way go, or doing wrong here?

that correct. make sure have defined aidl file callback interface too.

here answer here has example of 2 aidl files need have callbacks : android remote service callbacks

there complete sample code here: https://developer.android.com/guide/components/aidl.html


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -