Jump to content

Vitaliy

Members
  • Content Count

    10
  • Joined

  • Last visited

Everything posted by Vitaliy

  1. Hello tell me where I made a mistake? I want to open a PDF file in WebBrowser (which I transfer to my smartphone as part of the apk). I add my pdf file to Deployment (picture 001). I use the following code: unit Unit2; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Controls.Presentation, FMX.StdCtrls, FMX.WebBrowser, IOUtils, System.Permissions, Androidapi.Jni.Os, Androidapi.Helpers, FMX.Memo.Types, FMX.ScrollBox, FMX.Memo; type TForm2 = class(TForm) WebBrowser1: TWebBrowser; Button1: TButton; Label1: TLabel; Button2: TButton; Button3: TButton; Button4: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form2: TForm2; FPermissionWrite: string; FPermissionRead: string; fileName:string; implementation {$R *.fmx} procedure TForm2.Button1Click(Sender: TObject); begin fileName:= (TPath.Combine(TPath.GetSharedDownloadsPath,'001.pdf')); if FileExists(fileName) then WebBrowser1.Navigate('file:/'+fileName) else ShowMessage('11:'); end; procedure TForm2.Button2Click(Sender: TObject); begin Application.Terminate; end; procedure TForm2.Button4Click(Sender: TObject); begin PermissionsService.RequestPermissions([FPermissionWrite], procedure(const APermissions: TArray<string>; const AGrantResults: TArray<TPermissionStatus>) begin if (Length(AGrantResults) = 1) and (AGrantResults[0] = TPermissionStatus.Granted) then ShowMessage('Access is available') else ShowMessage('Permission Denied'); end); if PermissionsService.IsPermissionGranted (JStringToString(TJManifest_Permission.JavaClass.WRITE_EXTERNAL_STORAGE)) and PermissionsService.IsPermissionGranted (JStringToString(TJManifest_Permission.JavaClass.READ_EXTERNAL_STORAGE)) then ShowMessage ('access has ALREADY been granted!') else ShowMessage ('001'); end; procedure TForm2.FormCreate(Sender: TObject); begin FPermissionWrite := JStringToString(TJManifest_permission.JavaClass.WRITE_EXTERNAL_STORAGE); FPermissionRead := JStringToString(TJManifest_permission.JavaClass.READ_EXTERNAL_STORAGE); end; end. here WebBrowser1.Navigate ('file:/' +fileName) error occurs: the specified file was not found on a smartphone, the file is created at: /storage/emulated/0/Android/data/com.embarcadero.Project5/files/001.pdf
  2. I want to learn how to work in RAD Studio, I need a mentor who will help me get out of a difficult situation. what issues do I need help with?: 1) teach me to read mistakes 2) teach you how to use the help 3) learn how to use hints in RedStudio I believe that these things can be learned by yourself, but with a mentor, learning will go faster. Why do I need a mentor? I installed RED Studio and tried to run the application (which is located in the Examples folder) for Android, the number of SDK errors that I fixed is п..здец (very - author's note) is great, my experience tells me that with the initial installation it should not be so, with the initial installation (on ready-made Examples) everything should go "like clockwork". Briefly about yourself: 1) The man 2) 36 years old 3) I have been working in the IT field since 2008 4) I speak Russian (I speak English through Google) Suggestions for the mentor: 1) at least three years of experience with RAD Studio Hourly payment (I ask a question in Skype, the mentor evaluates it, the mentor If you are interested in my offer, please write to the post office the cost of one hour
  3. Vitaliy

    Nneed a mentor

    Thank you very much for all the help, the mentoring was done by @vfbb in a very satisfactory way, and here is my recommendation.
  4. Vitaliy

    Nneed a mentor

    thank you for your advice, this is a good resource. but it seems to me that at the first steps it is better to have a mentor, then forums, books and the entire Internet 🙂
  5. Vitaliy

    Nneed a mentor

    thank you for your advice
  6. Vitaliy

    Nneed a mentor

    thanks for the advice, because of big brother I don't like social networks (maybe this is nonsense, don't judge me for it strictly)
  7. Vitaliy

    Nneed a mentor

    thank you for your advice, I completely agree with you: there are many books and information in English (I have read many such books and articles). I can read in English, my conversational language is poor(((
  8. Vitaliy

    Nneed a mentor

    I give you a hint: I correspond with you in English 😉
  9. Vitaliy

    Nneed a mentor

    sql.ru - I didn't know about this resource. at the expense of my English-the main thing is that I strive for knowledge, and in this way all means are good (even an on-line translator).
  10. Vitaliy

    Nneed a mentor

    MVP-gives training materials or does he give a mentor?
×