Delphi-PRAXiS
Seite 3 von 3     123   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   Androidapi.JNI Interface und function : TJavaArray<>; cdecl; (https://www.delphipraxis.net/180796-androidapi-jni-interface-und-function-tjavaarray-%3B-cdecl%3B.html)

stoxx 14. Aug 2015 08:33

AW: Androidapi.JNI Interface und function : TJavaArray<>; cdecl;
 
Zitat:

Zitat von mkinzler (Beitrag 1262812)
Im EMBT-Forum gibt es Beispiel für den AccountManager

https://forums.embarcadero.com/threa...threadID=93425

Da scheint das selbe Problem aufzutauchen

Edit: Vielleicht ist der Index des 1. Eintrags ja 1 und nicht 0?
Edit: Nein. Daran liegt es nicht.
Komischerweise gibt es aber 14 Accounts (Length). Beim Debuggen bekomme ich die Fehlermeldung, dass mir der Zugriff auf die Accounts nicht gestattet ist.
Edit: So Rechte verschafft; aber Debugger funktioniert leider nicht!


so würde es übrigens gehen ;)

Delphi-Quellcode:
procedure TForm1.btn1Click(Sender: TObject);
var

  jAm: JAccountManager;
  accounts: TJavaObjectArray<JAccount>;
  jAcc: JAccount;


begin

      jAM := TJAccountManager.JavaClass.get(SharedActivityContext);
      accounts := TJavaObjectArray<JAccount>.Wrap(jAM.getAccounts);

      mmLog.Lines.Add('Length Accounts: ' + Inttostr(accounts.Length));

      if accounts.Length > 0 then begin
         jAcc := accounts.Items[0];
         mmLog.Lines.Add(jstringtostring( jAcc.toString));
      end else begin
         mmLog.Lines.Add('no accounts available');
      end;


end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:53 Uhr.
Seite 3 von 3     123   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz