Main Content


Send data to Android app


Simulink Support Package for Android Devices / Advanced

  • ToApp block


Send data to a specified method in the Android app. The method must exist in the default activity.

For example, suppose the following:

  • The block input is int32(ones(3,1))

  • The method name is ToAppFcn

Then, the expected method in the Android app would be:

public void ToAppFcn(int[] inData)
Where inData is an integer array of three elements.

The ToApp block input accepts the following data types: uint8, int8, uint16, int16, uint32, int32, single, and double.


Method name

Specify the name of a method in the Android app. You must add the method to the default Activity by modifying the generated app.

Number of arguments

Select the number of arguments for the method in the Android app. The selected number of arguments are added as input ports to the block.

The default value is 1 and the maximum value supported is 5.

Version History

Introduced in R2014a