Jump to content

sjordi

Members
  • Content Count

    196
  • Joined

  • Last visited

Posts posted by sjordi


  1. I totally second that. XCode is cumbersome yet very powerful but can be intimidating too.

    Offering a watch equivalent to a main application (smartphone) is a must now and it would really be cool to be able to do this.
    But if I'm correct, the problem (technical) lies more on the Apple side than Embarcadero.

    Fingers crossed.


  2. Ok I tried the code above and confirm that it works fine.

    Disconnect has to be used instead of Close for SQLite.

     

    Now with that kind of load, we don't control the vertical scroll bar though. 
    It is just to navigate the current view (nn records we have decided to use for pagination)

    And the cursor size and position are proportional to those nn records, not the entire set.

    Maybe I should find  a way to better optimize the SQL queries as a workaround.

     

    Thanks


  3. Ok I did exactly as you did, but it didn't work.

    Now instead of FDQuery.Close I set FDQuery.Disconnect instead and now it works...

    Just like you, I wasn't aware of Disconnect. 

     

    Now I'll implement this when using the TListView scrolls... looks like OnScrollViewChange will do. Except it doesn't tell in which direction you scroll.
    But I'll figure this out. Otherwise I'll start a new thread of TListView scrolling events (mouse + finger) 🙂 

     

    Thanks a lot for your help.

    Steve


  4. Hi All,

    I try to implement pagination from a SQLite DB that is bound to a TListView.

    After following the docwiki examples using RecsMax, and RecsSkip on my TFDQuery, I can't find a way to actually have the TListView refresh.

    If I get only 20 record chunks, I always the same 20 items on my ListView no matter what I do.
    The problem is that I'd like the user to be able to navigate the TListView up and down transparently without noticing that the TFDQuery is loading the previous/next chunk of data, this for all platforms, so I won't use a PullToRefresh.

     

    I tried another example that seems to work on TGrid and TStringGrid... but TListView?
     

    Anybody succeeded in getting pages of records and have TListView correctly react?

    Thanks for any clue

    Steve


  5. Do you access an embedded DB ? If yes, do you place it in folders where you have the access right?
    Just tried with a MovieDB I have, embedding an SQLite database and moved the app into /Applications and it works without trouble.
    The DB is in the App own Contents\Resources\ directory

    Just like on iOS when my apps Start and then close immediately, it's related to ressources it doesn't find, like the DB.

    When I fix the DB path and have them in folder where the app has access rights and then it works without problems.


  6. Well, everything is fine now.

    For a funny reason it didn’t install the new PA server

    I installed it manually, deleted the 14.2 SDK, and re-imported it.

    Now all the folders are correctly imported, And I can compile and deploy without problems


  7. They released a patch today for Big Sur, XCode 12 and SDK 14...

     

    Just applied it, installed the new PAServer, compiled a very simple app under SDK 14.2

    [DCC Error] E2597 ld: file '\\vmware-host\Shared Folders\Documents\Embarcadero\Studio\SDKs\iPhoneOS14.2.sdk/usr/lib/libiconv.dylib' too small (length=0) for architecture arm64

     

    Switch to 13.7, everything's fine.


  8. I actually found a workaround to let GExperts exit without problem: I install it first before all other FMX, VCL tools right after a clean RADStudio install.

    If I install it afterwards it always crashes when exiting.

    Probably one of the 3rd party components screws one of the DLLs and locks it. GExpert doesn't install its own.

    I have the feeling that the DLL causing problem is locked when GExpert is installed first and stays locked during the entire process, never replaced by anything else, thus saving GExperts 🙂 

    Don't know...


  9. Hi all,

    Just was wondering how to actually link vertical scrollbars to TListViews using FireDac pagination.

    All the examples and doc about fetching limited rows for huge datasets talk about reacting to a Back or Next action (probably buttons) when you trigger the fetching of the next set, say, next 100 rows.

    This is done this way: FDQuery1.FetchOptions.RecsSkip := FDQuery1.FetchOptions.RecsSkip+1;

     

    But how do we connect this with a vertical scrollbar dynamic movement?

     

    Is the idea to 

    1- get the total number of records

    2- get the current vertical scrollbar position (OnScrollViewChange) and calculate where we should proportionally be in the dataset and fetch those rows?

     

    It would be awful, very slow, and totally approximate.

    Or can the scrollbar be synced with the actually dataset in pagination mode in a more natural way?

     

    Thanks for any light. I prefer to ask first rather than try code for 3 days without results 🙂 

     

    Steve

    • Like 1

  10. Installed it in 10.4.1 at the very beginning of the full reinstall.

    Displayed the SynEdit crash error message.

    Then when everything was installed, all 3rd parties, I installed the latest GExperts DLL that has been recompiled in 10.4.1 and now no more crashes.

    Works flawlessly...

    So I suspect that the next time I'll install everything and GExperts only at the end so it's taking over all other DLLs, and nothing else can screw with it...

    Just a guess...

     


  11. Use the FDConnection BeforeConnect event

       procedure TdbModule.fdConnectionBeforeConnect(Sender: TObject);
       {$IF DEFINED(MACOS)}
       var
          resourcesPath : String ;
          newPath       : String ;
          position      : Integer ;
       {$ENDIF)}
       begin
          // Get the correct Win, OSX, iOS or Android DB path
          fdConnection.Params.Values['Database'] := 'mydb.s3db' ;
          {$IF DEFINED(iOS) or DEFINED(ANDROID)}
             fdConnection.Params.Values['ColumnMetadataSupported'] := 'False' ;
             fdConnection.Params.Values['Database'] := TPath.Combine(TPath.GetDocumentsPath, 'mydb.s3db') ;
          {$ELSEIF DEFINED(MACOS)}
             resourcesPath := paramstr(0) ;
             position :=  Pos( '/Contents', resourcesPath ) ;
             newPath := paramstr(0).SubString(0, position )+'Contents/Resources/mydb.s3db' ;
             fdConnection.Params.Values['Database']:= newPath ;
          {$ENDIF}
       end;

    Don't forget to add the db to the Project Deployment window and set Remote Path for each platform:

    macOS: Contents\Resources\

    iOS: StartUp\Documents\ (this one will show up the DB in FileSharing under iTunes or your device finder  - You can download, erase, add the file to the app)

    iOS: Library/Application Support/[your app directory] for files you want accessible from your app but not from the user (not shared)

    Android: .\assets\internal


     

    • Like 3

  12. Ok that did it. I had some troubles first but I was able to batch move table by table and get the equivalent in Interbase.
    Now I'll try to implement the triggers to replace the missing autoinc fields. 🙂

    Thanks for the suggestion

    Steve

×