Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Admob Unity Package that work with Unity 3.2 above

Discussion in 'Android' started by MicroEyes, Mar 8, 2013.

?

Are you Satisfy with this Plugin Tutorial

  1. Yes

    66.7%
  2. No

    8.0%
  3. Not Completely

    25.3%
  1. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    This thread is the brother thread of my previous Admob thread.:):)



    A NEW INDEPENDENT PLUGIN WITH NEW FEATURES..:D

    Hi Guys, After putting a lots of effort in rewriting code for Admob integration with Unity, i have something for you all with some new features bug fixes..:rolleyes::rolleyes::rolleyes:

    Please Read full tutorial before start. otherwise you might miss some important instructions. Good Luck

    Now its not just basic, i advanced it with some more control over Admob.

    Version History
    Last Update: September'03, 2014

    • Version 3.1.2
    Fixed incorrect function callback from plugin
    Fixed Adv Show() & Hide() functions were working opposite.
    Added IsLoaded for InterstitialAd, check whether InterstitialAd Loaded (after calling Load()).
    • Version 3.1
    Fixed: Random crashes, while receiving Ads.​
    • Version 3.0 (Added: September'08, 2014
    Added Interstitial Ads
    Re-written most of modules.​
    • Version 2.0 (Added: March'03,2013)
      Updated to Admob SDK: 6.3.0
      Fixed NoAnimation bug
    Legacy Admob Project(Not supported): Download Here . (Recommended download latest version below)
    Legacy Admob UnityPackage(Not supported): Download Here (Recommended download latest version below)​
    • Version 1.0 (Not supported): Initial version (Recommended download latest version below)
      Download from Here
    FEATURES:
    • Support Banner & Interstitial Ads.
    • Support Multiple Ads on same screen.
    • Support Multiple Ad Unit IDs. Set different AdUnitID for different Ad Containers.
    • Support 4 Animations on Ad container so that they appear or disappear smoothly on Receiving new Ad.
    • Change Position of Ad container at runtime.
    • Control visibility of Ad container.
    • No Need to manually maintain AdmobPlugin Scene assets. Its automated in plugin itself.

    UPCOMING FEATURES:
    1. Editor UI to create Ad & assign properties which would reduce your 5mins to write Code.
    2. You tell me what you need more.

    Here is the basic AdMob package implementation that works with almost every Unity Version greater then(i tested on 3.2, 3.3, 3,4, 3.5 4.0)
    The older method, i found in Unity Forums is no more working have some issue with Setup environment, ANT Android SDK version eclipse.



    What you need to implement?
    JUST Unity with android SDK ....:rolleyes::rolleyes::rolleyes:

    Before Upgrading:
    From v2.x to 3.x: AdmobPlugin v3.0 is not an extended version of v2.0. I have re-coded it again. Function call from v2.0 won't work with new AdmobPlugin v3.0. But new version have lots of new features & more control over Ads.


    Integration Steps:
    1. Download & import Admob UnityPackage. DONE

    First Setup after Importing: Setup Admob properties:
    In Project hierarchy, Goto Resources folder, you should see "AdmobSettings.asset". Its settings from where Admob plugin read values:
    1. AdUnitID: Specify your common Admob unit ID in this format: ca-app-pub-41924874559xxxxx/61314xxxxxx .. This AdUnitID will get use for every Ad in Game/App
    2. IsTesting: Check On this while your are testing your Game/App
    3. TestDeviceID: Give your test device Id. How to Get your test device ID? See this and this
    4. LevelOfDebug: use this to get logs from AdmobPlugin. Recommending to use "Low" or "None" while shipping Game/App to prevent lots to logs from Game/App.

    • None: you wont get any log from admob plugin,
    • LOW: You will get minimal required logs,
    • HIGH: You will get some more logs.
    • FLOOD: You will get flood of logs in your device logcat. Please test your Admob content on this Value
    NOTE: If AdmobSettings.asset gets lost/corrupted, then you can generate a new one from Windows->Create Admob Settings


    You can use/call below functions from anywhere of your code.

    <Ad_Identifier> could be any string different from other Ad IDs

    BANNER AD:---------------------------------------------------

    Create Simple Banner Ad:
    Code (csharp):
    1.  
    2. BannerAd l_bannerAd = AdmobManager.Prepare<BannerAd>("<Ad_Identifier>");   //OR     AdmobManager.PrepareBannerAd("<Ad_Identifier>");
    3. l_bannerAd.Create();
    4.  


    Start Requesting for Ad:
    Code (csharp):
    1.  
    2. BannerAd l_bannerAd = AdmobManager.Get<BannerAd>("<Ad_Identifier>");
    3. l_bannerAd.Load();
    4.  
    OR
    Code (csharp):
    1.  
    2. AdmobManager.Load("<Ad_Identifier>"));
    3.  
    Change Default Properties(Animation In/Out Type, Ad Position, Orientation, etc) of Ad:
    Code (csharp):
    1.  
    2. BannerAd l_bannerAd = AdmobManager.Get<BannerAd>("<Ad_Identifier>");
    3. l_bannerAd.BannerType = EBannerAdType.SMART_BANNER;
    4. l_bannerAd.Orientation = EOrientation.HORIZONTAL;
    5. l_bannerAd.AnimInType = EAnimationInType.FADE_IN;
    6. l_bannerAd.AnimOutType = EAnimationOutType.SLIDE_OUT_RIGHT;
    7. l_bannerAd.SetPosition(EPosition.CENTER_HORIZONTAL, EPosition.BOTTOM);
    8.  
    RemoveAd:
    1. RemoveAd(Upcoming version):
    2. RemoveAdImmediately:
    Code (csharp):
    1.  
    2. AdmobManager.RemoveAdImmediately(""<Ad_Identifier>"");
    3.  
    Hide/Show Banner Ad:
    Code (csharp):
    1.  
    2. AdmobManager.ShowBanner("<Ad_Identifier>");
    3. AdmobManager.HideBanner("<Ad_Identifier>");
    4.  
    Change AdPosition at Runtime:
    Code (csharp):
    1.  
    2. BannerAd l_bannerAd = AdmobManager.Get<BannerAd>(""<Ad_Identifier>"");
    3. l_bannerAd.Reposition(EPosition.TOP, EPosition.CENTER_HORIZONTAL);
    4.  

    INTERSTITIAL AD:---------------------------------------------------
    Create Ad:
    Code (csharp):
    1.  
    2. InterstitialAd l_interAd = AdmobManager.Prepare<InterstitialAd>("<Ad_Identifier>");   //OR     AdmobManager.PrepareInterstitialAd("<Ad_Identifier>");
    3. l_interAd.Create();
    4.  
    Start Requesting for Ad:
    Code (csharp):
    1.  
    2. InterstitialAd l_interAd = AdmobManager.Get<InterstitialAd>("<Ad_Identifier>");
    3. l_interAd.Load();
    4. OR
    5. AdmobManager.Load("<Ad_Identifier>"));
    6.  
    Show Ad:
    Code (csharp):
    1.  
    2. AdmobManager.ShowInterstitial("<Ad_Identifier>");
    3. OR
    4. InterstitialAd l_interAd = AdmobManager.Get<InterstitialAd>("<Ad_Identifier>");
    5. if(l_interAd.IsLoaded)  //Check whether Ad received from Google Admob server.
    6. {
    7.      l_interAd.Show();
    8. }
    9.  

    For Advanced users:-------------------------------------------

    Advanced: Get callback events from Admob plugin:
    Admob plugin supports 5 events for both BannerAd and InterstitialAd:
    1. OnAdOpened,
    2. OnAdLeftApplication,
    3. OnAdClosed,
    4. OnAdLoaded,
    5. OnAdFailedToLoad //return ErrorCode as parameter

    All of above events returns ID, which triggered Event. You can receive and process your game event on the basis of Admob callback events. I am using Delegates to give callbacks:
    To register function to both BannerAd & InterstitialAd:

    Code (csharp):
    1.  
    2. BannerAd l_bannerAd = AdmobManager.Create<BannerAd>("Banner_1");
    3. l_bannerAd.OnAdLoaded += MyCustom_OnAdLoadedEvent;
    4.  
    Callback Function:
    Code (csharp):
    1.  
    2. void MyCustom_OnAdLoadedEvent()
    3. {
    4. ........
    5. ........
    6. ........
    7. }
    8.  
    After you Create & Load Ad, whenever Admob plugin receives Ad, MyCustom_OnAdLoadedEvent() will get called. You can register for all 5 events.


    Advanced: Use Different AdUnitID for different Ad:
    Yes, you can use one AdUnitID for BannerAd and Second AdUnitID for InterstitialAd. Follow this:
    Code (csharp):
    1.  
    2. BannerAd l_bannerAd = AdmobManager.Get<BannerAd>("<Ad_Identifier>");
    3. l_bannerAd.AdUnitId = "<different_AdUnitID>";
    4.  

    NOTE:
    1. Assign AdUnitID to individual BannerAd/InterstitialAd only works while creating Ad.
    2. Do not use '^' Caret Sign in Ad_Identifier name.
    3. Do not change the location of "AdmobSettings.asset" from Resources. Otherwise, Admob plugin won't be able initialize settings.

    See "AdmobTestUI" for more detail of how to control Admob Plugin.


    I have also uploaded APK, please test Ads on your device first using this APK, to check whether you can receive Ads in your device.


    IMPORTANT::cool::cool::cool::cool:
    If you are planning to use with another plugin, then in AndroidManifest.xml change value key in below line to True. By default its set to False
    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" /> .

    If nothing happens on Adv click, then use above changes in AndroidManifest.xml


    HAPPY GAMING..;);););););)


    Thankx for using this plugin.

    If you like this plugin for Free, i would need a space in Credits in your game, with name "Satbir Singh (CodeName: MicroEyes)", if possible.
    Share your Game link here, so we could see.


    Donate/Paypal for further development @ microeyes07@gmail.com


    @@@@@@@@@@@@Subscribe Thread to get latest version Admob plugin!!!!!!!!!!!


    If you get any issue please share with me with full log from plugin. I'll try to resolve it asap.:cool::cool::cool::cool:


    PS: Please send me log with Debug level set on FLOOD, so i could track activities step by step.




    DOWNLOADS:

    AdmobPlugin_v3.1.2____Unity_4.5.4.unitypackage (2,953 KB)
    Download from Google Play

    The Unity package was exported from Unity 4.5.4 but plugin should work on all versions Unity 4 cycle, starting Unity 4.0.


    BannerAd.png

    InterstitialAd.png
     
    Last edited: Mar 22, 2015
  2. LiefLayer

    LiefLayer

    Joined:
    Jan 6, 2013
    Posts:
    37
    can't download any
     
  3. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    @LiefLayer
    But here both are working downloadable.
    What problem are you facing?
     
  4. iv7

    iv7

    Joined:
    Aug 14, 2012
    Posts:
    1
    I can't download any attach here too.
    Not in IE, not in Chrome.

    Previous thread provides download normal.
    I just started to see it. Seems it is cool!
    Thank you!
     
  5. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    Thank you very much for providing this. I will be testing it in the next week or two and let you know if I have any problems.

    I cannot download TestBuild.zip. The error message I get is, "Download permission denied by uploader."
     
  6. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    98
    Nice! Plugin is working!

    I has some questions:
    1) How I may changing between position(pos1 and pos2)? Position 2 display by default. I want to display TOP-banner in MAINMENU, and CENTER-banner in RESULT WINDOW.
    2) How to make refresh Adv? I need use DisableAds(); and then EnableAds(); to refresh this?? Because if there will always be one banner, the chance to click decreases
    3) Can I upload ads in advance through EnableAds(), but showing it later, after call ShowAds(); ?

    p.s. while testing my game is freezing once or twice. I am not sure that this is for advertising. I will look at logcat.
     
    Last edited: Mar 11, 2013
  7. LiefLayer

    LiefLayer

    Joined:
    Jan 6, 2013
    Posts:
    37
    EDIT. Now works LOL strange

    but the Test app is offline (or maybe you finish your uploader band limit of 1 GB)
    https://rapidshare.com/files/2385906636/TestBuild.zip

    if you can reupload it on an other site like mediafire or the new mega.

    Anyway Thank you a lot it works I've try and it's very easy
     
    Last edited: Mar 11, 2013
  8. skoandi

    skoandi

    Joined:
    Jul 9, 2012
    Posts:
    67
    Imma try it out :) Thank you :)
     
  9. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    Hi Nolex,
    1. There is a prefab in Unity package named "AdvertisementManager". Drag it to Scene change properties from inspector. By default its Set to HORZONTAL || BOTTOM. Just choose yours.

    2. You dont need to make manual refresh. Its Google admob SDK's job is to change advertisements repeatedly. To cross check please see logs. You should see log starts with "Received Ads.............." with tag Admob.
    I have given DisableAds() EnableAds() just to switch on or off ads on some condition. not for refreshing ads.

    3. Sorry, but i am not getting this point.

    If you got any issues with this plugin, no worries.... just post or PM me logs.


    Thanks for your interest feedback.
     
  10. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309

    TestApp link Fixed.
     
  11. cpasjuste

    cpasjuste

    Joined:
    Apr 2, 2012
    Posts:
    139
  12. Jawad

    Jawad

    Joined:
    Nov 6, 2012
    Posts:
    140
    In unity project we have to use ur plugin pkg name "com.microeyes.admob" or we can use our own pkg name???
     
  13. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    Hi Jawad,
    We do need to give a package name before i cook code from Java we can't change package name after cooking. I made this package so i gave it my name.
     
    Last edited: Mar 12, 2013
  14. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    98
    Thanks for answers!! But in the first question I asked about another...
    How do I switch between positions in runtime?

    Example:

    Code (csharp):
    1. void OnLoadLevel() {
    2.     if (level == "main_menu") {
    3.      Show_Adv_Bottom_Of_Screen();
    4.    } else if (level == "results_window") {
    5.      Show_Adv_Top_Of_Screen();
    6.   }
    7. }
    How to do this?
     
  15. vladimirdlc

    vladimirdlc

    Joined:
    Jan 26, 2013
    Posts:
    19
    Great plugin! testing it and working smooth.

    I have a doubt although, been testing in a Kindle Fire, is there a way to press the ad and go to the link but keep the game running on background?
    When I click the link and then press back to return to the app, it restarts it completely, loosing any ingame progress.
     
  16. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    Nolex, There was a provision to change position programatically in previous version. but that thing isn't implemented in this version. It'll take some time to do. I'll look for some time to add complete more features. i have a list of them. But it ll be there in next version.

    Thanks for your interest.
     
    Last edited: Mar 31, 2013
  17. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309

    Hi vladimirdlc,
    This is not plugin's issue. When you put any application background run any other process that need more device RAM, then Android device close background apps games. It happens with almost every game. You can try with other apps games.
     
  18. Jawad

    Jawad

    Joined:
    Nov 6, 2012
    Posts:
    140
    Can u make a tutorial on how we can make our own admob plugin??
     
  19. vladimirdlc

    vladimirdlc

    Joined:
    Jan 26, 2013
    Posts:
    19
    True, I did not know that.

    Now working great, the release of our game will be made soon, I will be sure of reference you in the credits and post the link here to our game ;)

    PD: Which name should we put in the credits btw, MicroEyes is ok or you would prefer another?
     
    Last edited: Mar 13, 2013
  20. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    98
    Sometimes when Enable();("Enabling ADMOB") the banner is not loaded and it then affects the friezes.

    In 1 case out of 10, Enabling does not work - no response comes from admob a banner-link to the advertisement.
    The recall Enable(); does not help! Is there a way to send Unity callback that Enabling crashed?

    LOGS:

    Code (csharp):
    1. 03-13 10:39:44.149: I/Unity(1347): Initializing with   Pub ID: xxx  Adv Size: IAB_BANNER  Orientation: HORIZONTAL  Position 1: 17  Position 2: 17  IsTesting: False  DeviceID:   AnimIn: NO_ANIMATION  AnimOut: NO_ANIMATION  LevelOfDebug: HIGH
    2.  
    3. 03-13 10:39:44.369: I/Unity(1347): Instantiate Called
    4. 03-13 10:39:44.429: I/ADMOB(1347): FunctionCall: 0  Received PUB_ID: xxx  ADV_SIZE: 2   Orientation: 1  pos_1: 17   pos_2: 17  isTesting: false   AnimationInType: 2   AnimationOutType: 2     levelOfDebug: 2
    5. 03-13 10:39:44.429: I/ADMOB(1347): Requested: Instantiating AdView
    6. 03-13 10:39:44.439: I/ADMOB(1347): Set Current AdvSize to 468x60_as
    7. 03-13 10:39:44.439: I/ADMOB(1347): Init________ Instantiate Step 1: DONE
    8. 03-13 10:39:44.439: I/ADMOB(1347): Init________ Instantiated WIDTH -- PUB_ID: xxx  ADV_SIZE: 2   Orientation: 1  pos_1: 17   pos_2: 17  isTesting: false
    9. 03-13 10:39:44.439: I/ADMOB(1347): Instantiated Successfully
    10. 03-13 10:39:44.439: I/Unity(1347): Instantiate FINISHED
    11.  
    12. 03-13 10:39:44.439: I/Unity(1347): ENABLED Called
    13. 03-13 10:39:44.439: I/ADMOB(1347): FunctionCall: 2  Received PUB_ID:   ADV_SIZE: -1   Orientation: -1  pos_1: -1   pos_2: -1  isTesting: false   AnimationInType: -1   AnimationOutType: -1     levelOfDebug: -1
    14. 03-13 10:39:44.449: I/ADMOB(1347): Requested: Enabling AdView
    15. 03-13 10:39:44.449: I/ADMOB(1347): Enable________ Starting Enable
    16. 03-13 10:39:44.449: I/ADMOB(1347): Enable________ End Layout Setup
    17. 03-13 10:39:44.449: I/ADMOB(1347): Enable________ Enabling ADMOB
    18. 03-13 10:39:44.459: I/Unity(1347): ENABLED FINISHED
    19.  
    20. 03-13 10:39:44.459: I/Unity(1347): HIDE ADV Called
    21. 03-13 10:39:44.479: I/ADMOB(1347): FunctionCall: 3  Received PUB_ID:   ADV_SIZE: -1   Orientation: -1  pos_1: -1   pos_2: -1  isTesting: false   AnimationInType: -1   AnimationOutType: -1     levelOfDebug: -1
    22. 03-13 10:39:44.479: I/Unity(1347): HIDE ADV FINISHED
    23.  
    24. 03-13 10:40:41.169: I/Unity(1347): SHOW ADV Called
    25. 03-13 10:40:41.179: I/ADMOB(1347): FunctionCall: 4  Received PUB_ID:   ADV_SIZE: -1   Orientation: -1  pos_1: -1   pos_2: -1  isTesting: false   AnimationInType: -1   AnimationOutType: -1     levelOfDebug: -1
    26. 03-13 10:40:41.179: I/Unity(1347): SHOW ADV FINISHED
    27.  
    28. 03-13 10:41:10.389: I/Unity(1347): ENABLED Called
    29. 03-13 10:41:10.389: I/ADMOB(1347): FunctionCall: 2  Received PUB_ID:   ADV_SIZE: -1   Orientation: -1  pos_1: -1   pos_2: -1  isTesting: false   AnimationInType: -1   AnimationOutType: -1     levelOfDebug: -1
    30. 03-13 10:41:10.389: I/Unity(1347): ENABLED FINISHED
    31.  
    32. 03-13 10:41:10.389: I/Unity(1347): SHOW ADV Called
    33. 03-13 10:41:10.399: I/ADMOB(1347): FunctionCall: 4  Received PUB_ID:   ADV_SIZE: -1   Orientation: -1  pos_1: -1   pos_2: -1  isTesting: false   AnimationInType: -1   AnimationOutType: -1     levelOfDebug: -1
    34. 03-13 10:41:10.399: I/Unity(1347): SHOW ADV FINISHED
    35.  
    36. 03-13 10:51:05.009: I/Unity(1347): HIDE ADV Called
    37. 03-13 10:51:05.029: I/ADMOB(1347): FunctionCall: 3  Received PUB_ID:   ADV_SIZE: -1   Orientation: -1  pos_1: -1   pos_2: -1  isTesting: false   AnimationInType: -1   AnimationOutType: -1     levelOfDebug: -1
    38. 03-13 10:51:05.029: I/Unity(1347): HIDE ADV FINISHED
    39.  
    40. 03-13 10:51:07.919: I/wpa_supplicant(303): [CTRL_IFACE]SIGNAL_POLL
    41. 03-13 10:51:10.929: I/wpa_supplicant(303): [CTRL_IFACE]SIGNAL_POLL
    42. 03-13 10:51:10.999: I/InputDispatcher(145): Application is not responding: AppWindowToken{41427240 token=Token{411f1d10 ActivityRecord{4128f6c0 com.nolex.zombie/com.unity3d.player.UnityPlayerNativeActivity}}} - Window{41243fa8 com.nolex.zombie/com.unity3d.player.UnityPlayerNativeActivity paused=false}.  5004.6ms since event, 5003.9ms since wait started
    43. 03-13 10:51:10.999: I/WindowManager(145): Input event dispatching timed out sending to com.nolex.zombie/com.unity3d.player.UnityPlayerNativeActivity
    44. 03-13 10:51:11.039: I/Process(145): Sending signal. PID: 1347 SIG: 3
    45. 03-13 10:51:11.039: I/dalvikvm(1347): threadid=3: reacting to signal 3
    46. 03-13 10:51:11.079: I/dalvikvm(1347): Wrote stack traces to '/data/anr/traces.txt'
    47. 03-13 10:51:11.089: I/Process(145): Sending signal. PID: 145 SIG: 3
    48. 03-13 10:51:11.089: I/dalvikvm(145): threadid=3: reacting to signal 3
    49. 03-13 10:51:11.209: I/dalvikvm(145): Wrote stack traces to '/data/anr/traces.txt'
    50. 03-13 10:51:11.209: I/Process(145): Sending signal. PID: 315 SIG: 3
    51. 03-13 10:51:11.209: I/dalvikvm(315): threadid=3: reacting to signal 3
    52. 03-13 10:51:11.209: I/dalvikvm(315): Wrote stack traces to '/data/anr/traces.txt'
    53. 03-13 10:51:11.219: I/Process(145): Sending signal. PID: 211 SIG: 3
    54. 03-13 10:51:11.219: I/dalvikvm(211): threadid=3: reacting to signal 3
    55. 03-13 10:51:11.219: I/dalvikvm(211): Wrote stack traces to '/data/anr/traces.txt'
    56. 03-13 10:51:11.499: D/dalvikvm(145): GC_CONCURRENT freed 595K, 11% free 9443K/10567K, paused 3ms+17ms
    57. 03-13 10:51:11.729: D/dalvikvm(145): GC_EXPLICIT freed 311K, 10% free 9555K/10567K, paused 4ms+9ms
    58. 03-13 10:51:12.299: E/ActivityManager(145): ANR in com.nolex.zombie (com.nolex.zombie/com.unity3d.player.UnityPlayerNativeActivity)
    59. 03-13 10:51:12.299: E/ActivityManager(145): Reason: keyDispatchingTimedOut
    60. 03-13 10:51:12.299: E/ActivityManager(145): Load: 2.1 / 2.15 / 2.11
    61. 03-13 10:51:12.299: E/ActivityManager(145): CPU usage from 5999ms to 0ms ago:
    62. 03-13 10:51:12.299: E/ActivityManager(145):   57% 1347/com.nolex.zombie: 50% user + 7.5% kernel / faults: 423 minor
    63. 03-13 10:51:12.299: E/ActivityManager(145):   7.8% 115/surfaceflinger: 4.6% user + 3.1% kernel
    64. 03-13 10:51:12.299: E/ActivityManager(145):   2.3% 117/mediaserver: 1.6% user + 0.6% kernel
    65. 03-13 10:51:12.299: E/ActivityManager(145):   1% 1396/kworker/u:0: 0% user + 1% kernel
    66. 03-13 10:51:12.299: E/ActivityManager(145):   0.8% 445/kworker/u:3: 0% user + 0.8% kernel
    67. 03-13 10:51:12.299: E/ActivityManager(145):   0.5% 3/ksoftirqd/0: 0% user + 0.5% kernel
    68. 03-13 10:51:12.299: E/ActivityManager(145):   0.5% 1295/kworker/u:4: 0% user + 0.5% kernel
    69. 03-13 10:51:12.299: E/ActivityManager(145):   0.3% 145/system_server: 0.1% user + 0.1% kernel / faults: 20 minor
    70. 03-13 10:51:12.299: E/ActivityManager(145):   0.3% 211/com.android.systemui: 0.3% user + 0% kernel / faults: 1 minor
    71. 03-13 10:51:12.299: E/ActivityManager(145): 72% TOTAL: 57% user + 13% kernel + 0.3% iowait + 0.3% softirq
    72. 03-13 10:51:12.299: E/ActivityManager(145): CPU usage from 733ms to 1253ms later:
    73. 03-13 10:51:12.299: E/ActivityManager(145):   60% 1347/com.nolex.zombie: 50% user + 9.4% kernel
    74. 03-13 10:51:12.299: E/ActivityManager(145):     54% 1365/UnityMain: 47% user + 7.5% kernel
    75. 03-13 10:51:12.299: E/ActivityManager(145):     3.7% 1364/lex.zombie: 3.7% user + 0% kernel
    76. 03-13 10:51:12.299: E/ActivityManager(145):     1.8% 1367/FMODAudioDevice: 1.8% user + 0% kernel
    77. 03-13 10:51:12.299: E/ActivityManager(145):     1.8% 1368/Thread-110: 0% user + 1.8% kernel
    78. 03-13 10:51:12.299: E/ActivityManager(145):   4% 115/surfaceflinger: 0% user + 4% kernel
    79. 03-13 10:51:12.299: E/ActivityManager(145):     2% 124/SurfaceFlinger: 0% user + 2% kernel
    80. 03-13 10:51:12.299: E/ActivityManager(145):     1% 131/Binder Thread #: 0% user + 1% kernel
    81. 03-13 10:51:12.299: E/ActivityManager(145):     1% 1137/Binder Thread #: 1% user + 0% kernel
    82. 03-13 10:51:12.299: E/ActivityManager(145):   3.8% 145/system_server: 0% user + 3.8% kernel / faults: 1 minor
    83. 03-13 10:51:12.299: E/ActivityManager(145):     3.8% 177/InputDispatcher: 0% user + 3.8% kernel
    84. 03-13 10:51:12.299: E/ActivityManager(145):   0.9% 6/rcu_kthread: 0% user + 0.9% kernel
    85. 03-13 10:51:12.299: E/ActivityManager(145):   1% 117/mediaserver: 0% user + 1% kernel
    86. 03-13 10:51:12.299: E/ActivityManager(145):     1% 140/AudioOut_1: 0% user + 1% kernel
    87. 03-13 10:51:12.299: E/ActivityManager(145): 86% TOTAL: 55% user + 21% kernel + 9.6% iowait
     
  21. MingRui

    MingRui

    Joined:
    Jul 4, 2012
    Posts:
    1
    Can't download the Attachments.
    I wonder if it is some bug in the forum.
    When I click the link, I am redirected to a 1x1 gif file.

    Edit: Never mind, I tried in another computer and it worked...
     
    Last edited: Mar 16, 2013
  22. mancuso

    mancuso

    Joined:
    Dec 5, 2011
    Posts:
    59
    I'm getting the following errors when I run my app:

    $1070uav.jpg

    Using Unity 4.1.0f4, any idea what it can be?

    ----------------

    Nevermind, I'm an idiot. It works, just had to run it on my tablet not the editor. doh! :D
     
    Last edited: Mar 19, 2013
  23. rickylall

    rickylall

    Joined:
    Mar 20, 2013
    Posts:
    4
    Hi, great job with the plugin. I am currently testing this for the game that I am making.
    One question though -> How can I remove the enable, disable and show/hide buttons?

    Never mind, I got it...Still in the learning phase of Unity :p
     
    Last edited: Mar 22, 2013
  24. Jawad

    Jawad

    Joined:
    Nov 6, 2012
    Posts:
    140
    when we have to publish our game, Should we false the IsTrue boolean or it remains true???
     
  25. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    Hi Jawad,
    Where is isTrue boolean? There is only one boolean present for isTesting. You can uncheck it, when not in testing mode. but it wont affect debug log because logs are being controlled by LevelOfDebug Enum.
     
  26. Jawad

    Jawad

    Joined:
    Nov 6, 2012
    Posts:
    140
    Yes isTesting...is it effect our earnings with admob??
     
  27. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    Not at all. while isTesting is true, you'll get test ads from Admob server, so due to debug process your eCPM wont get affect(reduce, due to request from same device everytime, Admob server is smart enough).... Keep isTesting FALSE when you finished you game debugging.
     
    Last edited: Mar 29, 2013
  28. Jawad

    Jawad

    Joined:
    Nov 6, 2012
    Posts:
    140
    ok thnx alot dear.... :)
     
  29. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    No Problems... man..
     
  30. DEEP WAVE

    DEEP WAVE

    Joined:
    Jan 6, 2013
    Posts:
    10
    Hi MicroEyes,

    Thank you for your plugin, it's really nice that you decided to publish it for free. Everything works great but I have small problem with displaying IAB Leaderboard ad. It will have resolution 728x90 but on my Nexus 7 it is too big (about 900x130px). What I should do?

    Thanks for your time :)
     
  31. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    Hi DeepWave,
    Please try using SMART_BANNER. Give me your feedback.
     
    Last edited: Mar 31, 2013
  32. DEEP WAVE

    DEEP WAVE

    Joined:
    Jan 6, 2013
    Posts:
    10
    OK, I made some tests on my devices (Nexus 7 and LG P990). First of all, I have to say that i did factory reset on these devices: my Nexus 7 has stock firmware and my LG P990 has CyanogenMod 10. Ob both there is Android 4.2.2. There are results of my tests:

    1. When I use IAB_LEADERBOARD ad (it should have resolution 728x90), I have ads with following resolutions:
    Nexus 7: about 900x130 px
    LG P990: don't showing

    2. When I use IAB_BANNER:
    Nexus 7: 620x75 px
    LG P990: 728x90 px

    3. When I use BANNER:
    Nexus7: 430x70 px
    LG P990: 480x75 px

    4. When I use SMART_BANNER (this solution isn't the best for me because my app display only text ads):
    Nexus7: 1280x70 px or 730x70 px (only text ads I see ;/)
    LG P990: 800x55 px (only text)

    Everything looks like that every ad is scalling up to higher. I also see that ads aren't so sharp (there is a big blur on non-text ads), so maybe there is a problem.

    Sorry for my bad english, today I have a big headache ;/
     
  33. Robert1000

    Robert1000

    Joined:
    Nov 20, 2012
    Posts:
    5
  34. javanoob

    javanoob

    Joined:
    Aug 15, 2012
    Posts:
    50
    Would love updates here too please :) Excellent :)
     
  35. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309

    Hi DeepWave,
    I have two more suggestions...
    1. Download test app(apk) test project(unity project) from first page. deploy build from them.
    2. From device Logs, whenever Admob package request ads from server, it logs size of ads. please check for it too. Log comes under Tag: "Admob" (without quotes) text should be start with "Requesting ad ....... "


    Please let me know, if you get something...
     
  36. DEEP WAVE

    DEEP WAVE

    Joined:
    Jan 6, 2013
    Posts:
    10
    OK, I download Unity Admob project and compile it but the problem wasn't solved. The ad (I have made only one tests with IAB Leaderboard) takes too big part of the screen. Then, I can calculate it's resolution and it is like in my previous post. It looks like that my devices have bigger DPI than normal but on the other hand it's so crazy conclusion. Every ad I used is scale up - it's really interesting behaviour...

    Tomorrow I can update my SDK but I think there won't be a change because I installed it two months ago.
     
  37. Robert1000

    Robert1000

    Joined:
    Nov 20, 2012
    Posts:
    5
    Hi, after some testing I have detected that the height of the smart banner seems to be different on devices with different screen resolution. I'm using the banner on the top of a landscape screen and need to know the height of the banner in order to set the right position-height for my following title bar.

    Is there a chance to get always the current height of the smart banner and if so how will it work?

    Thanks in advance!
     
  38. DEEP WAVE

    DEEP WAVE

    Joined:
    Jan 6, 2013
    Posts:
    10
    Ok, MicroEyes, my wrong. I was today looking for any information about scaling ads on Android platform. And I know now that Admob ads haven't got constant resolution (like 320x50 px). However, the fact how big is ad is dependent on device's resolution. So, to sum up, I'm sorry that I waste your time and big thanks for your patience ;)

    Robert1000, yeach, Smart Banner will have different sizes on devices with various resolutions. Here you are a list with resolutions which will have the Smart Banner dependent on situation: https://developers.google.com/mobile-ads-sdk/docs/admob/smart-banners
     
  39. Robert1000

    Robert1000

    Joined:
    Nov 20, 2012
    Posts:
    5
    Deep Wave, thanks for your Info, but I'm not sure if that table will really true for all conditions.. So what height will the banner has on a android table with 1024 x 600? I have tested it on a galaxy 7" tab and it seems that the height will be not 90 pix and also not 50. Maybe there is a function in the SDK which will provide the current height - but I haven't seen something like this....:-(
     
  40. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    Hi Robert,
    Yes you can see. From device Logs, whenever Admob package request ads from server, it logs size of ads. please check for it too. Log comes under Tag: "Admob" (without quotes) text should be start with "Requesting ad ....... "
     
  41. DEEP WAVE

    DEEP WAVE

    Joined:
    Jan 6, 2013
    Posts:
    10
    Yeach, this behaviour is connected with scaling ads up and down dependent on device's resolution. In other words, Admob SDK is going to have ad which takes the same part of screen (for example 1/5 height and 1/3 width). The result is that the ad is a constant of yout game's layout. But, unfortunately, this mechanism don't work properly in every situation. Here you are a topic about this:

    https://groups.google.com/forum/?fromgroups=#!topic/google-admob-ads-sdk/sFRnGLKHrUI
     
  42. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309

    Hi DeepWave,
    I observed that thing too. Smart Banner works with you current device resolution, may be it is maintaining kind of ratio between height width of Ad according to device. But about stretching Ad out of screen, i have no idea can't suggest anything until i see myself work around it.
     
  43. vinzer_x

    vinzer_x

    Joined:
    Apr 2, 2013
    Posts:
    7
    Awesome. MicroEyes, thanks for providing this to the community. Two thumbs up (if I have a third one, I'd also be pointing it up :D ). I just have to ask though if there's a possibility for interstitial ads to be supported too? I don't mean to demand, I only ask. In any case, the plugin already works well. Thanks again! :D
     
  44. Robert1000

    Robert1000

    Joined:
    Nov 20, 2012
    Posts:
    5
    Hello MicroEyes, unfortunately that log info will not help very much, because I want to go sure, to have always the right distance from top screen to my title bar and I hoped that it would be possible to get the banner height before rendering the level. For getting the info out of the log I have to test it on all available and also future available devices and that is not possible for me.

    Anyway thanks for your help.
     
  45. wana7262

    wana7262

    Joined:
    Jul 2, 2012
    Posts:
    95
    where to change my own packagename???
    i replaced ID with mine but ads are not showing....!!!!
     
  46. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    Hi Wana7262,
    Please follow instructions from first Page. Please don't try in editor mode, use device to get ads.
     
  47. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    Hi vinzer_x,
    Thanks for your review. I'll add Interstitial Ads in next update.
     
  48. wana7262

    wana7262

    Joined:
    Jul 2, 2012
    Posts:
    95
    i followed ur instruction i just replaced my app id and test it on my device... but no adds :(
     
  49. MicroEyes

    MicroEyes

    Joined:
    Jul 3, 2012
    Posts:
    309
    Can you forward your device logs?
     
  50. wana7262

    wana7262

    Joined:
    Jul 2, 2012
    Posts:
    95
    yea sure...one question how can i call enableads() and showAds() functions through other objects or scripts???
     
unityunity