Developer documentation - BA17-loma-1/Audio_Signal_Processing_Toolbox GitHub Wiki
How to change the project language level in Android Studio
In order to use the new Java 8 language features, the Jack toolchain is needed. Enter the following in the module-level build.gradle file:
android {
defaultConfig {
...
jackOptions {
enable true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Static code analysis
We use FindBugs to identify bad practice, dodgy code, vulnerabilities and potential performance issues. Installation is done easily as a plugin in Android Studio.
FindBugs for Gradle API doc: Gradle FindBugs
Further information: SCA with FindBugs
Jack compiler
Jack is the new Android toolchain for building. However, it fails to build our project with the dependency org.apache.commons.math3. Since Java language level 1.8 is not supported in API 19, we can build without Jack. To fix this delete jackOptions and compileOptions in your module-level build.gradle file.
External SD card in Android Virtual Device (emulator)
You can create a FAT32 disk image with the mksdcard tool and load it in the emulator. First create a new SD card image:
mksdcard -l mySDCard 1024M SDCardFile.img
Next mount the SD card disk image:
sudo mkdir /media/sdcard
sudo mount -o loop SDCardFile.img /media/sdcard
Now you can add some content to the SD card disk image.
When you are done unmount the image:
sudo umount /media/sdcard
Now open the Virtual Device Configuration of your emulator in Android Studio and click on "Show Advances Settings". Select "External file" and specify the path to your SD card disk image file. Finish the device configuration.
Next, in the Android Virtual Device Manager click on the down arrow of your device and select "Show on disk". Open config.ini and set the line:
sdcard.path=PATH_TO_YOUR_SDCARD_IMAGE
Open hardware-qemu.ini and set the lines:
hw.sdCard=yes
hw.sdCard.path=PATH_TO_YOUR_SDCARD_IMAGE