Main Content


Receive data from Android app


Simulink Support Package for Android Devices / Advanced

  • FromApp block


Receive data from a method in an Android app. The method must exist in the default activity.

Choose the Method name from an Android app. Set the Data type and Data size parameters to the return values of the method.

For example, suppose that the method:

  • Is public int[] FromAppFcn().

  • Sends three data elements each time it runs.

  • The data type of those data elements is int32.

Then, set:

  • Method name to FromAppFcn

  • Data size to 3

  • Data type to int32

The method in the Android app must send a data type that this block can accept.


During simulations without hardware, this block outputs zeros. See Block Produces Zeros or Does Nothing in Simulation.


Method name

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

Data type

The data type of the data returned by the method.

Data size (N)

The number of data elements the method returns to the block each time it runs.

Sample time

Specify how often the block reads the function.

Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns.

Version History

Introduced in R2014a