AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Cross-Platform-Entwicklung Wo speichert ihr programmspezifische Daten unter Android?
Thema durchsuchen
Ansicht
Themen-Optionen

Wo speichert ihr programmspezifische Daten unter Android?

Ein Thema von bcvs · begonnen am 4. Aug 2014 · letzter Beitrag vom 26. Aug 2025
Antwort Antwort
Seite 2 von 2     12   
QuickAndDirty

Registriert seit: 13. Jan 2004
Ort: Hamm(Westf)
2.063 Beiträge
 
Delphi 12 Athens
 
#11

AW: Wo speichert ihr programmspezifische Daten unter Android?

  Alt 26. Aug 2025, 16:21
Delphi-Quellcode:
{$IF defined(MSWINDOWS) }
  ExeFileNameWithoutExtension := TPath.GetFileNameWithoutExtension(paramstr(0));
  AppDataPath := TPath.Combine(TPath.getHomePath, ExeFileNameWithoutExtension);
  AppDataPath := TPath.GetFullPath(AppDataPath);
  if not TDirectory.Exists(AppDataPath) then
    TDirectory.CreateDirectory(AppDataPath);
{$ENDIF defined(MSWINDOWS)}
{$IF defined(ANDROID)}
  AppDataPath := TPath.getHomePath;
{$ENDIF defined(ANDROID)}
{$IF defined(IOS)}
  AppDataPath := TPath.GetDocumentsPath;
{$ENDIF defined(IOS)}
Andreas
Nobody goes there anymore. It's too crowded!

Geändert von QuickAndDirty (26. Aug 2025 um 16:24 Uhr)
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.740 Beiträge
 
Delphi 12 Athens
 
#12

AW: Wo speichert ihr programmspezifische Daten unter Android?

  Alt 26. Aug 2025, 19:18
@QuickAndDirty: TDirectory.CreateDirectory ist ein ForceDirectory ... das Exists darfst du dir hier also gern sparen

Tipp: Da du hier bereits mit $If arbeitest,
dann bietet es sich an, alles via $ElseIf zusammenzufassen,
und schon passt da auch noch ein wunderschönes $Else mit dran, für Alles, was du vergessen hast. (OSX, Linux und was es irgendwann alles mal geben wird)
Delphi-Quellcode:
{$IF defined(MSWINDOWS)}
  ...
{$ELSEIF defined(ANDROID)}
  AppDataPath := TPath.getHomePath;
{$ELSEIF defined(IOS)}
  AppDataPath := TPath.GetDocumentsPath;
{$ELSE}
  {$MESSAGE Fatal 'OS not supported'}
{$ENDIF}
Ein Therapeut entspricht 1024 Gigapeut.
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 2 von 2     12   


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:17 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz