so file dynamic loading considerations

Dynamic loading means that the so file is stored on the server, and when it is needed, it is downloaded to the local through the server, and then loaded.

Note:

Mobile phone cpu architecture, different architectures run different so

 

Solution:

1. Deceptive:

  If the so structure is incomplete, just before the apk is packaged, create a new so structure in the jnilibs folder of the project, and put an empty so file in it, so that when packaging, it will deceive the android virtual machine, and when the app is opened, it will be based on The schema corresponding to the folder we created is to load so

2. Download the corresponding so according to the mobile phone recommended architecture

  The so architecture is very complete, get the abis recommended by the mobile phone, and then download the so file of the corresponding architecture from the server that stores the so file, and load it

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325825778&siteId=291194637