Jump to content

Dave Nottage

Members
  • Content Count

    1296
  • Joined

  • Last visited

  • Days Won

    29

Posts posted by Dave Nottage


  1. I figured it had to be fairly simple. Can someone poke holes in this? It assumes you're passing a valid value for ADayOfWeek. Also assumes the start/end dates should count

    uses
      System.DateUtils;
    
    function DayOfWeekCountBetween(const ADayOfWeek: Word; const ANow, AThen: TDateTime): Word;
    var
      LDate: TDateTime;
    begin
      Result := 0;
      if AThen >= ANow then
      begin
        LDate := ANow;
        repeat
          if DayOfWeek(LDate) = ADayOfWeek then
            Inc(Result);
          LDate := LDate + 1;
        until LDate > AThen;
      end
      else
        Result := DayOfWeekCountBetween(ADayOfWeek, AThen, ANow);
    end;

     


  2. 1 minute ago, programmerdelphi2k said:

    for sure this can be seen on Pallete of component ...

    Unfortunately, just because it's on the palette when the platform is selected does not mean it works on that platform - it just means the platform attribute is set on the component.


  3. 45 minutes ago, programmerdelphi2k said:

    For me PopUp works as expected

    That's an alternative, but the discussion was about whether or not TPopupMenu works.

    1 hour ago, TazKy said:

    "FireMonkey for Android does not suppot TPopupMenu" flies opposite from the Embarcadero link that I listed

    The documentation is incorrect, the advice on the TRichView forum is correct - it's not supported on Android (or iOS)

    • Like 1

  4. 3 minutes ago, TazKy said:

    what is the designation in the deployment manager for the "Remote Path" for OBB

    There is none, since they're stored in external storage, i.e. external to the app. Normally you would deploy files to the  OBB folder using APK Expansion, however this method is deprecated and Play Store apps must use Play Feature Delivery or Play Asset Delivery. If you're interested in delivering files this way with Delphi, I have an implementation/demo here. Warning: it's not for the faint of heart 🙂

     


  5. 14 minutes ago, stacker_liew said:

    it seems have error, can anyone check for it.

    You can check for the compile errors (of which there are several) yourself by using Error Insight or by compiling.


  6. 10 minutes ago, 357mag said:

    But I have seen a third end

     

    That one has nothing after the keyword

    The semicolon is optional after an end in some circumstances. Please see this. I know it's not after an "end" but the principle is still the same.


  7. 1 minute ago, limelect said:

    My problem has nothing to do with the kind of software

    as the program does not even start on the phone

    It has to do with d11 compilation.

    I have projects from earlier versions of Delphi that I've successfully migrated to Delphi 11.x, mainly because I've been aware of any changes that may be necessary. It has everything to do with what is being used in the application, and zero to do with compilation. Since you appear to be unwilling to share anything about your app, it's extremely difficult to know what the issue is.

    • Like 3

  8. 3 minutes ago, limelect said:

    1. I did try to install it by moving... etc

    None of that information is going to help resolve the issue. Detail about what is in the application may go part way to solving it. Ideally, provide a reproducible test case, which will go a much longer way.


  9. 47 minutes ago, TazKy said:

    It appears that your code works fine in Alexandria, but not Tokyo.  There is no TChannel.

    Correct. It was introduced in Delphi 10.3 in order to support changes in Android. If you're doing mobile development with Delphi, it pays to stay current.


  10. 13 minutes ago, TazKy said:

    What needs is the accompanying text message

    If you mean that the banner does not show, when an app is in the foreground, by default you do not see the banner. If you want the banner to show when the app is in the foreground you need to use a channel with the Importance set to High, and set the notifications ChannelId property, e.g. (extending your code):

    procedure SetNotification(const aTitle, aMessage: string);
    begin
    var vNotifiCenter:= TNotificationCenter.Create(nil);
      try
        if vNotifiCenter.Supported then
        begin
          var LChannel := vNotifiCenter.CreateChannel('MyChannel', 'MyChannel', 'My Channel');
          try
            LChannel.Importance := TImportance.High;
            vNotifiCenter.CreateOrUpdateChannel(LChannel);
          finally
            LChannel.Free;
          end;
          var vNotification := vNotifiCenter.CreateNotification;
          try
            vNotification.AlertBody := aMessage;
            vNotification.Title := aTitle;
            vNotification.EnableSound := true;
            vNotification.ChannelId = 'MyChannel';
            vNotifiCenter.PresentNotification(vNotification);
          finally
            vNotification.Free;
          end;
        end;
      finally
        vNotifiCenter.Free;
      end;
    end;

     

×