Delphi 10 Andriod/iOS開發小筆記(常常更新)

System.IOUtils.TPath.GetHomePath

Platform Sample path Path ID
Windows XP C:\Documents and Settings\<username>\Application Data CSIDL_APPDATA
Windows Vista or later C:\Users\<username>\AppData\Roaming FOLDERID_RoamingAppData
Mac OS X /Users/<username> NSUserDirectory
iOS Device /private/var/mobile/Containers/Data/Application/<application ID>
iOS Simulator /Users/<username>/Library/Developer/CoreSimulator/Devices/<Device ID>/data/Containers/Data/Application/<application ID>
Android /data/data/<application ID>/files Context.getFilesDir

For Android, set the Remote Path to assets\internal

For iOS, set the Remote Path to StartUp\Documents

// XE3 : DBJSON
// Seattle: System.JSON
var
  LJsonArr   : TJSONArray;
  LJsonValue : TJSONValue;
  LItem     : TJSONValue;
begin
   memo1.Lines.Clear;
   LJsonArr    := TJSONObject.ParseJSONValue(TEncoding.utf8.GetBytes(memo2.Lines.Text),0) as TJSONArray;
   for LJsonValue in LJsonArr do
   begin
      for LItem in TJSONArray(LJsonValue) do
        memo1.lines.add(Format('%s : %s',[TJSONPair(LItem).JsonString.Value, TJSONPair(LItem).JsonValue.Value]));
     memo1.Lines.Add('');
   end;
end;

參考: http://blogs.embarcadero.com/davidi/2013/11/23/43005/

我要留言

留言