I am currently developing two independent projects: an Android project and a pure Java module project. I intend to import the Java module into the Android project as a jar file. I want the jar file to retrieve a specific file path within the Android project on its own when the void test() function is executed without any parameters.
Is this possible?
Jar file location: app/src/main/assets/test.jar
Target file location : app/src/main/assets/target.jar
App main file location: app/src/main/java/myapp/MainActivity.kt
I tried using the code test.getProtectionDomain().getCodeSource().getLocation() based on many resources, but the value is null and it does not work.
정한호 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.