What exactly is method in "Receive data from a method in an Android app." ?

Hello all !
I have been trying to understand how to let my android application made in Simulink communicate with a device connected to my android phone via an USB-OTG.
I notice there are two blocks called "FromAppMethod" and "ToAppMethod"
These 2 links are the links describing their functions.
However, i am unable to understand what is meant by
  • a method in an android app?
  • the method must exist in the default activity ?
Does this mean that this is trying to read and send data to another application running at the same time ?
From what i understand is that, the applications created by Simulink cannot be run simultaeneously on an Android device. Simply minimising the application will require you to restart the application.
Best regards all.
Thank you !

 採用された回答

Sruthi Yenugula
Sruthi Yenugula 2019 年 6 月 18 日

1 投票

HI,
Check this examples
Using FromApp block, you can add a method in the Generated Application(through Simulink) by importing it to Android Studio, in that method you can add your custom android code and build it in Android Studio. Acts as Custom input block.
Using ToApp block, you can add a method in the Generated Application(through Simulink) by importing it to Android Studio, in that method you can add your custom android code and build it in Android Studio. Acts as Custom output block.

3 件のコメント

Kiat Nern Yeo
Kiat Nern Yeo 2019 年 6 月 18 日
Hi Sir
I would like to clarify some questions i have about the example block diagrams.
I notice that the inputs are mux into one single output that leads to the ToApp block for android.
Does this mean that the ToApp block produces a Nx1 array of values ?
So for example in the image attached, what comes out looks like
( X
Y
Z )
Sruthi Yenugula
Sruthi Yenugula 2019 年 6 月 19 日
Does this mean that the ToApp block produces a Nx1 array of values ?
For ToApp block we are giving Nx1 array as input.
Kiat Nern Yeo
Kiat Nern Yeo 2019 年 6 月 19 日
Ok i understand. Thanks !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by