-1

When necessary I whould like to show an app upgrade reminder screen. App upgrade reminder screen has 2 options "update now" or "ignore". I'm using XE10 Seattle.

Requirement is Update Now should open play store app with my app already searched on it.

Gianluca Colombo
  • 717
  • 17
  • 38
  • So what trouble are you having with the task? – Rob Kennedy May 07 '16 at 14:59
  • @RobKennedy see the answer I posted below. – Gianluca Colombo May 07 '16 at 15:13
  • @RobKennedy Why a duplicate? The page you suggested is not Delphi!!!! – Gianluca Colombo May 08 '16 at 07:33
  • I didn't mark it as a duplicate; @Mjn did, as indicated by the gold tag badge beside the username. But so what? What part of the question is specific to Delphi? The answer is to open a market intent with your app ID; you can do that in any language. You practically demonstrated that in you answer anyway. I asked what part you had trouble with, and you didn't say it was anything to do with translating a Java solution to Delphi. *Was* that the problem? You should have said. – Rob Kennedy May 08 '16 at 10:55

1 Answers1

-1

I tried to launch google play app using the following code, but it doesn't work as I need.

Intent.setPackage(StringToJString('com.android.vending'));
                            Intent.setAction(TJIntent.JavaClass.ACTION_MAIN);
                            SharedActivity.startActivity(Intent);

I solved my problem launching the URL of the app using the browser

    if localversion<requestversion then
      begin
        MessageDlg('A new version of the app is available.
                     Do you want to update it?',
                    System.UITypes.TMsgDlgType.mtInformation,
          [
            System.UITypes.TMsgDlgBtn.mbYes,
            System.UITypes.TMsgDlgBtn.mbNo
          ], 0,


            procedure(const AResult: TModalResult)
            begin
              case AResult
                of
                { Detect which button was pushed and show a different message }
                mrYES:
                     begin
                        Intent := TJIntent.Create;
                        Intent.setAction(TJIntent.JavaClass.ACTION_VIEW);
                        Intent.setData(StrToJURI('https://play.google.com/store/apps/details?id=com.thesis.Cantieri'));
                        SharedActivity.startActivity(Intent);
                        exit;
                      end;
                mrNo:
                  exit;
                mrCancel:
                 exit;
              end;

            end

          );

      end;
Gianluca Colombo
  • 717
  • 17
  • 38