Thema: Admob Android

Einzelnen Beitrag anzeigen

Peter666

Registriert seit: 11. Aug 2007
357 Beiträge
 
#6

AW: Admob Android

  Alt 20. Jun 2014, 10:32
Ich nochmal

Irgendwie will das mit Admob nicht und ich sehe den Fehler nicht.

Delphi-Quellcode:
uses
  Androidapi.JNIBridge,
  Androidapi.JNI.JavaTypes,
  Androidapi.JNI.GraphicsContentViewText;

{$R *.fmx}

type
 // https://developer.android.com/reference/com/google/android/gms/ads/AdSize.html
  [JavaSignature('com/google/ads/AdSize')]
  JAdSize = interface(JObject)
   ['{F2630EE1-D9D9-493B-8586-98779275393B}']
  { Methods }
    function equals(other: JObject): Boolean; cdecl;
    function getHeight: Integer; cdecl;
    function getHeightInPixels(context: JContext): Integer; cdecl;
    function getWidth: Integer; cdecl;
    function getWidthInPixels(context: JContext): Integer; cdecl;
    function hashCode: Integer; cdecl;
    function isAutoHeight: Boolean; cdecl;
    function isFullWidth: Boolean; cdecl;
    function toString: JString; cdecl;
  end;

  JAdSizeClass = interface(JObjectClass)
    ['{1D3C7938-2841-4BF0-B5FB-D4842D905FF7}']
  { Constants }
    function _GetAUTO_HEIGHT: Integer; // -2
    function _GetFULL_WIDTH: Integer; // -1
  { Fields }
    function _Get_BANNER: JAdSize;
    function _Get_FULL_BANNER: JAdSize;
    function _Get_LARGE_BANNER: JAdSize;
    function _Get_LEADERBOARD: JAdSize;
    function _Get_MEDIUM_RECTANGLE: JAdSize;
    function _Get_SMART_BANNER: JAdSize;
    function _Get_WIDE_SKYSCRAPER: JAdSize;
  { Methods }
    function init(width: Integer; height: Integer): JAdSize; cdecl;
  { Properties }
    property AUTO_HEIGHT: Integer read _GetAUTO_HEIGHT;
    property FULL_WIDTH: Integer read _GetFULL_WIDTH;
    property BANNER: JAdSize read _Get_BANNER;
    property FULL_BANNER: JAdSize read _Get_FULL_BANNER;
    property LARGE_BANNER: JAdSize read _Get_LARGE_BANNER;
    property LEADERBOARD: JAdSize read _Get_LEADERBOARD;
    property MEDIUM_RECTANGLE: JAdSize read _Get_MEDIUM_RECTANGLE;
    property SMART_BANNER: JAdSize read _Get_SMART_BANNER;
    property WIDE_SKYSCRAPER: JAdSize read _Get_WIDE_SKYSCRAPER;
  end;

  TJAdSize = class(TJavaGenericImport<JAdSizeClass, JAdSize>)
  end;

procedure TForm1.FormCreate(Sender: TObject);
var
  ad: JAdSize;
begin
  ad := TJAdSize.JavaClass.BANNER;
end;
Sobald ich das Objekt holen will kommt die Meldung das es nicht existiert.

Ich denke mal ich muss die Google Mobile Ads mit in meine classes.dex einbinden, aber wie mache ich das am dümmsten? Also so das alle schon vorhandenen Jars+Google Ads einkompiliert werden?

Geändert von Peter666 (20. Jun 2014 um 10:41 Uhr)
  Mit Zitat antworten Zitat