Jump to content

oakley

Members
  • Content Count

    13
  • Joined

  • Last visited

Posts posted by oakley


  1. Hi Dave,

     

    have you seen that PDF Expert App on Ipad?

    They somehow manage to access security scoped files and can also write back to them.

    And also the pen interaction is a bit different.

    It's not apple standard, meaning that, when you write something it becomes blurry using apples pdf pen framework (or what it's called) when zooming in.

    I use the PDF UI component from TMSicl here, because I wanted something that gives me note taking capabilities.

    PDF Expert always has a clear writing no matter how far you zoom in.

     

    Rgds

     

    Mirko

     

     


  2. Hi Dave,

     

    I select the file from a folder that I created on my IPAD in the public folder structure. So its not coming from a cloud or alike.

    At the end of the selection the file, when opening the file, it is copied to the applications sandbox tmp folder right?

    I writing back to that public folder is not possible after having modified it?

    How does Acrobat for example handle this?

     

    Rgds

     

    Mirko

     


  3. Sorry for the late reply. Today I got back to this project.

    Thanks for pointing me to Kastri. So I downloaded it to get the DW.FileSelector.pas and DW.FileSelector.IOS.pas.

    This works as inteded but I am wondering wether there is a chance to limit the selection to one file or get something like a normal file dialog without that selection feature.

     

    Anyway... I can load a pdf now which is already perfect. Still got a problem when I want to save the modified pdf back to the public path where I loaded the original file from.

     

    Rgds

     

    Mirko

     


  4. Good Morning,

     

    this question is surely so trivial that I dont find anything on google, but I am trying myself on an IOS app with a pdf component in it.

    I just want to load a pdf from the local file system and therefore I need to open file dialog in IOS.

    But... how?

     

    Best regards

     

    Mirko


  5. Got exactly the same Problem. Also tried it on a physical mac, same issue.

    During the update the Delphi Interface freezes from time to time and the transfer becomes slower with cetain files.

    With Monterey on 11.2 everything ran fine and smooth.

     

    Rgds

     

    Mirko


  6. Hi Remy,

     

    I am using passive mode .

    I tried both of your suggestions but I always get the same results.

    I start my download transfer, switch off wifi to simulate a nework interruption but I dont see a timeout.

     

    I changed the try except to catch also other errors like that, but nothing pops up.

     

          except
            on e: EIdSocketError do 
            begin
              TThread.Synchronize(nil,
              procedure
              begin
                 Form2.Memo1.Lines.add(Format('%s EIdSocketError: %d %s', [DateTimetoStr(now),e.LastError,e.Message]));
              end);
            end;
            on e: EIdConnectTimeout do
            begin
              TThread.Synchronize(nil,
                procedure
                begin
                  Form2.Memo1.Lines.add(Format('%s EIdConnectTimeout: %d %s', [DateTimetoStr(now),e.Message]));
                end);
            end;
            on e: EIdReadTimeout do
            begin
              TThread.Synchronize(nil,
              procedure
              begin
                Form2.Memo1.Lines.add(Format('%s EIdReadTimeout: %d %s', [DateTimetoStr(now),e.Message]));
              end);
            end;
            on e: EIdException do 
            begin
              TThread.Synchronize(nil,
              procedure
              begin
                Form2.Memo1.Lines.add(Format('%s EIdException: %d %s', [DateTimetoStr(now),e.Message]));
              end);
            end;
            on e: Exception do 
            begin
              TThread.Synchronize(nil,
              procedure
              begin
                Form2.Memo1.Lines.add(Format('%s %s: %s', [DateTimetoStr(now),e.ClassName,e.Message]));
              end);
            end;
          end;

     


  7. Just to see what really happens, I tried this with the effect that about 18 minutes after the network is gone I get: EIdSocketError:22 Socket Error # 22 Invalid argument .

    So far so good but why 18 minutes after I switched the wifi off?

     

    try
      Form2.Ftp1.Get('file1.txt',TPath.Combine(TPath.GetTempPath, 'file1.txt'),True,false);
      Form2.Ftp1.Get('file2.txt',TPath.Combine(TPath.GetTempPath, 'file2.txt'),True,false);
    except
      on e: EIdSocketError do //<- I thaught that I could catch a timeoute here
      begin
         Form2.Memo1.Lines.add(Format('%s EIdSocketError: %d %s', [DateTimetoStr(now),e.LastError,e.Message]);
      end;
      on e: EIdConnectTimeout do
      begin
         Form2.Memo1.Lines.add(Format('%s EIdConnectTimeout: %d %s', [DateTimetoStr(now),e.LastError,e.Message]);
      end;
      on e: EIdReadTimeout do
      begin
         Form2.Memo1.Lines.add(Format('%s EIdReadTimeout: %d %s', [DateTimetoStr(now),e.LastError,e.Message]);
      end;
      on e: EIdException do //<- this catches any INDY-Exception
      begin
         Form2.Memo1.Lines.add(Format('%s EIdException: %d %s', [DateTimetoStr(now),e.LastError,e.Message]);
      end;
      on e: Exception do //<- this catches any exception which is not cached before
      begin
         Form2.Memo1.Lines.add(Format('%s %s: %s', [DateTimetoStr(now),e.ClassName,e.Message]);
      end;
    end;

     

     


  8. Good morning everybody,

     

    I am trying to program a little FTP Client for Ios where it is likely that the network connection goes away from time to time.

    Based on explanations from Remy Lebeau I use this code to do threaded FTP downloads, which works perfect and is not blocking GUI.

     

    The problem is, that when the network connection aborts, where do I handle the timeout? I set the trasnfer timeout, listen timeout, and connection timeout to 2000 .

    Well, I think the time out kicks but where in the thread do I handle it?

     

    Rgds

     

    Mirko

     

    constructor TLoadThread.Create;
    begin
      inherited Create(True);
      FreeOnTerminate := True;
    end;
    
    procedure TLoadThread.Execute;
    begin
      try
        Form2.FTP1.Connect;
        try
          try
            Form2.Ftp1.Get('file1.txt',TPath.Combine(TPath.GetTempPath, 'file1.txt'),True,false);
            Form2.Ftp1.Get('file2.txt',TPath.Combine(TPath.GetTempPath, 'file2.txt'),True,false);
          except
            on e: EIdSocketError do //I thaught I could handle the timeout here but when the transfer starts the exceltion is not thrown
            begin
              Form2.Memo1.Lines.add(DateTimetoStr(now()) + ' Error: ' + InttoStr(e.LastError) + ' ' + e.Message);
            end;
          end;
        finally
          Form2.FTP1.Disconnect;
        end;
      except
        on e: EIdSocketError do
        begin
          Form2.Memo1.Lines.add(DateTimetoStr(now()) + ' Error: ' + InttoStr(e.LastError) + ' ' + e.Message); //Error for not connecting to ftp server
        end;
      end;
    end;
    
    procedure TForm2.ThreadTerminated(Sender: TObject);
    begin
      xThread := nil;
      Loading := False;
      Memo1.Lines.Add(DateTimetoStr(now()) + ' Thread Terminated');
    end;
    
    procedure TForm2.FTP1Status(ASender: TObject; const AStatus: TIdStatus;
      const AStatusText: string);
    begin
        TThread.Queue(nil,
        procedure
        begin
          Memo1.Lines.Add(DateTimetoStr(now()) + ' ' + AStatusText);
        end
      );
    end;

     

     

     


  9. Hello Dave,

     

    thanks for the advice but this is not working for me. The manifest is a good point and I took a look at it.

     

    Even after re-adding the service I do not see it in the manifest.xml of the main app.

     

    <?xml version="1.0" encoding="utf-8"?>
    <!-- BEGIN_INCLUDE(manifest) -->
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.embarcadero.NotificationApp"
        android:versionCode="1"
        android:versionName="1.0.0"
        android:installLocation="auto">
        <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="30" />
        <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
        <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
        <uses-permission android:name="android.permission.CALL_PHONE" />
        <uses-permission android:name="android.permission.CAMERA" />
        <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
        <uses-permission android:name="android.permission.INSTANT_APP_FOREGROUND_SERVICE" />
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
        <uses-permission android:name="android.permission.READ_CALENDAR" />
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.READ_PHONE_STATE" />
        <uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
        <uses-permission android:name="android.permission.WRITE_CALENDAR" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

        <uses-feature android:glEsVersion="0x00020000" android:required="true"/>
        <queries>

        </queries>
        <application
            android:persistent="False"
            android:restoreAnyVersion="False"
            android:label="NotificationApp"
            android:debuggable="true"
            android:largeHeap="False"
            android:icon="@drawable/ic_launcher"
            android:theme="@style/AppTheme"
            android:hardwareAccelerated="true"
            android:resizeableActivity="false"
            android:requestLegacyExternalStorage="true">

    <service android:name="com.embarcadero.services.NotificationService" android:exported="false" />

            <!-- Our activity is a subclass of the built-in NativeActivity framework class.
                 This will take care of integrating with our NDK code. -->
            <activity
                android:name="com.embarcadero.firemonkey.FMXNativeActivity"
                android:label="NotificationApp"
                android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
                android:launchMode="singleTask">
                <!-- Tell NativeActivity the name of our .so -->
                <meta-data android:name="android.app.lib_name" android:value="NotificationApp" />

                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>

            <receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" />

        </application>
    </manifest>
    <!-- END_INCLUDE(manifest) -->


  10. Hi everyone,

     

    I am trying to deploy the crossplatform notification demo on android 12 according to the readme.md file coming along in the same folder as the project file.

    As soon as I hit the "start service" button, the service is not started and the app closes.

     

    I already tried to get some substantial info by starting monitor.bat but without success.

     

    Rgds

     

    Mirko

     

     

     

×