简体   繁体   中英

Cross-platform development for Android & iOS

I have an iOS app in the Apple App Store. For the next big update I'm thinking about also creating an Android version of my app. In order to save development time, I got the idea to do the business logic and database access in C++ in order to use this layer on both platforms and only do the UI stuff using the API of the corresponding platform ( ie Objective-C/Cocoa touch for iOS and Java/Android SDK for Android).

What do you think of this approach from the Android point of view? Is it possible to access SQLite databases using C++ under Android?

Thanks & Regards, Thomas

There are no SQLLite APIs (at least list time I looked) exposed in NDK but you should be able to take SQLLite as source package and include it into your application. If all your DB logic going to be in C++, you do not have to worry about interop with Java APIs.

Keep in mind that you will need to use the NDK to run C++ code. Also, it is possible to compile SQLite with the NDK but that will take some work and possibly even some porting.

You will also have to write the wrappers in Java which is some additional work as well, albeit Android provides helpers for that.

And Marshalling between the native code and the app is not the most efficient process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM