Send data to method of app
Simulink Support Package for Android Devices / Advanced
Use the ToApp block to send data to a specified method in the Android™ app. The method must exist in the default activity. For example, suppose the
block input is
int32(ones(3,1)) and the method name is
ToAppFcn. Then, the expected method in the Android app would
public void ToAppFcn(int inData)
inDatais an integer array of three elements.
During simulation with no hardware connected, this block does nothing. For more information, see Block Produces Zeros or Does Nothing in Simulation.
Port_1 — Data to send to a method
argn where n is the number of
The block inputs data to send to a method in an Android app. This data is received as input by the method specified in the
Method name parameter. The number of input ports to
the block depend on the number of input arguments. For example, if you set Number of arguments parameter to
2, you can pass
arg2 as input arguments to a method in the Android app.
Method name — Name of method in Android app
ToAppMethod (default) | character vector
Enter the name of method in the Android app.
Number of arguments — Number of arguments for method
1 (default) |
Select the number of arguments for the method in the Android app. The number of argument that you select are added as input ports to the block.
Introduced in R2014a