Sign in Join
Wiki copytemporary

LazDeviceAPIs/ko

한국어 · English

LazDeviceAPIs는 LCL 유니승로 가속도계, GPS 위치, SMS 전송 등등에 대한 다양한 하드웨어 장치와의 인터페이스를 제공한다. 대부분은 스마트폰이나 모바일 플랫폼을 위하여 디자인 되었지만 결국은 데스크톱으로 모두 이식 될 것이다.

소개

LazDeviceAPIs는 LCL에서 하드웨어 기기들에 대한 다른 API들이 비슷하도록 모델 되었다. 역사적으로는 널리쓰이는 두개의 하드웨어 기기를 가지고 있다: 마우스와 스크린이 그것으로 마우스는 가르키는 장치이며(마우스는 또한 터치 메세지를 위해 사용될 수 있다) 스크린은 표시장치이다. LazDeviceAPIs에서는 일반적으로 사용하는 장치는: 가속도계, 위치정보, 메세지 등등이다.

Accelerometer(가속도계)

가속도계는 사용하기매우 쉽다. 가속도계 센서의 응답을 시작하려면 단지 Accelerometer.StartReadingAccelerometerData를 호출하면 되며 수신을 중지하려면 Accelerometer.StopReadingAccelerometerData 를 호출하기만 하면 된다.

pascal
uses lazdeviceapis;

procedure TForm2.btnStartAccelClick(Sender: TObject);
begin
  Accelerometer.OnSensorChanged := @HandleAccelerometerChanged;
  Accelerometer.StartReadingAccelerometerData();
end;

procedure TForm2.btnStopAccelClick(Sender: TObject);
begin
  Accelerometer.StopReadingAccelerometerData();
end;

procedure TForm2.HandleAccelerometerChanged(Sender: TObject);
begin
  labelSensorData.Caption := Format('X=%f Y=%f Z=%f', [Accelerometer.xaxis,
    Accelerometer.yaxis, Accelerometer.zaxis]);
  DebugLn(labelSensorData.Caption);
end;

안드로이드 허가

이 장치는 안드로이드에서는 허가가 특별히 필요없다.

PositionInfo(위치정보)

안드로이드 허가

안드로이드에서의 위치정보의 이용은 응용프로그램의 AndroidManifest.xml 파일에 다음과 같은 허가를 주어야 된며 다음과 같이 사용한다:

pascal
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

메세징(Messaging)

안드로이드 허가

안드로이드에서의 메세징의 이용은 응용프로그램의 AndroidManifest.xml 파일에 다음과 같은 허가를 주어야 된며 다음과 같이 사용한다:

pascal
<uses-permission android:name="android.permission.SEND_SMS" />

로드맵

LazDeviceAPIs 는 현재 LCL-CustomDrawn-Android에 대해서만 구현중이다

더 볼 것


From the Free Pascal wiki, page "LazDeviceAPIs/ko", as it stood on 2020-02-18 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .

Edited on wiki.freepascal.org by 3 people, 2012–2020

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
HeennaviCreated page
Heennavi
Heennavi
FTurtle
TrevFixed syntax highlighting; deleted category included in page template (minor)

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.