Jump to content

Dave Nottage

Members
  • Content Count

    1297
  • Joined

  • Last visited

  • Days Won

    29

Posts posted by Dave Nottage


  1. 23 hours ago, Dave Nottage said:

    You’ll need TEdgeBrowser or something similar to actually render it for you

    I've decided to go down this route - it has turned out easier than I expected, especially when using ExecuteJavascript to extract the relevant parts out of the HTML


  2. I have some code that queries mvnrepository via HTTP, specifically looking for packages for Android. It essentially boils down to this:

    uses
      System.Net.HttpClient;
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
      LHTTP: THTTPClient;
      LResponse: IHTTPResponse;
    begin
      LHTTP := THTTPClient.Create;
      try
        LResponse := LHTTP.Get('https://mvnrepository.com/search?q=play+services+maps'); // for example
        // At this point, LResponse.StatusCode is 403 :-(
        // The same query works in regular browsers
      finally
        LHTTP.Free;
      end;
    end;

    Except that recently, as per the comment, it now returns a 403 result, with this content (truncated):

    <!DOCTYPE html><html lang="en-US"><head><title>Just a moment...</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="robots" content="noindex,nofollow"><meta name="viewport" content="width=device-width,initial-scale=1"><link href="/cdn-cgi/styles/challenges.css" rel="stylesheet"></head><body class="no-js"><div class="main-wrapper" role="main"><div class="main-content"><noscript><div id="challenge-error-title"><div class="h2"><span class="icon-wrapper"><div class="heading-icon warning-icon"></div></span><span id="challenge-error-text">Enable JavaScript and cookies to continue</span></div></div></noscript></div></div>

    ..and is followed by a bunch of cryptic JavaScript.
     

    If there was an API (such as REST), I'd use that, however there does not appear to be, and I haven't had a reply for my email to info@mvnrepository.com.

     

    Any ideas as to how I might be able to handle it?


  3. 29 minutes ago, JohnLM said:

    The VCL app is up and running, and the TetherDBClient compiles and runs on the mobile device, but there is no database showing and the two devices do not connect, that is, when I click on the [Connect] button on the mobile device

    Same here. Not sure which method(s) it tries to use to tether in this case - I can take a deeper look later if no-one else answers beforehand. 


  4. 1 minute ago, alogrep said:

    Open an existing project, press DEL Key twice (to delete 2 letters) and the IDE goes fishing: keystrokes or mouse totally disabled. 

    Either there's a step missing between opening an existing project and pressing the DEL key, or it just doesn't happen for me.


  5. 5 hours ago, mbest said:

    I get that, BT is now on the dangerous list but I can not find a way of fixing it.

    Take a look at the ScanFilterServicesAdvData demo in the same folder, specifically TForm6.Button1Click in Unit6.pas. It shows how to request permissions, including the one you need.

    • Like 1

  6. On 3/2/2021 at 6:12 PM, TimStroobandt said:

    I'm looking to build a dialer replacement for the elderly.  According to the android docs I need to create a service which inherits from InCallService.

    I know it's been a couple of years, however I was going through my to-do list today and came across something that led me to your post. It seems with InCallService, it is expected that your app actually replaces the default phone app - is this a viable proposition for you? Regardless, I asked ChatGPT about the alternative, which is to monitor for incoming calls, and provide an alternative means of answering the call.

     

    Are you still looking for a solution to this, and does the ChatGPT answer fit your requirements? 


  7. 14 hours ago, Patrick PREMARTIN said:

    and a link to Grijjy solution

    Which is sadly out of date (applies to Delphi 10.2). The implementation I'm working on should work in Delphi 11.x, and is more simplified than the Grijjy's.


  8. 20 minutes ago, AlanScottAgain said:

    I'm trying to compile FB4D for ios. FB4D is dependent the JOSE library.

    FB4D is also (according to the docs) dependent on linking static libraries for SSL, for iOS*. This is at odds with JOSE, which is dependent on dynamic linking. For it to work on iOS, one will need to be changed.

    *This statement in FB4D seems odd: "The library files libcrypto.a and libssl.a must be deployed within the package". Statically linked files do not need to be deployed.

     

    You might also like to see this.


  9. 8 hours ago, hackbrew said:

    When I implement the OnSaveState event into my app (to read/write data to a stream) the user never returns to my app after closing the mapping app

    It's possible it's because your app crashed. When switching back to it, does it appear as if the app is restarting?

    I seem to recall OnSaveState being unreliable anyway due to it not being called at all if the app is "swipe closed" (I could be wrong). It might be more reliable to persist anything you need restored as soon as a change has occurred.

     

    2 hours ago, hackbrew said:

    On an app close or device power off/on, what happens to data in an on-device local SQLite table?

    Using FireDAC, SQLite databases are by default in auto-commit mode, i.e. any changes should be saved immediately. 


  10. 21 hours ago, Bart Kindt said:

    In addition, I see no way to detect (on startup) if this option is enabled, and as a result for most of my users, the system basically stopped working.

     

    What can I do about this??

    You should be able to detect whether they've granted "allow all the time" by using:

    PermissionService.IsPermissionGranted('android.permission.ACCESS_BACKGROUND_LOCATION'); 

    The CrossPlatformLocation demo in Kastri has logic to ensure the user is aware that it will work only if it is granted, starting from the RequestPermissions method, here. If they've already granted sufficient permissions, it just "falls through" to starting the location services.


  11. On 6/29/2023 at 8:17 PM, RaelB said:

    Would you mind trying my app (RightNote), to see if it starts?

    Crashes before anything at all is shown. This is from the event log:

    Faulting application name: RightNote.exe, version: 6.1.1.0, time stamp: 0x645ac479
    Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
    Exception code: 0xc0000409
    Fault offset: 0x77945948
    Faulting process id: 0x0x1598
    Faulting application start time: 0x0x1D9ADE7EB1F95C8
    Faulting application path: C:\Utils\RightNote\RightNote.exe
    Faulting module path: unknown
    Report Id: 32f9e65a-e8cf-4ed5-8bf2-af8598ebae0c
    Faulting package full name: 
    Faulting package-relative application ID: 

    According to this, it's a "fail fast" exception. I assume from your original post you're using Delphi 10.4?


  12. 11 minutes ago, grantful said:

    My problem is when i click in an edit box to type the phones keybord covers the editbox and i can not see what is being typed.

    There's a number of ways to achieve it, and most involve changing the position of the control, or more likely a control that contains it, since other controls will usually be included in the same "container". For example, you might have a label next to, or above, the edit. Having them both contained inside the same control means that the "container" should be moved "upwards" sufficiently so that the edit appears above the keyboard.

     

    There is a demo here, that helps make all this close to automatic. Note that the demo uses code from the Features\VKObserver folder of the same repo. It's not perfect, however it is useful for most scenarios.

     

     

×