本文整理自网络,侵删。
uses Androidapi.JNIBridge, Androidapi.IOUtils,
function GetAppPath: string;begin{$IF Defined(ANDROID)} Result := ExtractFilePath( ExcludeTrailingPathDelimiter( System.IOUtils.TPath.GetHomePath));{$ELSE} Result := ExtractFilePath(ParamStr(0));{$ENDIF ANDROID} Result := IncludeTrailingPathDelimiter(Result);end;
Memo1.Lines.Add( GetAppPath); //结果:/data/user/0/com.embarcadero.HeaderFooterApplication/ Memo1.Lines.Add( TPath.GetHomePath); //结果:/data/user/0/com.embarcadero.HeaderFooterApplication/files
相关阅读 >>
Delphi firedac 连接access mdb数据库的方法
Delphi gethref 获取<a href="链接"></a>中href的数据
Delphi 10.3.x与android 10兼容性的问题
Delphi xe5实现datetimetounix/unixtodatetime的一点小改进
更多相关阅读请进入《Delphi》频道 >>