I'm working with Mpg123 and using for implementation in my own cross-platform app. I'm working with C# and using PInvoke for calling native methods. There are no any problems to get dll for windows platform. The official site is providing ready builds for Windows. But there are no any builds for IOS and Android. I'm not familiar with building native C++ libraries for Android and IOS. And I'm interested in to know it.
Can you provide steps, what I have to do for this goals?
Related
We have iOS and Android native applications. iOS team implemented the Onvif library in Swift (which also contains Objective-C libraries). We would like to integrate it into the native Android application.
We discovered possible solutions:
Write the same code in Kotlin by ourselves
KMM - if it's possible to share the Swift library
Translate Swift into Kotlin using https://vinivendra.github.io/Gryphon/
Gradle plugin for Swift https://github.com/readdle/swift-android-gradle
We prefer to use the original Swift library as all bugs would be fixed there.
What option do you suggest?
Thank you
I am now porting a linux C++ library to Android using JNI. The library porting itself is very straightforward, and I have built a C++ library that can be invoked by Android via JNI. Now my problem is to verify that the library works well in Android environment as well. In the linux development environment, some unit-tests and regression tests are already available. So I was wondering whether I can test the library by taking advantage of all the available unit-test and regression test programs. For example, in linux I have the following binaries:
mylib.so
my_unit_test
my_regression_test
Then for Android, I will first built mylib_android.so. Then, can I build my_unit_test_android and my_regression_test_android for Android platform? If it possible, how can I invoke them in the Android simulator and the real device?I have little knowledge about Android, and any ideas will be appreciated.
Transform them to libraries with single function and write Android app that will use them.
Is it possible to build for android with objective-c native plugin in Unity3D? It builds when i press "bıild and run" without error but can't test with emulator since i use native plugin. I don't have an android device either.
Any help would be appreciated.
You'll be able to build for Android, but you won't be able to use an iOS plugin in Android.
In my projects I have multiple plugins for various platforms. By isolating platform dependent code with #if UNITY_platform, where platform ranges from IPHONE to ANDROID, you can effectively have a single code base with multiple platform plugins, that implement functionality in that single code base, by using dependency injection.
When porting my Android app to Blackberry 10/Playbook, I get the error:
native-code: x86
This error has also been reported here and here. The app uses OpenCV for Android as a library project, which contains native code, and I'm aware that Blackberry lists native code as an unsupported feature. Is there any way to get apps with native code to work on Blackberry, even for experimental purposes?
From what I can tell, you'll have to port it over to Blackberry's Native Platform.
http://developer.blackberry.com/develop/platform_choice/ndk.html
It looks like Blackberry put up a rough port on Github.
https://github.com/blackberry/OpenCV
I haven't used it so I can't comment on how well it works.
I found a related answer here: How do cross-platform mobile app development frameworks work?
but I was thinking more about c++ cross-platform SDKs work (e.g. Corona, Marmalade, EdgeLib, etc.). They provide the ability to export binaries for iOS and Android while allowing the developer to use C++ code. My assumption is listed below, but please correct it if I am wrong anywhere:
User writes code in C++.
SDK has an interface layer with C++ functions called in user code requesting mobile OS specific functionality. This interface layer is built from code required to implement that SDK function call in the specific mobile OS(written in Java for Android and Obj-C for iOS).
Part I am most confused about because I don't have much mobile dev experience points: Do iOS and Android both have C++ cross compilers that can compile the general logic code written in C++ in the user's app?
MoSync is an example of a C++ based cross platform mobile toolkit - this one starts by using the open source GCC compiler to compile your app's C++ code into an assembly-like format. A custom tool by MoSync (called the 'PipeTool') then combines this assembly format with their pre-compiled libraries into various target formats, including java bytecode (for Android) or Objective-C source (for iOS). More detail about this process here.
The final compilation on the target platform (Android or iOS) is left to you, using the native IDE (Xcode for iOS and Eclipse IDE with Android SDK for Android). So to create an iOS application you'll still need to be a member of the Apple iOS developer program (US$99 per year) for example, whereas the Eclipse IDE and Android SDK are free.
Your example of Corona SDK is not fully relevant since Corona builds into the native binary format using their custom build servers in the cloud - what goes on there is not fully documented as its a closed source toolkit. You pay a subscription fee per year to Corona to be able to build apps. I'm not sure about the other ones you mentioned (Marmalade, EdgeLib, etc.) but would assume they are similar to MoSync.
Check out codenameone.com - they use Java but eventually compile into C++ for iOS and Java for Android.
The difference is their environment includes all the graphics and they create the controls themselves so you get an actual native application with just one codebase.