Delphi调用Android的.so文件(转)
原地址:http://zhidao.baidu.com/link?url=fzqefMM44ljXA5BnAbkX44SapCUteyzlXFvGLKvukBivm9AB-w39P_h7eX1ty-GQX8j3A03AZBPat6yMqjeY4Sc5jlaayMRVOigzCElm_Ky
so本质就是个动态链接库
用gcc编译就能生成了
Delphi XE里
if not Tfile.Exists(TPath.GetDocumentsPath+'/libserial_port.so') then
begin
showmessage(TPath.GetDocumentsPath+'/libserial_port.so not found');
end;
Handle1:=LoadLibrary(pchar(TPath.GetDocumentsPath+'/libserial_port.so'));//动态装入库
if Handle1<> then //找到库
begin
fun1:=GetProcAddress(Handle1,'openport');
//搜索库函数Add,并返回函数指针
if Assigned(fun1) then
begin
......
至于上面的GetDocumentsPath 或者别的目录也可以 参看TPath的说明和so文件存放目录有关系
另外值得注意的事传递的字符串 xe中是双字节的。
Delphi调用Android的.so文件(转)的更多相关文章
- Delphi如何处理不同类型的文件
参考:http://www.cnblogs.com/railgunman/articles/1800318.html 程序设计当中,我们时常遇到需要处理文件.目录及驱动器的情况,这里将对如何处理不同类 ...
- delphi调用外部程序打开文件
delphi调用外部程序打开文件 ShellExecute的各种用法 一.利用系统默认的邮件收发器发送电子邮件 Uses ..., ShellAPI; Var lpHwnd: HWND; lpOper ...
- Delphi调用JAVA的WebService上传XML文件(XE10.2+WIN764)
相关资料:1.http://blog.csdn.net/luojianfeng/article/details/512198902.http://blog.csdn.net/avsuper/artic ...
- Delphi xe7 up1 调用android振动功能
Delphi xe7 up1 调用android振动功能 振动用到以下4个单元: Androidapi.JNI.App,Androidapi.JNIBridge,Androidapi.JNI.Os,A ...
- Delphi使用android的NDK是通过JNI接口,封装好了,不用自己写本地代码,直接调用
一.Android平台编程方式: 1.基于Android SDK进行开发的第三方应用都必须使用Java语言(Android的SDK基于Java实现) 2.自从ndk r5发布以后, ...
- Delphi - Windows系统下,Delphi调用API函数和7z.dll动态库,自动把文件压缩成.tar.gz格式的文件
项目背景 应欧美客户需求,需要将文件压缩成.tar.gz格式的文件,并上传给客户端SFTP服务器. 你懂的,7-Zip软件的显著特点是文件越大压缩比越高,在Linux系统上相当于我们Windows系统 ...
- 学习使用Delphi for android 调用Java类库
http://blog.csdn.net/laorenshen/article/details/41148253 学习使用Delphi for android 调用Java类库 2014-11-15 ...
- Delphi For Android 开发笔记 1 - 开发工具介绍
在开始前,推荐喜欢delphi或者pascal的朋友,如果想将原来Windows的软件工程移植到Android,可使用CodeTyphon+Delphi XE7进行开发. 1.CodeTyphon C ...
- Unity调用Android类方法
Unity调用Android类方法 1. 添加Unity的classes.jar文件 创建一个Android工程AndroidUnityDemo. 由于Unity的版本不同,直接在Unity安装包文 ...
随机推荐
- Android &Swift iOS开发:语言与框架对比
转载自:http://www.infoq.com/cn/articles/from-android-to-swift-ios?utm_campaign=rightbar_v2&utm_sour ...
- selenium和pythond的区别
selenium和pythond的区别 天宇6169 | 浏览 137 次 2016-03-18 10:25 2016-03-18 12:24 最佳答案 selenium ide是用来录制的!大概 ...
- circularprogressbar/smoothprogressbar开源视图使用学习
github地址:https://github.com/castorflex/SmoothProgressBar 多彩圆形进度条和多彩水平进度条 colors.xml 定义变化的颜色内容,用gplus ...
- Excel 帮助类
using System; using System.Collections.Generic; using System.Data; using System.Drawing; using Syste ...
- Apache多端口配置
修改http.conf监听多个端口 Listen 80 Listen 8001 Listen 8002 配置站点 <VirtualHost *:8001> ServerName *:800 ...
- Linux 排除问题的前5分钟
尽可能搞清楚问题的前因后果 不要一下子就扎到服务器前面,你需要先搞明白这台服务器有多少已知的情况,还有故障的具体情况,不然你很有可能是在无的放矢 必须要搞清楚的问题: 故障的表现是什么?无响应?报 ...
- cakephp , the subquery (2)
Cakephp 框架帮我们做了很多的工作,的确省了我们很多工作,提高了效率. 但是,碰到一些比较复杂的查询时,还是有些问题,官方的cookbook api 有说明一些详细的用法,但感觉还是不太够,有些 ...
- 简单查询plan
-> alter session set statistics_level=all; select /*+ gathe_plan_statistics */ * from ts.ts_recor ...
- ural1542 Autocompletion
Autocompletion Time limit: 2.0 secondMemory limit: 64 MB The Japanese are infinitely in love with ma ...
- std::string
/************************************************************************* > File Name: string.cp ...