Einzelnen Beitrag anzeigen

philipp.hofmann

Registriert seit: 21. Mär 2012
Ort: Hannover
859 Beiträge
 
Delphi 10.4 Sydney
 
#22

AW: Android-Bundle: Problematische Geräte 50% im Vergleich zu Android-32-APK

  Alt 12. Mär 2020, 12:34
Hier zur Info, die Lösung, welche für die TAVPlayer-Implementierung und zwar sowohl für das Google-Bundle als auch die Amazon-Auslieferung funktioniert. Dafür waren gemeinsam mit dem Delphi-Support mindestens 5 Testrunden notwendig bis alles klappte.

Hi Lifang,

the following avlib.pas-implementation was now successful for all Google-Prelaunch-(32/64bit-Bundle) and all Amazon-Prelaunch-Tests (32bit):

a)
Delphi-Quellcode:
   {$IFDEF Android}
        FFMPEG_DLL_PATH:=TPath.GetLibraryPath+'/';
        {$ENDIF}
b)
Delphi-Quellcode:
function MySafeLoadLibrary(ModuleName:string):HMODULE;
   var
  Error: string;

  {$IF Defined(ANDROID)}
  function ShouldNativeLibrariesBeExtracted: Boolean;
  begin
    if TOSVersion.Check(6, 0) then
      Result := (TAndroidHelper.Context.getApplicationInfo.flags and TJApplicationInfo.JavaClass.FLAG_EXTRACT_NATIVE_LIBS) <> 0
    else
      Result := True;
  end;
  {$ENDIF}
begin
  {$IF Defined(ANDROID)}
  if ShouldNativeLibrariesBeExtracted then
    ModuleName := TPath.Combine(TPath.GetLibraryPath, ModuleName);
  {$ENDIF}

  Result := LoadLibrary(PChar(ModuleName));

  if Result = 0 then
  begin
    Error := string.Format('Could not load ''%s'' due to: %s', [ModuleName, string(UTF8String(dlerror))]);
   log.d('mySafeLoadLibrary: '+error);
    ShowMessage(Error);
    raise Exception.Create(Error);
  end;
end;
Best regards, Philipp
  Mit Zitat antworten Zitat