PcmDump - Android application
Who needs it :
Developers that are suffering from absence of rooted device but want to
1) check their code is working properly by reading input file - >
processing it -> write result to output file (typical tsk for
audio or image processing).
2) confirm that compiled native shared library *.so file is properly
working by using same procedure as above ( reading input file - >
processing it -> write result to output file)
Why it is needed :
Because Android system prohibits:
- direct run from file system executables compiled and uploaded using adb
- writing files to filesystem without special permission
Which project to download :
1) If you need to run your code only (without compiling to separate
shared *.so library) - download PcmDumpLib1.zip. Your code will be
compiled as one *.so library and attached to java code app.
2) If you need to verify your compiled shared *.so library -
download PcmDumpLib2.zip project and PcmDump_proclib.zip example
(showing how to compile your *.so lib)
How it is organized :
PcmDumpLib1 organized in classic way - libnativeprocessing.so includes
all your code and additional file that takes execution orders from Java
PcmDumpLib2 organized in a little bit more complex way - libmonomix.so
(example of audio "stereo->mono" mixing) is called by
libnativeprocessing.so that takes execution orders from Java
How to run :
PcmDumpLib1 project :
1) include to Android.mk all you native code files and
compile libnativeprocessing.so library using "ndk-build" command.
Note: you may remove non-used platform names from Application.mk
file (or add another one)
2) copy all libraries to the "src/Jnilibs" folder (preserving directory structure)
3) compile and run android project in Android Studio
4) After starting supported ABI's are indicated and if there was no
"in.pcm" file is detected prompt for uploading will be displayed.
5) Upload input file "in.pcm" to
"PcmDump_files" directory created in the file system. Note : use hint that
says that you have to use "adb push..."
6) Press "Start button". If all processing finished correctly - app will return message with "Result code : 1 (success)"
7) Dowload your resulting file from "PcmDump_files" directory. See hint message "adb pull ..."
PcmDumpLib2 project :
1) compile your own *.so file and place it to jni directory
2) modify Android.mk file by replacing monomix library name by name of your library.
- Other procedures are same as for PcmDumpLib1 project.