Skip to content Skip to sidebar Skip to footer

Handling Custom Uri In Delphi Xe5 Android App

I have managed to register a custom protocol handler in my XE5 Android app by modifying the Androidmanifest.template.xml file. My application pops up properly whenever a myapp://m

Solution 1:

Based on this example, try something like this:

uses
  ...,
  Androidapi.JNI.GraphicsContentViewText,
  Androidapi.JNI.Net,
  FMX.Helpers.Android;

procedure TMainForm.FormCreate(Sender: TObject);
var
  intent: JIntent;
  uri: Jnet_Uri;
  uriStr: String;
begin
  intent := SharedActivity.getIntent;
  if intent <> nil then
  begin
    if TJIntent.JavaClass.ACTION_VIEW.equals(intent.getAction) then
    begin
      uri := intent.getData;
      uriStr := JStringToString(uri.toString);
      // use uriStr as needed...
    end;
  end;
end;

Post a Comment for "Handling Custom Uri In Delphi Xe5 Android App"