Thursday, July 21, 2011

iAdd sample for Monotouch app.

This sample shows how to display a banner Add on a montouch app.
I'm using a simple example to show the use of AdBannerView control.
Create a sample Iphone Navigation-based project from Monodevelop.
In Main.cs/AppDelegate class/FinishedLaunching() method add the following code.

public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
        ADBannerView banner = new ADBannerView(); 
        banner.CurrentContentSizeIdentifier = "ADBannerContentSizePortrait";
        banner.AdLoaded += delegate(object sender, EventArgs e) {
        banner.Hidden = false;
        };
        banner.FailedToReceiveAd += delegate(object sender, AdErrorEventArgs e) {
        banner.Hidden = true;
        };
        banner.Frame = new System.Drawing.RectangleF(0, 30, 320, 50);
        navigationController.Add(banner);
        window.AddSubview (navigationController.View);
        window.MakeKeyAndVisible ();
        return true;
}

The banner must be set to "ADBannerContentSizePortrait" or "ADBannerContentSizeLandscape" using CurrentContentSizeIdentifier property. In this example I'm only targeting portrait layout.
There are two delegates associated with the banner.
FailedToReceiveAd - This is when there is no connection between the app and the iAdd server, the banner is hidden in this case.
AdLoaded - When the iAdd server sends the Add content to display, this is then showed on the Add.




21 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.


    rpa training in chennai | best rpa training in chennai | rpa training in chennai | rpa training in bangalore
    rpa training in pune | rpa online training

    ReplyDelete
  6. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

    rpa training in chennai | rpa training in chennai
    rpa training in pune | rpa online training | rpa training in bangalore

    ReplyDelete
  7. I appreciate your efforts because it conveys the message of what you are trying to say. It's a great skill to make even the person who doesn't know about the subject could able to understand the subject . Your blogs are understandable and also elaborately described. I hope to read more and more interesting articles from your blog. All the best.
    java training in omr | oracle training in chennai

    java training in annanagar | java training in chennai

    ReplyDelete
  8. Woah this blog is wonderful i like studying your posts. Keep up the great work! You understand, lots of persons are hunting around for this info, you could help them greatly.
    python training Course in chennai
    python training in Bangalore
    Python training institute in kalyan nagar

    ReplyDelete
  9. Excellent blog, I wish to share your post with my folks circle. It’s really helped me a lot, so keep sharing post like this
    python training in pune | python training institute in chennai | python training in Bangalore

    ReplyDelete
  10. Useful information.I am actual blessed to read this article.thanks for giving us this advantageous information.I acknowledge this post.and I would like bookmark this post.Thanks
    Data Science Training in Chennai | Data Science course in anna nagar
    Data Science course in chennai | Data science course in Bangalore
    Data Science course in marathahalli | Data Science course in btm

    ReplyDelete

  11. A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article. I am learning a lot from you.

    rpa training in electronic-city | rpa training in btm | rpa training in marathahalli | rpa training in pune

    ReplyDelete
  12. I am really very happy to find this particular site. I just wanted to say thank you for this huge read!! I absolutely enjoying every petite bit of it and I have you bookmarked to test out new substance you post.

    java training in chennai | java training in bangalore


    java training in tambaram | java training in velachery

    ReplyDelete
  13. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    Best Devops Training in pune

    ReplyDelete
  14. Greetings. I know this is somewhat off-topic, but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform like yours, and I’m having difficulty finding one? Thanks a lot.

    AWS Interview Questions And Answers

    AWS Tutorial |Learn Amazon Web Services Tutorials |AWS Tutorial For Beginners


    AWS Online Training | Online AWS Certification Course - Gangboard

    AWS Training in Toronto| Amazon Web Services Training in Toronto, Canada

    ReplyDelete
  15. Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.


    AWS Training in BTM Layout |Best AWS Training in BTM Layout

    AWS Training in Marathahalli | Best AWS Training in Marathahalli



    ReplyDelete
  16. Is your transaction process taking more time? Is your transaction not getting verified? Well, so many questions but you can get answer of every question on one platform. All you need to do is dial Myetherwallet Support Phone Number at 1-833-228-1682.Visit website:-https://www.cryptophonesupport.com/wallet/myetherwallet
    Myetherwallet Support Phone Number

    ReplyDelete
  17. This information is impressive. I am inspired with your post writing style & how continuously you describe this topic. Eagerly waiting for your new blog keep doing more.
    AWS Training in Chennai
    aws training in bangalore
    AWS Course in Chennai
    aws course in bangalore
    AWS Training centers in Chennai
    aws certification training in bangalore

    ReplyDelete