Juan Felix 1 Posted December 23, 2022 I tried to create Androdi App to send from another android app when share Text and Image. function TForm1.HandleIntentAction(const Data: JIntent): Boolean; var Extras: JBundle; begin Result := False; if Data <> nil then begin Memo1.ClearContent; Extras := Data.getExtras; if Extras <> nil then begin Edit1.Text := JStringToString(Extras.getString(TJIntent.JavaClass.EXTRA_SUBJECT)); Memo1.Text := JStringToString(Extras.getString(TJIntent.JavaClass.EXTRA_TEXT)); var datastream := Extras.getParcelable(TJIntent.JavaClass.EXTRA_STREAM); /// /// I don't know how to use the variable datastream above to get the filename, so... i can read it to TBitmap /// Memo3.Text := JStringToString(Extras.toString); /// /// From the code above, I got the text like this: /// /// Bundle[{ /// android.intent.extra.SUBJECT=Ms Glow Jateng - Ms Glow Ultimate Night Cream, /// android.intent.extra.TEXT=Ms Glow Jateng - Ms Glow Ultimate Night Cream /// /// ULTIMATE NIGHT CREAM adalah cream malam yang diperuntukkan bagi tipe jenis kulit yang memiliki flek/bernoda hitam bekas ... /// /// Yuk beli sekarang! /// Harga: Rp85.000 Rp72.250 /// https://berikhtiar.com/juan.249/product/ms-glow-jateng-ms-glow-ultimate-night-cream, /// android.intent.extra.STREAM=content://evermos.evermos.com.evermos.flutter.share_provider/cache/b74a99e1-b56d-49af-b072-e075f392e0ef.png}] /// end; Invalidate; end; end; Share this post Link to post
programmerdelphi2k 237 Posted December 23, 2022 try some like this: procedure TForm1.Button1Click(Sender: TObject); var LIntent : JIntent; LString : JString; LParcelable: JParcelable; LURI : JNet_Uri; begin LString := LIntent.getExtras.getString(TJIntent.JavaClass.EXTRA_STREAM); // LParcelable := LIntent.getExtras.getParcelable(LString); LURI := TJnet_Uri.Wrap(LParcelable); LURI.getXXXXX; end; Share this post Link to post
Juan Felix 1 Posted December 24, 2022 Thank you so much for the guidance. Share this post Link to post
Mustafa ֍zgun 7 Posted December 24, 2022 Hi you can also try https://github.com/emozgun/delphi-android-SAF Share this post Link to post
Juan Felix 1 Posted December 24, 2022 2 hours ago, Mustafa ֍zgun said: Hi you can also try https://github.com/emozgun/delphi-android-SAF Thank you so much for the additional great information. 1 Share this post Link to post