How can I load a library in C or c++ with this in a way that will work in both Android and iOS?
On the Swift/iOS side, it simply uses Swift's excellent C integration; on the Java/Android side, it uses the venerable JNA library to handle loading and calling into embedded native libraries.