Delphi android application is raising issue in Lennova A5000 mobile

三世轮回 提交于 2019-12-18 05:07:12

问题


I'm using Delphi 10 Seattle trail version for developing mobile application. And I tried to create new android mobile application which contains only TEditBox. And then compiled by setting the option as "Release". Then, generated the .apk file and then provided the file to the user. And when the user tried to click the edit box, the application raises the error message that "The Appname is not responding".

The user is using the Lennova A5000 and the Os is Android 5.0.2.

And the same application is running in my Moto g2 (5.0.2) and Micromax Yureka. Please provide me is there any solution.

Also, I have updated the app in google app store. Then, it is showing as incompatible application for this device (Lennova A5000).

And also I have updated all the android SDK packages. After that also, it is raising the same issue.

I think this may be problem to Embarcadreo Delphi or any missing packages? Dont know what to do.

Thanks in advance.


回答1:


Atlast I got the solution from Embarcadreo website. Please follow the mentioned steps.

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

  1. Then, do the changes in the following procedures.

procedure TPlatformAndroid.RunOnUIThread(Proc: TThreadProcedure);

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

procedure 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;

procedure TPlatformAndroid.SetClipboard(Value: 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;

function 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. Then, Rebuild the project. After doing this every thing is working fine.


来源:https://stackoverflow.com/questions/34595492/delphi-android-application-is-raising-issue-in-lennova-a5000-mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!