Thema: Delphi Android Get real path

Einzelnen Beitrag anzeigen

danten

Registriert seit: 19. Feb 2012
Ort: Czech Republic, Prag
126 Beiträge
 
Delphi 10.1 Berlin Architect
 
#1

Android Get real path

  Alt 15. Jul 2019, 10:24
Hello to everybody,
I need to get a real path to the file as ParamStr (1).
Now I get the file path as follows: /external/file/11608
I need to get the file path: /external/documents/mytext.txt

My code:
Delphi-Quellcode:
procedure TfrmMain.FormCreate(Sender: TObject);
var
  intent: JIntent;
  param_intent: Jnet_Uri;
  param_str: String;
begin

  intent := SharedActivity.getIntent;
  if intent <> nil then
  begin
    if TJIntent.JavaClass.ACTION_VIEW.equals(intent.getAction) then
    begin
      param_intent:= intent.getData;
      param_str:= JStringToString(param_intent.getEncodedPath.toString);
      Label4.Text := param_str;
    end;
  end;
end;
Thank you
Daniel

Geändert von danten (15. Jul 2019 um 10:30 Uhr)
  Mit Zitat antworten Zitat