2023年6月27日发(作者:)
龙源期刊网
基于Android平台的串口通信实现
作者:金智义,张戟
来源:《电脑知识与技术》2011年第13期
摘要:串口在数据通信中应用广泛,但Android SDK指定使用Java作为第三方应用开发语言,这给C语言实现串口应用带来了困难。虽然Google Android已经发布了NDK(Native
Development Kit,原生态开发包),支持开发者用C/C++语言开发Android程序,但目前官方提供的技术指导比较简略。通过开发一个Android下串口通信应用实例,详细介绍了Android
NDK的开发流程,帮助开发人员快速的完成平台搭建。
关键词:Android;NDK;JNI;SDK;串口
中图分类号:TP311文献标识码:A文章编号:1009-3044(2011)13-2983-03
Serial Communication Based Android Platform
JIN Zhi-yi, ZHANG Ji
(Vehicle College, Tongji University, Shanghai 201804, China)
Abstract: Serial communication is widely used in data communication, but the Android SDK
uses the Java language as a designated third-party application development, which makes it difficult to
achieve serial applications with C language. Although Google Android has released NDK (Native
Development Kit)which supports the developer to develop Android program with C/C++ language,but
the official technical guidance has been relatively brief. Through the development of serial
communication under an Android platform as an application example, article gives a thoroughly
description of the Android NDK development process that can help developers quickly build
platforms.
Key words: Android; NDK; JNI; SDK; serial
Android是Google推出的基于Linux的开源手机操作系统,是一个专门针对移动设备设计的软件平台,包括操作系统、中间件和一些关键应用。它的软件架构包含四个层次,从高到低分别为应用层、应用框架层、系统运行层和linux内核层,如图1所示。每一个Android应用程序都在它自己的进程中运行,都拥有一个独立的Dalvik虚拟机实例。Android发布初期,Google就表示其虚拟机Dalvik支持JNI编程方式,也就是第三方应用完全可以使用JNI调用自己的C动态库,但Google官方并没有明确表示支持开发者使用这种方法。终于在2009年6月,Google Android发布了NDK,它支持开发者使用C/C++语言开发Android程序。作为Android SDK的一个附加组件提供,开发者必须先安装Android SDK方可使用NDK。NDK的目的是为了增加代码的重用性及加快程序的运行速度,这有利于开发者从其他系统上移植软件到Android平台。
发布者:admin,转转请注明出处:http://www.yc00.com/news/1687840394a49859.html
评论列表(0条)