The attached image shows the error i get when I push on the button "Deploy to Hardware" from the Simulink toolbar. Do you have any advice or tips?
MATLAB: I get an error when i try to deploy an app on Android device. The error says “Use a folder name that does not contain spaces”
hardwareMATLAB and Simulink Student Suitesimulink
Related Solutions
Hi Harshvardhan, Please change the folder "D:\Android\Android Studio" name to "D:\Android\Android_Studio". Try the Hardware Setup again after changing. Make sure you give the changed Android Studio folder name in the first screen of Hardware Setup.
GPS updates are conditioned on the following distance and time thresholds.
1) MIN_DISTANCE_CHANGE_FOR_UPDATES - The minimum distance between updates. This value is set to 10 meters.
2) MIN_TIME_BW_UPDATES - the minimum time between updates. This value is set to 1 minute.
The GPS location will update when the change in distance at least minDistance is observed _and _a duration of minTime has passed. These values can be changed after the app has been generated. They can't be set in Simulink. See the following page for more information.
First, deploy the model to hardware in Simulink. Once this is complete, you need to edit the app's source code in Android Studio.
Follow steps 1 through 10 given on the following page.
CAUTION: The documentation asks not to update Gradle because the Simulink Support Package for Android Devices requires specific versions of Gradle and SDK tools to guarantee the supported features.
I found that Android Studio required an updated version of Gradle in order to build the app. The version that shipped with the hardware support package was no longer supported. To fix this, I went to the following link and and downloaded v3.3.
This will download a folder named "gradle-3.3-all". Go into this folder and copy the directory "gradle-3.3".
There should be a folder named "gradle-android.instrset" on your MATLAB path. Copy the "gradle-3.3" folder into this directory. On my machine, this directory is located at C:\ProgramData\MATLAB\SupportPackages\R2016b\3P.instrset\gradle-android.instrset.
Next, continue to step 11 on the "Import Project into Google Android Studio" instructions. After pasting the Gradle directory into Android Studio, edit the Gradle path so that it points to the directory that you just copied. The end of the path in the "Gradle home" field should now read ".../gradle-android.instrset/gradle-3.3".
Now edit the GPS update parameters. Select the "Project" tab on the left hand side of the Android Studio window. Navigate to <app name> -> java -> com.example.<app name> -> GPSHandler. Double-click on GPSHandler.
Set the time and distance thresholds MIN_DISTANCE_CHANGE_FOR_UPDATES and MIN_TIME_BW_UPDATES to the desired values.
Complete steps 12 through 18 to deploy the modified app.
Best Answer