[转]xe6 android 使用距离传感器(Proximiry)
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)的更多相关文章
- 《Delphi XE6 android 编程入门教程》推荐
近5.6年已经没有看见关于delphi的新技术的书出来了(看来在国内delphi的使用量确实很低了), 高勇同学最近出了一本<Delphi XE6 android 编程入门教程>,上周刚拿 ...
- Delphi XE6 Android拨号函数
http://blog.sina.com.cn/s/blog_44fa172f0101rpex.html Delphi XE6 Android拨号函数 (2014-05-07 17:48:51) 转载 ...
- DEPHI XE5 XE6 ANDROID IOS开发的几点体会
DEPHI XE5 XE6 ANDROID IOS开发的几点体会 2014-09-04 20:48 1.不纠结于APK或者APP的大小.现在的客户端设备都很廉价,300元以上的新安卓设备都不在乎软件的 ...
- xe6 android控件透明度设置方法
今天才知道xe6 android控件的透明度设置方法:只需设置控件中的Opacity参数,默认为1--不透明 panel1.Opacity:=0.60;
- TSwitch 中文简繁显示支持(XE6 Android)
说明: XE6 的 TSwitch 做了很多改进,包含多语显示处理,但 XE6 似乎只认定一种中文语系「zh」,它无法处理「zh_TW」.「zh_CN」.「zh_HK」.「zh_SG」等语系,不过可以 ...
- [转]delphi xe6 android屏幕操持常亮
1) setting the Project Options, Uses Permissions, Wake lock = True 2) Adding Android.JNI.PowerManage ...
- Delphi xe6 android Popup控件的使用
1.拖放Label.button和popup控件到form 2.在structure将button1和label1拖到popup1上,然后调整布局就可以 Popup有几个重要的属性: 1.Placem ...
- delphi xe6 android ListView增加 Header或Footer 的方法
var Item1: TListViewItem;begin Item1 := ListView1.Items.Add; Item1.Purpose:=TListItemPurpose. ...
- Delphi APP 開發入門(二)Android/iOS設定,Hello World
Delphi APP 開發入門(二)Android/iOS設定,Hello World 分享: Share on facebookShare on twitterShare on google_plu ...
随机推荐
- C语言中的printf函数的输入输出问题
这个问题是个很基础,但是我一直不知道的问题,是同学问了之后才知道的,长知识了. 这里要注意的是,printf函数是从右向左计算,从左向右输出. 距离如下: #include <stdio.h&g ...
- CAN总线应用
CAN总线的应用 1.汽车制造中的应用 应用CAN总线,可以减少车身布线,进一步节省了成本,由于采用总线技术,模块之间的信号传递仅需要两条信号线.布线局部化,车上除掉总线外其他所有横贯车身的线都不再需 ...
- 【转】JMeter入门
一.JMeter概述 JMeter就是一个测试工具,相比于LoadRunner等测试工具,此工具免费,且比较好用,但是前提当然是安装Java环境: JMeter可以做 (1)压力测试及性能测试: (2 ...
- tp5操作mongo
1.通过composer安装 composer require mongodb/mongodb 2.使用 <?php /** * @author: jim * @date: 2017/11/17 ...
- __CLASS__
<?php class base_class { function say_a() { echo "'a' - said the " . __CLASS__ . " ...
- mysql核心参数优化
MySQL数据库服务器配置CPU的优化内存的优化IO的优化连接的优化数据一致性的优化 1.描述back_log参数的作用? back_log = 500 要求 MySQL 能有的连接数量.当主要MyS ...
- 23 mysql怎么保证数据不丢失?
MySQL的wal机制,得到的结论是:只要redo log和binlog 持久化到磁盘,就能确保mysql异常重新启动后,数据是可以恢复的. binlog的写入机制 其实,binlog的写入逻辑比较简 ...
- Box2D学习blog
http://www.ladeng6666.com/blog/category/box2d/
- CGI/MIME/servlet术语解释
CGI→一种协议, 一种标准, 一种规范 使用CGI协议, 能够让用户访问某些动态资源的时候, 触发web服务器, 让web服务器根据CGI协议能够调用外部(web服务器外部)的程序来执行处理这个动态 ...
- 011. Python中*args, **kwargs 和 pass 和self 解释
*args, **kwargs →在python都表示可变参数, *args表示任意多个任意类型无名参数, 是一个元组; **kwargs表示关键字参数(key/value参数), 是一个字典,接收的 ...