我可以用 Android 制作一个相当原生的 C++ 应用程序吗? [英] Can I make a rather native C++ app with Android?

查看:19
本文介绍了我可以用 Android 制作一个相当原生的 C++ 应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对以下功能感兴趣:

  1. 为 Android Market 编写一个完全用 C++ 编写的应用程序(实际上是现有产品的一个端口).
  2. 使用快速屏幕缓冲区像素推送(或者为此使用 OpenGL ES).
  3. 获取用户输入并将其定向到 C++ 代码.

为 Market 编写这样的应用是否合法?市场政策对这些事情是否严格?

Is it legal to write such an app for Market? Is Market policy somehow strict to such things?

推荐答案

从带有 Android 2.3 (Gingerbread) 的 NDK r5 开始,这是可能的,尽管我假设只有支持原生应用的设备上必须有 Gingerbread.

As of NDK r5 with Android 2.3 (Gingerbread) this is possible, although I assume only devices to support natives apps must have Gingerbread on them.

来自本机活动示例:

Android SDK 提供了一个帮助类 NativeActivity,它允许您编写一个完整的本机活动.使用原生活动,可以编写完全原生的应用程序.NativeActivity 处理 Android 框架和你的本机代码,因此您不必继承它或调用它的方法.您需要做的就是声明您的应用程序在您的 AndroidManifest.xml 文件中成为本机并开始创建您的本机应用.

The Android SDK provides a helper class, NativeActivity, that allows you to write a completely native activity. With a native activity, it is possible to write a completely native application. NativeActivity handles the communication between the Android framework and your native code, so you do not have to subclass it or call its methods. All you need to do is declare your application to be native in your AndroidManifest.xml file and begin creating your native application.

这篇关于我可以用 Android 制作一个相当原生的 C++ 应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆