首先,不要!从 DLL 向导中建立 so 工程,你要从 service (local service) 建立一个服务工程。 其次,将服务工程默认生出来的单元干掉,工程中的带 Application.xxx 代码也干掉, uses 段也干掉。 再其次,新建一个单元 Unit 文件,来写你的 Dll(so) 函数。 最后,编译出 so 给主程序调用。 Android Apk主程序没什么区别,自己在代码中动态拉权限,再按照普通调用 so 一样就行.
========== 1, don't! To build the so project from the DLL wizard, you need to build a service project from service wizard (local service). 2, delete the units that are generated by default in the service project, and also kill the application.xxx code in the project.The "uses" section is also removed. Next, create a new Unit file to write your Dll(so) functions. Finally, compile out so. There is no difference in the main program of Android Apk, you can dynamically pull the permissions in the code, and then call so in the same way.
========== see my test project:(extension name ".zip" -> ".7z") IDE = Delphi 11.1
as said by @sail2000 all S.O. mature, always works with library-to-programmers or end-user.
before, it was so much common use DLL (or library as you want) in MSWindows and Shared Objects in another system, or OVERLAYs in old-school-time...
Today, the pratice is online-"APIs"... in sumary, our old "DLL" in modern-fashion. If was possible, it would be just "DLL/SO/OVerLays/OBJ" etc...
the real sense is: protect the code against bad-use!
at end, it is just "code"... and "code" can be broked by hackers.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
really IS NOT NECESSARY USE "ANDROID SERVICE WIZARD" to create your SO file in Posix system.
the point is: - On DPR file: --- MSWindows: library myDll; --- Posix: program mySO;
look my sample: http://bbs.2ccc.com/topic.asp?topicid=628267
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3