Reputation: 6826
I want to put differently compiled native library packages (4 different packages having armv6, armv6+vfp, armv7, armv7+neon) on Play Store.
Then, I want to publish 1 main application package which can use one of those 4 packages. It will detect the cpu type in runtime and tell user to download application named MyAppLibPackARMV6vfp. Afterwards, if user tries to use the library in main application, main application will check if MyAppLibPackARMV6vfp is installed and if it is, then it (main app) must be able to load native library from that remote package.
This must somehow be possible as we see similar packages on Play Store like: https://play.google.com/store/apps/details?id=com.mxtech.ffmpeg.v6_vfp
How can I do the same thing; allowing a third party (made by me) application to use a library located on another application (made by me)?
Upvotes: 0
Views: 507
Reputation: 10368
Just to post my opinion of how to achieve this goal. It might not the most standard way but it should work.
Take the MX player plugin for example, the main program is MXPlayer.apk and the addition codec is in MXPlugin.apk
Since these two are all signed by the same vendor, they can use the same UID. So MXPlugin could be able to copy the xxxCodec.so into /data/data/com.example.mxplayer/libs/ and then the MXPlayer could be able to load the new codecs.
It is not very graceful. Taking your situation for example. If I were you, I would expose all the APIs in the main program via a service interface (and protected by the same signature). And all the other apk would bind to this main service and call the implementation in native library.
Upvotes: 1