Allow background task for android deployed app

1 visualización (últimos 30 días)
Fabrizio Sera
Fabrizio Sera el 14 de Mayo de 2020
Respondida: Sutanu Maiti el 22 de Mayo de 2020
Hi everybody, I'm Fabrizio from Italy.
I'm trying to develop an application for Android using the Simulink Support Package.
The application read and log the sensors and thanks the block AHRS of the sensor fusion toolbox return a NED frame and plot the accelretion in this frame on the screen. I future I need to add other features to this.
THE PROBLEM is that when i block the screen or if i Exit the application (no closing it) the application stops to reed sensors and the application is unsufull.
How can I allowed backgroung workint (or multitasking ability) to my deployed Simulink scheme?

Respuestas (1)

Sutanu Maiti
Sutanu Maiti el 22 de Mayo de 2020
Once generated app code is exported to Android Studio, you can add/modify the java/xml code (in Android Studio) and run on device (from Android Studio). It will run the Simulink generated Algorithm also under the hood. If you investigate more into main activity class code, you may find the real-time code is being started and stopped from activity's life cycle methods. You can play around there and make it working eveen when app goes to background.


Más información sobre Modeling en Help Center y File Exchange.


Community Treasure Hunt

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

Start Hunting!

Translated by