B4A Library AdMob library

Discussion in 'Additional libraries, classes and official updates' started by Erel, Jan 12, 2011.

  1. Douglas Farias

    Douglas Farias Expert Licensed User

    Yes i want to see interstitial on this lib too. only one lib with banner and interstitial
     
  2. Jack Cole

    Jack Cole Active Member Licensed User

    Is there any way to create a custom ad size with this library? I am working to implement native ads with admob, but need something to implement the following Java code.

    Code:
    AdSize nativeAdSize=new AdSize(250,250);//NativeSize
    adView.setAdSize(nativeAdSize);
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    You can implement this code with JavaObject:
    Code:
    Dim adSize As JavaObject
    adSize.InitializeNewInstance(
    "com.google.android.gms.ads.AdSize"Array(250250))
    Dim jo As JavaObject = AdView1
    jo.RunMethod(
    "setAdSize"Array(adSize))
     
    Jack Cole, yiankos1 and ilan like this.
  4. Jack Cole

    Jack Cole Active Member Licensed User

    Thank you very much Erel. I had to modify it slightly since I was getting a java error.

    Here is my code in context for anyone else who may need to do this.

    Code:
    Dim adSize As JavaObject
    adSize.InitializeNewInstance(
    "com.google.android.gms.ads.AdSize"Array(250250))
    nativeAd.Initialize2(
    "nativead","YOUR_AD_ID",adSize)
     
    ilan likes this.
  5. Davin

    Davin Member Licensed User

    is this support the rewarded video format ?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Currently no.
     
  7. ilan

    ilan Expert Licensed User

    what do i need to do?

    can someone please help me :(

    i have google play service rev29 and downloaded the latest android-support-v4.jar file from android sdk and also added #AdditionalJar: android-support-v4

    what else do i need to do?

    Screenshot_2016-05-04-23-10-08.png
     
    Last edited: May 4, 2016
  8. ilan

    ilan Expert Licensed User

    ok i downgraded "google play service" to rev24 but what do i need to do to use rev29?
    is there any difference for showing ads if i use rev24 instead of rev29?

    EDIT: rev27 is also working. (so i am now on rev27)
     
    Last edited: May 4, 2016
  9. Erel

    Erel Administrator Staff Member Licensed User

  10. ilan

    ilan Expert Licensed User

  11. Erel

    Erel Administrator Staff Member Licensed User

    There are two things that might be wrong:
    1. #AdditionalRes: $AndroidSDK$\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms

    2. google-play-services.jar in the additional libraries folder.

    Those two must be with the same version.

    Also check that the manifest editor is configured correctly.
     
  12. ilan

    ilan Expert Licensed User

    so no need to add: #AdditionalJar: android-support-v4

    maybe this was the problem? i will try to remove it and compile when i get back to my pc

    thanx
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    You do need to add it. It is not related.
     
  14. ilan

    ilan Expert Licensed User

    ok i confirm that it is working but i cannot explain why it did not worked yesterday.
    i am sure i did everything right. (maybe its magic :p)

    thankx :)
     
  15. DonManfred

    DonManfred Expert Licensed User

    as stated by erel

    Additional to copy the jar to you additional libs folder
    you need to copy the res folder from support v7 jar too and reference it with the correct path in #additionalres
     
  16. tufanv

    tufanv Expert Licensed User

    IS anyone seeing the ads as a blank black screen for interstatials like me =?
     
  17. sorex

    sorex Expert Licensed User

    @Erel,

    I was having some difficulties here.

    But all I got to see was Failed:3.

    Is it possible to update the lib so that it exposes the errors as text aswell?

    (And while you're at it include the interstitials part aswell plz ;) )

    Edit: I don't know if this is a networking error or an issue at admob or something but my ad loads behave like this

    failed: 3
    received
    failed: 3
    failed: 3
    failed: 3
    failed: 3
    failed: 3
    failed: 3
    failed: 3
    failed: 3
    failed: 3
    received


    sometimes the refresh timer seems to stop aswell and then nothing appears in the log anymore.



    the interstitial at app start always displays fine tho that the weird part of all this.
     
    Last edited: May 31, 2016
  18. sorex

    sorex Expert Licensed User

    It appears that the error means that there was no banner fill.

    So no banners left for my region, language or whatever it selects on.
     
  19. aeric

    aeric Active Member Licensed User

    I just restored my laptop from Windows 10 back to Windows 7 and I need to reinstall B4A and setting up the AdMob library.

    I realize the Android Support Library is missing from Android SDK Manager r24.4.1.
    Android-Support-Library.png
    I am only able to download the Android Support Repository and inside the <sdk>\extras\android only has a folder name m2repository.
    Android-Support-Folder.png
    So I copy the support folder from <sdk>\extras\android\m2repository\com\android to <sdk>\extras\android
    Android-Support-V4.png

    For Android support v4, I look for support-v4-19.0.0.jar and copy to <B4A-Additional-Libraries> and rename it as android-support-v4.jar
     
  20. Erel

    Erel Administrator Staff Member Licensed User

    If you received B4A v6 beta then it will be easier to use FirebaseAdMob.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice