1. Black Friday Sale - 50% off

    B4A Standard for $29 instead of $59!
    Buy Now
    Dismiss Notice

B4A Library AdMob library

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

  1. Magma

    Magma Well-Known Member Licensed User

    Vincenzo Fabiano likes this.
  2. Vincenzo Fabiano

    Vincenzo Fabiano Member Licensed User

  3. scsjc

    scsjc Well-Known Member Licensed User

    i have a question, is possible preload library in SERVICE... before open at ACTIVITY....
    (because it's slow to show, and sometimes close activity without load)
  4. Erel

    Erel Administrator Staff Member Licensed User

  5. Jack Cole

    Jack Cole Active Member Licensed User

    Can we get this library updated to support Google Play's designed for families program?


    Specifically, I am referring to the following:
    Mixed-audience apps are apps that target both child and adult audiences and opt into the Designed for Families program. These apps will need to include code that sets "is_designed_for_families" to true and calls thetagForChildDirectedTreatment() method for ad requests served to a child audience. Upon seeing both"is_designed_for_families" and tagForChildDirectedTreatment() set to true, AdMob will return Designed for Families-compliant ads for that ad request.

    Thank you!
  6. Erel

    Erel Administrator Staff Member Licensed User

    You can use JavaObject to call this method.

    Please start a new thread for this and I'll add the required code.
  7. Jack Cole

    Jack Cole Active Member Licensed User

    With the latest revision of Google Play Services (ver 28), I get the following error on many (but not all) devices.

    I have tried including android-support-v4.jar in the project, but it makes no difference. If I downgrade to rev 27, it works fine. Unfortunately, I need to use the latest version for advanced features. Any ideas?

  8. Erel

    Erel Administrator Staff Member Licensed User

    This class is included in the latest version of android-support-v4.jar. Download it from Android SDK Manager and copy it to the additional libraries folder.

    You need to add this line to the project:
    #AdditionalJar: android-support-v4
    asales likes this.
  9. Jack Cole

    Jack Cole Active Member Licensed User

    Perfect Erel! That fixed it.
  10. schwisti

    schwisti Member Licensed User

    I've some Problems with AdMob.
    That is what I did:

    <meta-data android:name=
    activity android:name="com.google.android.gms.ads.AdActivity"

    'End of AdMob
    #CanInstallToExternalStorage: True
    #AdditionalRes: F:\android-sdks\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms

    #End Region
    Sub Globals
    Dim AdView1 As AdView
    AdView1.Initialize2("Ad""ca-app-pub-6365xxxxxxxxxxxx/xxxxxxxx29", AdView1.SIZE_SMART_BANNER)
    Activity.AddView(AdView1, 0dip0dip320dip50dip)' AdView1.LoadAd 'loads an ad
    End Sub

    Sub Ad_FailedToReceiveAd (ErrorCode As String)
    Log("failed to load Ad: " & ErrorCode)
    End Sub
    Sub Ad_ReceiveAd
    End Sub
    Sub Ad_AdScreenDismissed
    Log("screen dismissed")
    End Sub
    Debugging shows:
    "failed to load Ad: 0"

    I've the actual google play jar in my additional folder. The actual AdMob library (2.0) as well.
    Any ideas?

    Thank you very much!
  11. Erel

    Erel Administrator Staff Member Licensed User

    The problem is not in your code. It might be a temporary problem.

    If it still happens then make sure that the publisher id is correct and that you test it on a real device without any ad blocking app.
  12. schwisti

    schwisti Member Licensed User

    Thank you for your fast answer...
    I created a new Ad in AdMob with a new code....same error 0
    Is it OK, that I use "F:\android-sdks\platforms\android-23\android.jar", because if I use android-19, there'll come an error.
    I test the app on a Samsung Galaxy S4 mini with Android 4.4.2
  13. Erel

    Erel Administrator Staff Member Licensed User

    The SDK used during compilation is not important (as long as it compiles).

    Wait 24 hours. It will probably start working.
  14. schwisti

    schwisti Member Licensed User

    Ok'll wait...

    I found this in the Log:
    Is there something missing? method com.google.android.gms.common.zze.zzi??

    Thank you!!
  15. Erel

    Erel Administrator Staff Member Licensed User

    I don't think that it is related. Are you testing it on a non-rooted device? Is Google Play Services installed?
  16. schwisti

    schwisti Member Licensed User

    Google Play Services 8.4.89 is installed, but my Phone is rootet...
  17. schwisti

    schwisti Member Licensed User

    I found it.......
    In the file "host" are IPs, that goes to Doubleclick, above a comment "this file is from Adaway", but I don't installed this app. So I downloaded it and clicked on "disable add blocking"... now it works on my "old" version of my app. When I'll arrive at home, I'll check it with the new one as well.... Thank you very much for your help!!
  18. sorex

    sorex Expert Licensed User

    Does this library support these interstitial ads or do I need some additional lib/jar?

    When I add an adview and enter my interstitial "key" nothing appears.

    my admob library in B4A is 2.00 and path is set to API14.

    a regular banner displays fine tho.
  19. Douglas Farias

    Douglas Farias Expert Licensed User

    this lib its only for banner.

    u need this lib to show interstitial
  20. sorex

    sorex Expert Licensed User

    ok thanks, that seemed to work as I got a screen telling me I had to date an older woman, lol :)

    It would be nice if this could be included into the standard AdMob library like it is for IOS.
  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