Delphi android app raises problem in Lennova A5000 mobile phone

I am using the Delphi 10 Seattle version to develop a mobile application. And I tried to create a new mobile application for Android that contains only TEditBox. And then compiled by setting the option as "Release". Then the .apk file was generated, and then provided the file to the user. And when the user tried to click the edit box, the application calls the error message " Application name is not responding ."

The user uses Lennova A5000 , and Os uses Android 5.0.2.

And the same application works in my Moto g2 (5.0.2) and Micromax Yureka. Please provide me a solution.

In addition, I updated the application in the Google app store. It then appears as an incompatible application for this device (Lennova A5000).

I also updated all Android SDKs. After this, the same problem also arises.

I think this could be a problem for Embarcadreo Delphi or any missing packages? I do not know what to do.

Thanks in advance.

+4
source share
1 answer

Atlast I got a solution from the Embarcadreo website. Follow the instructions below.

1.Copy FMX.Platform.Android.pas to the project folder from the source / fmx folder and add the copied files to the project.

  1. Then make the changes in the following procedures.

TPlatformAndroid.RunOnUIThread(Proc: TThreadProcedure);

procedure TPlatformAndroid.RunOnUIThread(Proc: TThreadProcedure);
begin
  //MainActivity.runOnUiThread(TSimpleProcedureRunner.Create(Proc));
  CallInUIThread(
  procedure()
  begin
    Proc;
  end);
end;

TPlatformAndroid.SynchronizeOnUIThread(Proc: TThreadProcedure);

procedure TPlatformAndroid.SynchronizeOnUIThread(Proc: TThreadProcedure);
var
  Runner: TSimpleProcedureRunner;
begin
//  CallInUIThread(
//  procedure()
//  begin
//  Runner := TSimpleProcedureRunner.Create(Proc);
//  MainActivity.runOnUiThread(Runner);
//  Runner.Event.WaitFor;
//  end);
  CallInUIThreadAndWaitFinishing(
  procedure()
  begin
    Proc;
  end);
end;

TPlatformAndroid.SetClipboard(: TValue);

procedure TPlatformAndroid.SetClipboard(Value: TValue);
var
  Setter: TClipboardSetter;
begin
  Setter := TClipboardSetter.Create(Value.ToString);
  CallInUIThread(
  procedure()
  begin
  SharedActivity.runOnUiThread(Setter);
  end);
  Setter.Done.WaitFor(INFINITE);
end;

TPlatformAndroid.GetClipboard: TValue;

function TPlatformAndroid.GetClipboard: TValue;
var
  Getter: TClipboardGetter;
begin
  Getter := TClipboardGetter.Create;
  CallInUIThread(
  procedure()
  begin
  SharedActivity.runOnUiThread(Getter);
  end);
  Getter.Done.WaitFor(INFINITE);
  Result := Getter.Value;
end;
  1. . .
+3

Source: https://habr.com/ru/post/1622769/


All Articles