该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

We released the first version of the Native Development Kit,

a development toolchain for building shared libraries in C or C++ that

can be used in conjunction with Android applications written in the Java

programming language, way back in July of 2009. Since that initial

release we’ve steadily improved support for native code; key features

such as OpenGL ES support, debugging capabilities, multiple ABI support,

and access to bitmaps in native code have arrived with each NDK

revision. The result has been pretty awesome: we’ve seen huge growth in

certain categories of performance-critical applications, particularly 3D

games.

These

types of applications are often impractical via Dalvik due to execution

speed requirements or, more commonly, because they are based on engines

already developed in C or C++. Early on we noted a strong relationship

between the awesomeness of the NDK and the awesomeness of the

applications that it made possible; at the limit of this function is

obviously infinite awesomeness (see graph, right).

With the latest version of the NDK we intend to

further increase the awesomeness of your applications, this time by a

pretty big margin. With NDK r5, we’re introducing new APIs that will

allow you to do more from native code. In fact, with

these new tools, applications targeted at Gingerbread or later can be

implemented entirely in C++; you can now build an entire Android

application without writing a single line of Java.

Of course, access to the regular Android API still

requires Dalvik, and the VM is still present in native applications,

operating behind the scenes. Should you need to do more than the NDK

interfaces provide, you can always invoke Dalvik methods via JNI. But if

you prefer to work exclusively in C++, the NDK r5 will let you build a

main loop like this:

void android_main(struct android_app* state) {

// Make sure glue isn't stripped.

app_dummy();

// loop waiting for stuff to do.

while (1) {

// Read all pending events.

int ident;

int events;

struct android_poll_source* source;

// Read events and draw a frame of animation.

if ((ident = ALooper_pollAll(0, NULL, &events,

(void**)&source)) >= 0) {

// Process this event.

if (source != NULL) {

source->process(state, source);

}

}

// draw a frame of animation

bringTheAwesome();

}

}(For a fully working example, see the native-activity sample in NDK/samples/native-activity and the NativeActivity documentation.)In addition to fully native applications, the latest NDK lets you play sound from native code (via the OpenSL ES API,

an open standard managed by Khronos, which also oversees OpenGL ES),

handle common application events (life cycle, touch and key events, as

well as sensors), control windows directly (including direct access to

the window’s pixel buffer), manage EGL contexts, and read assets

directly out of APK files. The latest NDK also comes with a prebuilt

version of STLport, making it easier to bring STL-reliant applications

to Android. Finally, r5 adds backwards-compatible support for RTTI, C++

exceptions, wchar_t, and includes improved debugging tools. Clearly,

this release represents a large positive ∆awesome.

We worked hard to increase the utility of the NDK

for this release because you guys, the developers who are actually out

there making the awesome applications, told us you needed it. This

release is specifically designed to help game developers continue to

rock; with Gingerbread and the NDK r5, it should now be very easy to

bring games written entirely in C and C++ to Android with minimal

modification. We expect the APIs exposed by r5 to also benefit a wide

range of media applications; access to a native sound buffer and the

ability to write directly to window surfaces makes it much easier for

applications implementing their own audio and video codecs to achieve

maximum performance. In short, this release addresses many of the

requests we’ve received over the last year since the first version of

the NDK was announced.

We think this is pretty awesome and hope you do too.

android用java_原来android不是只能用java写软件相关推荐

  1. android native java_在Android Native层中创建Java虚拟机实例

    前言 Android应用中JNI代码,是作为本地方法运行的.而大部分情况下,这些JNI方法均需要传递Dalvik虚拟机实例作为第一个参数.例如,你需要用虚拟机实例来创建jstring和其他的Java对 ...

  2. android 开发框架 怎么使用,Android快速开发框架dyh详解(二)---控件层的使用

    1.控件组合 1.1.ViewPager + Fragment, 这两个控件的组合在项目里也是比较常用的,效果同ViewPager,但由于是用Fragment所以可以使代码操作起来更方便: 1.1.1 ...

  3. android 多个应用,Android中一个应用实现多个图标的几种方式

    前言 最近因为新需求需要,我的应用将有多个ICON入口..最终选择了 activity-alias , 其实实现多图标有好几种方式,下面就给大家总结下,分享出来供大家参考学习: 1. 多Activit ...

  4. android 触摸 卡顿,Android CoordinatorLayout(五) 严重的卡顿BUG

    这章来讲一个重大的问题,解决卡顿,我不敢保证我的方法是最优而且对所以都管用,但是至少会比之前的滑动顺畅. 如果你用我Android CoordinatorLayout(三)中写的demo,你会发现一个 ...

  5. 我的Android进阶之旅------Android自定义View来实现解析lrc歌词并同步滚动、上下拖动、缩放歌词的功能...

    前言 一LRC歌词文件简介 1什么是LRC歌词文件 2LRC歌词文件的格式 LRC歌词文件的标签类型 1标识标签 2时间标签 二解析LRC歌词 1读取出歌词文件 2解析得到的歌词内容 1表示每行歌词内 ...

  6. android置组件下面,Android Jetpack架构组件(十二)之Hilt

    一. 依赖注入简介 依赖注入(英文Dependency Injection,简写DI)是一种被广泛使用的编程技术,主要的作用代码解耦. 借助依赖注入,我们可以轻松的管理类之间的依赖,并最终建立高可维护 ...

  7. android人脸识别源代码,Android自带的人脸识别

    1.Android自带的人脸识别Android自带的人脸识别只能识别出人脸在画面中的位置,中点,眼间距,角度等基本特性,提供给拍照性质的应用使用.从基本功能中不能得出明显的特征数据 2.底层库支持ex ...

  8. 【Android 内存优化】Android 原生 API 图片压缩原理 ( 哈夫曼编码开关 | 哈夫曼编码原理 | libjpeg-turbo 函数库 )

    文章目录 一. 哈夫曼编码开关 二. 哈夫曼编码原理 三. libjpeg-turbo 函数库 四. libjpeg-turbo 函数库下载 [Android 内存优化]图片文件压缩 ( Androi ...

  9. 【Android NDK 开发】Android.mk 配置动态库 ( Android Studio 配置动态库 | 动态库加载版本限制 | 本章仅做参考推荐使用 CMake 配置动态库 )

    文章目录 I . Android Studio 中使用 Android.mk 配置动态库 总结 II . 第三方动态库来源 III . 配置 Android.mk 构建脚本路径 IV . 预编译 第三 ...

最新文章

  1. 一张图了解 Spring Cloud 微服务架构
  2. laravel5.5 不能正常自动回复的问题
  3. 苹果12系统升级无服务器,iOS 12.1.4验证现已关闭 你还没升到12.2吗?
  4. “直播第一股”映客,讲得好社交新故事吗?
  5. 【企业管理】价值创造的文化支撑
  6. uva1511(找规律。。。)
  7. 会话创建过程-创建Executor
  8. Spark SQL(六)之加载数据的参数配置
  9. 小学奥数 7834 分成互质组 python
  10. 通过案例学调优之--和 LOG BUFFER 相关的主要 Latch
  11. hive建表报错JsonSerDe
  12. Photoshop 2021 for mac(PS2021直装版)中英双语版
  13. No package ‘glib-2.0‘ found/No package ‘gobject-2.0‘ found
  14. module 'bit' not found:No LuaRocks module found for bit
  15. 2022计算机三级数据库总结和经验(有免费题库)
  16. 三星平板电脑html文件放在哪里,三星Tab3怎么连接电脑?三星Tab3平板电脑连接电脑的方法图解...
  17. Kotlin 只读变量
  18. 怎么把html文档转换成wps,怎么把wps文档转换成word文档
  19. 对方启用和留言是什么意思_美国人老说“How so”?到底啥意思?“怎么这样”吗?...
  20. 硬盘的Smart信息说明

热门文章

  1. PyTorch里面的torch.nn.Parameter()
  2. SpringSecurity安全验证中文乱码问题
  3. 【快速上手mac必备】常用优质mac软件推荐(音视频、办公、软件开发、辅助工具、系统管理、云存储)
  4. 服务化部署框架Paddle Serving
  5. ARM-CPU卷积网络的自动调谐
  6. php将图片链接转换为base64编码文件流
  7. mysql sql w3cschool_SQL复习(w3school)笔记
  8. Python 运算符之成员运算符 in 与 not in
  9. 通过T-SQL语句实现数据库加解密功能
  10. [CF888G]Xor-MST