Can someone help me in connecting Matlab with Android Studio and Mysql?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, i need to connect an application that I've created in Android Studio with a code on Matlab. Basically, the user writes some values in the Android application that need to be given in input to the Matlab code, then this code receives the input and gives as output a value that should be displayed on the Android application. I'm using also a Mysql database (on the same pc where i have the codes with Matlab) to store values and to store the different users (every user has a customized code to be used) and I've already made the connection between this one and the Android application. By the way, I can't implement the Matlab code on the Android application, because this code it's customized according to the user that is using the App, so it would be useless to change everytime the application, instead it's better to do this on the main pc. So, i was thinking about making a connection between them using the server.
Making a recap: i would like to send values from Android Studio to a database in MySql, then to send these exact values to the code in Matlab (the code to be used need to be chosen accordingly to the user, in fact there's a table that connect the users with their ID code (the user gives this value in the app) and the specific Matlab code that needs to be used). Then, the results of the code should be sent to the MySql database and then be displayed on the application of the user.
Thank you in advance.
1 Kommentar
Mohammad Sami
am 2 Jul. 2021
I would suggest you do not directly interface to mysql. You can use a full web development stack for example Apache + PHP + MySQL. You can write your REST API in PHP. then both Matlab and Android App will call this REST API to read / write the values.
You can also use any other web development stack you are familiar with to write your REST API.
Antworten (1)
Sutanu Maiti
am 5 Aug. 2021
Bearbeitet: Sutanu Maiti
am 5 Aug. 2021
You can use Simulink support package for Android Devices to implement the logic along with user input and displaying out in a Simulink model. And then that model can be deployed as a stand alone executable app. Android support package generates, code that can be imported into android studio and then you may add MySql to it. Please follow below example to Import Project to Google Android Studio.
You can also deploy MATLAB function. PLease follow Detect Boundaries of Objects Within Video Using MATLAB Function Block on Android Device example to do so.
Enhanced Color Replacement with Customized Code example explains how to use FromApp and ToApp blocks to integrate custom Java method in Activity with generated C code.
Hope this helps..
0 Kommentare
Siehe auch
Kategorien
Mehr zu Setup and Configuration finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!