Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodComponentDelphiDemoFiremonkey

Access The Com Port On Android With Delphi XE5 Firemonkey Component

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

Delphi XE5 Firemonkey ComPort Android | Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOSWinsoft has a native pascal component for Delphi XE5 Firemonkey on Android which will allow you to communicate with the ComPort of your Android device. Apparently not all phones have a ComPort but HTC devices do. There is a native library for Android in Java that will allow you to access the ComPort too but this component does not appear to use that library and is in pascal. This is a commercial com port component but it comes with a free trial so you can see if it works for you first. The example that is included with the free trial is pretty straight forward. Here is some sample code to read and write data to the ComPort:
procedure TFormMain.MemoKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState);
begin
AComPort.WriteByte(Ord(KeyChar));
end;

procedure TFormMain.TimerTimer(Sender: TObject);
var Text: string;
begin
Text := AComPort.ReadUtf8;
if Text <> '' then
Memo.Text := Memo.Text + Text;
end;

Head over and get the free trial of the com port component.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
DelphiDemoFiremonkeyLinuxOSXShowcaseWindows

AutoBlogAI: FireMonkey Client To Leverage LLMs And Generative AI For Blogging

DelphiFiremonkeyShowcaseUtilityWindows

Unleashing Creativity With Song Writer AI: A Deep Dive

DelphiFiremonkeyShowcaseWindows

How To Build Stable Diffusion Text To Image Prompts

AndroidC++BuilderDelphiFiremonkeyIOSOSXWindows

FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes

Sign up for our Newsletter and
stay informed

4 Comments

Leave a Reply