找回密码
 立即注册
相关推荐换一批
  1. 仿互站网JS弹窗页广告代码
  2. 自适应资源网站文字广告位代码
  3. JT/T 301-2019 公路交叉分类与编码规则
  4. SL 261-2017 湖泊代码
  5. QB/T 5273-2018 工业用缝纫机数字控制器功能代码数据格式
  6. GA 557.9-2005 互联网上网服务营业场所信息安全管理代码第9部分:规则动作代码
  7. GA 557.3-2005 互联网上网服务营业场所信息安全管理代码第3部分:审计级别代码
  8. GA 408.1-2003 道路交通违章管理信息代码第1部分:交通违章行为代码
  9. GA 398.7-2002 经济F罪案件管理信息代码第7部分:撤销案件原因代码
  10. GA 398.8-2002 经济F罪案件管理信息代码第8部分:统计立(破)案时间段代码
  11. GA 398.9-2002 经济F罪案件管理信息代码第9部分:F罪主体类型代码
  12. GA 398.2-2002 经济F罪案件管理信息代码第2部分:案件来源代码
  13. GA 398.3-2002 经济F罪案件管理信息代码第3部分:案件督办级别代码
  14. GA 398.4-2002 经济F罪案件管理信息代码第4部分:初查审核结果代码
  15. GA 398.5-2002 经济F罪案件管理信息代码第5部分:侦查工作阶段代码
  16. GA 398.6-2002 经济F罪案件管理信息代码第6部分:补立案件原因代码
  17. GA 777.2-2008 指纹数据代码第2部分:指纹纹型代码
  18. GA 777.3-2008 指纹数据代码第3部分:乳突线颜色代码
  19. GA 777.6-2008 指纹数据代码第6部分:指纹协查级别代码
  20. GA 690.1-2007 民用爆Z物品管理信息代码第1部分:民用爆Z物品品种分类与代码
  21. GA 777.4-2008 指纹数据代码第4部分:被捺印指纹人员类别代码
  22. YD/T 1962-2009 具有复用去复用功能的 10Gbit/s 和 40Gbit/s 光收发合一模块软件技?
  23. GA/T 852.4-2009 娱乐服务场所治安管理信息规范第4部分:娱乐服务场所变更类型代码
  24. GA/T 852.7-2009 娱乐服务场所治安管理信息规范第7部分:娱乐服务场所状态代码
代码youcodeNDK | android开发 2022-10-29 82 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
一、什么是NDK?为什么要用它?比较简单的说,NDK是一套交叉编译工具,它可以帮你把你用C或C++书写的代码,编译为。so(相似与win下的。dll)格式的文件,使你可以在你的Android程序当顶用Java语言(JNI)调用这些代码当你想在Java中调用你的C、C++代码时你就可以用它(废话?),那么什么时候你可能考虑使用C、C++代码呢?比如说,你原来用C、C++写过一个游戏程序,里边有你很多的封装好的游戏业务逻辑、算法等代码,你现在想把这个游戏移植到Android上去,如何办?莫非这些业务逻辑、算法要全面用Java重写一遍嘛?现在有了NDK,不用了,你可以直接编译移植这代码了,所以说如果你有代码复用需求的时候,你就可以用它。再举一个比如,比如说你现在用Android手机的摄像头收集图片信息,收集后的图片你使用Java书写了一个压缩算法进行压缩操作,这个算法十分的耗时,消耗CPU,作用很不理想。这时你就可以测试采纳C来书写这个压缩算法,这时你就可能发现,改用C代码履行后,效率提高了几倍乃至十几倍。当你的客户对程序的性能、速度要求比较高的时候,你也可以考虑用C、C++代码编写部分代码,以满足客户要求。所以说如果没有NDK编译的话,你的这些代码在Android上是跑不起来的。二、看起来似乎不错,我现已想试试了,我要如何做?什么是cygwin?为什么要用它?因为NDK编译代码时有必要要用到make和gcc,所以你得先弄个linux环境,如果你只有windows又不想安装linux环境如何呢?这时候,cygwin上场了,cygwin是一个在windows平台上运行的unix模拟环境,它用于学习unix/linux操作环境,或许从unix到windows的使用程序移植,十分有效。通过它,你就可以在不安装linux的状况下使用NDK来编译C、C++代码了。本资料共包括以下附件:
配置NDK集成开发环境全过程第一版.doc
.....

(1、 What is NDK? Why use it? To put it simply, NDK is a cross compilation tool that can help you compile code written in C or C  into. The so (similar to the. dll under win) format file allows you to call these codes in the Java language (JNI) when you want to call your C and C  code in Java, When are you likely to consider using C and C  code? For example, you used to write a game program in C and C  , which contains a lot of your encapsulated game business logic, algorithm and other code. Now you want to transplant this game to Android, how do you do? Is it possible that these business logic and algorithms should be completely rewritten in Java? Now that NDK is available, you can directly compile and transplant the code. So if you have code reuse requirements, you can use it. Take another example. For example, you now use the camera of your Android phone to collect image information. For the collected images, you use Java to write a compression algorithm for compression. This algorithm is very time-consuming, consumes CPU, and does not work well. At this time, you can test and adopt C to write the compression algorithm. Then you may find that the efficiency is improved several times or even more than ten times after using C code to perform. When your customers have high requirements for program performance and speed, you can also consider using C, C  code to write some code to meet customer requirements. So without NDK compilation, your code can't run on Android. 2、 It looks good. I want to try now. How do I do it? What is cygwin? Why use it? Because it is necessary to use make and gcc when NDK compiles code, you need to get a Linux environment first. What if you only have Windows and don't want to install a Linux environment? At this time, cygwin came on the stage. Cygwin is a unix simulation environment running on the Windows platform. It is used to learn the unix/linux operating environment. Perhaps the migration of user programs from unix to Windows is very effective. With it, you can use NDK to compile C and C  code without installing Linux. This document includes the following annexes:
Configuring the NDK Integrated Development Environment Version 1. doc
.....)

[下载]20504570879.rar




上一篇:悬浮歌词(迷你歌词)
下一篇:android开发中log实例