https://community.idera.com/developer-tools/platforms/f/android-platform/72286/how-to-execute-android-shell-commands-from-delphi
I installed Emteria OS in my Raspberry and I can access GPIO of Raspberry with shell commands .
I want to execute these shell commands (or any other shell command) from my Delphi app.
I am new in Android an i cannot find related info .
Is there any example or related link ?
Here is the source Android cmdline :https://send.firefox.com/download/99113cd2f2330410/#dQ1meOrjTUQtH6tKI7SwBg arch_disk:Android_cmdline.zip
procedure TGpioSU.OpenGpioRights;
var
Cmd: TStringList;
begin
Cmd := TStringList.Create;
try
Cmd.Add('su');
Cmd.Add('chmod -R 777 /sys/class/gpio');
Cmd.Add('exit');
RunAndroidCmd(Cmd, True, Nil);
finally
Cmd.Free;
end;
end;
Thank you very much for your help. Code is working fine .
I need some more help .
How i can read output from shell commands ?
For example in Raspbian i get the temperature with these commands
pi@raspberrypi ~ $ cd /opt/vc/bin
pi@raspberrypi /opt/vc/bin $ LD_LIBRARY_PATH=/opt/vc/lib ./vcgencmd measure_temp
temp=49.2'C
temp=49.2'C is the output and i can read it in Lazarus and CodeOcean using
process and stream.
How i will read the output 'temp=49.2'C' from my Delphi code in Android ?
Is there any documentation ?
Hi, runandroidcmd accept a parameter tstring which returns the output