Android 和 Android 的跨平台开发iOS系统

发布于 2025-01-02 15:24:50 字数 297 浏览 3 评论 0原文

我在 Apple App Store 中有一个 iOS 应用程序。对于下一个重大更新,我正在考虑创建我的应用程序的 Android 版本。为了节省开发时间,我想到用 C++ 来完成业务逻辑和数据库访问,以便在两个平台上使用这一层,并且只使用相应平台的 API(即 Objective-C/Cocoa)来完成 UI 部分touch 适用于 iOS,Java/Android SDK 适用于 Android)。

从 Android 的角度来看,您如何看待这种方法? Android下可以使用C++访问SQLite数据库吗?

谢谢&问候, 托马斯

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 ( i.e. 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小姐丶请自重 2025-01-09 15:24:50

请记住,您将需要使用 NDK 来运行 C++ 代码。此外,可以使用 NDK 编译 SQLite,但这需要一些工作,甚至可能需要一些移植。

您还必须用 Java 编写包装器,这也是一些额外的工作,尽管 Android 为此提供了帮助程序。

并且本机代码和应用程​​序之间的编组并不是最有效的过程。

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.

小鸟爱天空丶 2025-01-09 15:24:50

NDK 中没有公开 SQLLite API(至少我看过),但您应该能够将 SQLLite 作为源包并将其包含到您的应用程序中。如果您的所有数据库逻辑都采用 C++,那么您不必担心与 Java API 的互操作。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文