Use two versions of the same native library

閲覧: 40 回
最初の未読メッセージにスキップ

Johan

未読、
2015/03/12 4:28:012015/03/12
To: andro...@googlegroups.com
Hello,

I am currently writing an application that needs to use two versions of the same native library.
From Java, I have not been able to load the two libraries separately because they have the same module name.
Moreover, Java does not support "unloading" a native library, so I decided to use dlopen/dlclose.


What I have is the following:
The two libraries in different folder.
<app-data-folder>/files/version1/liba.so
<app-data-folder>/files/version2/liba.so


My native module that loads and unloads the wanted library version:
v1handle = dlopen("version1/liba.so")
// use version1
dlclose(v1handle)
v2handle = dlopen("version2/liba.so")
// use version2
dlclose(v2handle)



It is currently working well but I would like to know if anybody see any problem doing this?
Moreover, is there any chance that this will not work anymore in future Android releases?

So, is this solution correct and stable (i.e. "long-lasting")?

Thank you in advance for your opinion.

Cheers
Johan

J Decker

未読、
2015/03/12 6:15:012015/03/12
To: andro...@googlegroups.com
Since every library needs explicit loading, I see no issue with this; even if those also had related dependencies.


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/d/optout.

全員に返信
投稿者に返信
転送
新着メール 0 件