Trying to run an executable .so file with cordova in the background. I have a "lib" folder which contains the folders "arm64-v8a", "ameabi-v7a" and "x86_64" These three folders contain the executable .so file for the matching archetecture (arm etc.)
How would I package them into the cordova app? Can I simply put the "lib" directory into the "www" directory of the cordova app? Then build it and then copy it to a place from where I could execute it in android? What is such a place / folder and how would I do it? Then how would I run it in the background and stop it when the cordova app is full closed?
Putting the files in the www folder will do nothing, you should put the files in the native project, in the proper folder, but that's not really recommended in Cordova apps, you should create a plugin that copies and uses the files.
The plugin should have a plugin.xml
file that copies the .so
files to the native project, something like:
<platform name="android">
<source-file src="libs/arm64-v8a/yourlibrary.so" target-dir="src/main/jniLibs/arm64-v8a/" />
<source-file src="libs/armeabi-v7a/yourlibrary.so" target-dir="src/main/jniLibs/armeabi-v7a/" />
<source-file src="libs/x86_64/yourlibrary.so" target-dir="src/main/jniLibs/x86_64/" />
</platform>