Jump to content

Vitaliy

Members
  • Content Count

    10
  • Joined

  • Last visited

Posts 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

     

     

    001.jpg


  2. On 2/27/2021 at 12:59 AM, Darian Miller said:

    You can join a Delphi related Telegram group for free, here are two:

    https://t.me/delphidevelopers

    https://t.me/DelphiProgramming_Eng

     

    Post a question on Telegram and see if you get a quick response.

     

    I know there are some Russian speaking developers on there. I would assume there's a Russian-only Delphi Telegroup available as well.

    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)


  3. On 2/26/2021 at 11:46 PM, Dany Marmur said:

    On a serious note; there are a host of research papers (needs a host of references) that claim English is in the top-3 skillsets for a deveoper.

    Everything is in English, SO, absolute languages, the best knowledge resources (bar DelphiPrxis.de).

    And then when you want to make those wings FLY it's even more important.

    English; global lingua franca, trade language, tech language.

    Not because English is the best language (it's utterly messy and complex), but because of the sheer MOMENTUM.

     

    You do really IMHO need English on a level above Googles ML loops.

     

    I'd take the job, but the with language barrier i will not be able to deliver a good product/result.

     

    As mentioned above, .ru has a lot of brilliant coders and developers. IMHO get someone who are proficient both in Russian, English AND Pascal/RAD Studio.

    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(((


  4. 4 minutes ago, Fr0sT.Brutal said:

    It's weird to seek for a mentor on international forum with such lang skills. Why don't try at sql.ru?

    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).


  5. 39 minutes ago, weabow said:

    Your request is what I did 4 years ago, to make my app in crossplatforms (I was coming from VB, C & C++, Java, PHP, etc... but not Delphi).

     

    Your strongly right to go this way.

     

    For myself, I asked a MVP, and that was a very good idea.

     

    Christian

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


  6. 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

×