I'm trying to adopt some Windows code to Android, but I am unsuccessful.
When I try to compile the following code, I get an error:
[DCC Error] There is no overloaded version of 'HexToBin' that can be called with these arguments
var
BinaryStream: TMemoryStream;
HexStr: String;
WSocket: TWSocket;
begin
HexStr := memo1.Text;
BinaryStream := TMemoryStream.Create;
try
BinaryStream.Size := Length(HexStr) div 2;
if BinaryStream.Size > 0 then
begin
HexToBin(PChar(HexStr), BinaryStream.Memory, BinaryStream.Size);
HexStr:='';
HexStr:=MemoryStreamToString(BinaryStream);
memo1.Text:=HexStr;
IdUDPClient1.Send(HexStr);
For Android you have to use one of these overloads:
You can best achieve this by using a TBytesStream instead of a TMemoryStream.
A valid call could then look like this: