Jump to content
Sign in to follow this  
TurboMagic

Loading shared objects on Android

Recommended Posts

Hello,

 

given I wanted to distribute a shared object file with map Android app which I need to load dynamically in order to use it.

Where would/should I place this on the device?

Is .\assets\internal the right path to use when adding this file to deployment manager?

If not which is the correct path?

When loading it I'd use LoadLibrary like for a DLL, right?

And if so, would I use this call for that, give the file name would be test.so?

 

LoadLibrary(TPath.Combine(TPath.Combine('assets', 'internal'), 'test.so')) 

 

Share this post


Link to post
2 hours ago, TurboMagic said:

Is .\assets\internal the right path to use when adding this file to deployment manager?

You could use that one, however if you have versions for both 32-bit and 64-bit (or just one of either) you might want to deploy to:

 

library\lib\armeabi-v7a

library\lib\arm64-v8a

 

For 32-bit and 64 bit respectively, and use:

LoadLibrary(TPath.Combine(TPath.GetLibraryPath, 'test.so'))

 

Share this post


Link to post

Ok, I got the libraries loaded, at least in a 32 bit version, which is sufficient at the moment.

But now I'm stuck on a permission error where I don't know what kind of permission is meant.

 

The problem is calling this function:


ret := avcodec_open2(c, codec, @CodecSetup.OptionsDictionary);
in UBitmaps2VideoM's construktor.

 

It always returns -13 which means permission error, but I don't know which kind of permission is meant.

I already tried two different output paths and had added Android 8 style external write permission requesting,
but to no avail.

 

The paths tried are:

GetSharedDownloadsPath

GetDocumentsPath

 

Has anybody any clue?

FFMPEGMultiDemo.zip

Share this post


Link to post

Yes, I resolved it by upgrading the student to 10.3.3 and then using the permission request solution provided there.

It works now and if you check the github repo you'll see it's in there as well 😉

So if you need to create a video on Android you can use that solution right away 😉

The only thing missing there is an iOS implementation as I don't have any iPhone and Mac.

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×