C++学习(四三五)android获取so安装路径
Posted hankern
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C++学习(四三五)android获取so安装路径相关的知识,希望对你有一定的参考价值。
ClassLoader loader = getClassLoader();
try
Method library=ClassLoader.class.getDeclaredMethod("findLibrary", String.class);
String libHiAccount=(String)library.invoke(loader,"libosgEarth.so");
libHiAccount=(String)library.invoke(loader,"libosgEarth");
libHiAccount=(String)library.invoke(loader,"osgEarth.so");
libHiAccount=(String)library.invoke(loader,"osgEarth");
libHiAccount=(String)library.invoke(loader,"libosgNativeLib.so");
libHiAccount=(String)library.invoke(loader,"osgNativeLib.so");
libHiAccount=(String)library.invoke(loader,"libosgNativeLib");
libHiAccount=(String)library.invoke(loader,"osgNativeLib");
System.out.println("Library Found: " + libHiAccount);
catch (Exception e)
注意:包名中不要有lib和.so
返回值为:
/data/app/com.example.testnativecplusplus-wQ6DdcVPGONrg4sObfZGSw==/lib/arm64/libosgEarth.so
/data/app/com.example.testnativecplusplus-wQ6DdcVPGONrg4sObfZGSw==/lib/arm64/libosgNativeLib.so
以上是关于C++学习(四三五)android获取so安装路径的主要内容,如果未能解决你的问题,请参考以下文章