I want to create an app for Android and for iOS.
Now, I have to use lot of native C++ code in my application.
So I’d like to know:
- Are any performance issues regarding the use of native code?
- Is it possible to have full control over resources (of the mobile phone) using native code?
- Are there any limitations or drawbacks in using native code in Android or iOS?
- Can you recommend high usage of native code in Android/iOS app development? or perhaps it is discouraged?
Full access to the native UI controls and events will usually involve using Objective C on iOS and Java for Dalvik on Android. The compute kernel, Model object internals, Open GL rendering, and such, can all be done in C/C++. On Mac OS X and iOS, Objective C++ is native code, and thus will run as fast as native code (assuming your code itself isn’t slow). On Android, there may be a small overhead calling through the NDK interface.
The iOS security sandbox does not allow full access to the control of all resources from any app on a stock OS device.