The first step it's a run sample from RAD Studio that named SensorInfo on your device. On the tab Biometric you can see HumanProximity. If it's true you can get access to this sensor using RTL.

Add unit System.Sensors into uses list and drop TTimer

type
TForm1 = class(TForm)
Label1: TLabel;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
FHumanProximity: TCustomBiometricSensor; // Declare it
{ Private declarations }
public
{ Public declarations }
end;
 
var
Form1: TForm1;
 
implementation
 
{$R *.fmx}
 
procedure TForm1.FormCreate(Sender: TObject);
var
LSensorArray : TSensorArray;
LSensor : TCustomSensor;
begin // Get the sensor list and find that we want
TSensorManager.Current.Activate();
LSensorArray := TSensorManager.Current.GetSensorsByCategory(TSensorCategory.Biometric);
for LSensor in LSensorArray do
if TCustomBiometricSensor(LSensor).SensorType = TBiometricSensorType.HumanProximity then
FHumanProximity := TCustomBiometricSensor(LSensor);
end;
 
procedure TForm1.Timer1Timer(Sender: TObject);
begin // just poll it
if FHumanProximity <> nil then
Label1.Text := FHumanProximity.HumanProximity.ToString;
end;
 
end.

[转]xe6 android 使用距离传感器(Proximiry)的更多相关文章

  1. 《Delphi XE6 android 编程入门教程》推荐

    近5.6年已经没有看见关于delphi的新技术的书出来了(看来在国内delphi的使用量确实很低了), 高勇同学最近出了一本<Delphi XE6 android 编程入门教程>,上周刚拿 ...

  2. Delphi XE6 Android拨号函数

    http://blog.sina.com.cn/s/blog_44fa172f0101rpex.html Delphi XE6 Android拨号函数 (2014-05-07 17:48:51) 转载 ...

  3. DEPHI XE5 XE6 ANDROID IOS开发的几点体会

    DEPHI XE5 XE6 ANDROID IOS开发的几点体会 2014-09-04 20:48 1.不纠结于APK或者APP的大小.现在的客户端设备都很廉价,300元以上的新安卓设备都不在乎软件的 ...

  4. xe6 android控件透明度设置方法

    今天才知道xe6 android控件的透明度设置方法:只需设置控件中的Opacity参数,默认为1--不透明 panel1.Opacity:=0.60;

  5. TSwitch 中文简繁显示支持(XE6 Android)

    说明: XE6 的 TSwitch 做了很多改进,包含多语显示处理,但 XE6 似乎只认定一种中文语系「zh」,它无法处理「zh_TW」.「zh_CN」.「zh_HK」.「zh_SG」等语系,不过可以 ...

  6. [转]delphi xe6 android屏幕操持常亮

    1) setting the Project Options, Uses Permissions, Wake lock = True 2) Adding Android.JNI.PowerManage ...

  7. Delphi xe6 android Popup控件的使用

    1.拖放Label.button和popup控件到form 2.在structure将button1和label1拖到popup1上,然后调整布局就可以 Popup有几个重要的属性: 1.Placem ...

  8. delphi xe6 android ListView增加 Header或Footer 的方法

    var  Item1: TListViewItem;begin    Item1 := ListView1.Items.Add;    Item1.Purpose:=TListItemPurpose. ...

  9. Delphi APP 開發入門(二)Android/iOS設定,Hello World

    Delphi APP 開發入門(二)Android/iOS設定,Hello World 分享: Share on facebookShare on twitterShare on google_plu ...

随机推荐

  1. acm中文版

    http://acm.nyist.net/JudgeOnline/problem.php?pid=1

  2. python基础篇之进阶

    python基础篇之进阶 参考博客:http://www.cnblogs.com/wupeiqi/articles/5115190.html python种类 1. cpython  使用c解释器生产 ...

  3. c++ 浅谈 new 的使用

    实例用法: 创建对象: class U_Ptr smart; U_Ptr* ptr = new U_Ptr(); class U_Ptr smart(new U_Ptr(p)); int *p = n ...

  4. week-02 线性表

    一.PTA实验作业 题目1:顺序表 7-1 最长连续递增子序列 1. 设计思路 定义结构体List,定义数组Data[maxsize]表示顺序表元素,变量Position表示位置,变量Length表示 ...

  5. 网络监控之一:netstat命令

    netstat命令用于显示与IP.TCP.UDP和ICMP协议相关的统计数据,一般用于检验本机各端口的网络连接情况.netstat是在内核中访问网络及相关信息的程序,它能提供TCP连接,TCP和UDP ...

  6. python开发面向对象基础:接口类&抽象类&多态&钻石继承

    一,接口类 继承有两种用途: 一:继承基类的方法,并且做出自己的改变或者扩展(代码重用) 二:声明某个子类兼容于某基类,定义一个接口类Interface,接口类中定义了一些接口名(就是函数名)且并未实 ...

  7. Oracle10g客户端连接远程数据库配置图解

    yuanwen:http://blog.csdn.net/DKZhu/article/details/6027933 一.      安装oracle客户端 1. 运行setup.exe,出现 2. ...

  8. niosII SDRAM ,FLASH (学习特权)

    环境: quartus v13.0  64位. DE2 cycloneII EP2C35F672C6N (学校的开发板,还是想同学借的呵呵) 主要实现flash的烧录,虽然实现了但是还是有很多运气的成 ...

  9. 第十三章 Spring消息(待续)

    ···············

  10. WEB前端必备掌握知识

    1.跨域: 跨域问题是由于javascript语言安全限制中的同源策略造成的.