Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Click “OK” to finalise the operation.

 

Usage

 

Using Agnoid package is quite easy and straightforward. After having added the agnoid module to the project as described above:

 

Import necessary packages/classes:

Code Block
import com.amadis.agnoid.Dev;                                                   
import com.amadis.agnoid.DevListener;                                           
import com.amadis.agnoid.Rpc; 

 

Set your main class/activity to implement DevListener:

Code Block
languagejava
public class MainActivity implements DevListener

 

Create and start Dev:

Code Block
this.dev = new Dev(this, this, this);          
                                        
(new Thread(this.dev)).start(); 

 

Override the required functions:

Code Block
languagejava
@Override                                                                   
public void handleDevEvent(byte[] data) {                              
    ...                                                            
}   

@Override                                                                   
public byte[] handleDevRequest(byte[] data) {                              
    ...                                                            
}