tag:blogger.com,1999:blog-7763566905460067738.post164368151510637939..comments2023-10-24T05:25:23.602-04:00Comments on Jacob Gable: MoAds - Custom Win Phone 7 Ad Control with AdMob supportJacob Gablehttp://www.blogger.com/profile/06143537581139815312noreply@blogger.comBlogger24125tag:blogger.com,1999:blog-7763566905460067738.post-32111819381915256172014-01-23T12:18:15.607-05:002014-01-23T12:18:15.607-05:00Not sure, it's been over 3 years since I'v...Not sure, it's been over 3 years since I've used it.Jacob Gablehttps://www.blogger.com/profile/06143537581139815312noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-15631663145430876342014-01-23T11:22:13.936-05:002014-01-23T11:22:13.936-05:00Hi Jacob,
does this control work always ? I get ...Hi Jacob, <br /><br />does this control work always ? I get 'connection error' on both the emulator and the device (windows phone 7).<br /><br />thanks in advance,<br />Domi <br />Belgium<br />Dominique HUGOhttp://www.gosymbian.comnoreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-42434013176130916042011-02-09T06:14:59.748-05:002011-02-09T06:14:59.748-05:00So, you just used your personal homepage as URL? H...So, you just used your personal homepage as URL? However, this URL won't interact with admob at any time later?Unknownhttps://www.blogger.com/profile/15317949871594357998noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-59096823816709700462011-02-08T19:54:14.619-05:002011-02-08T19:54:14.619-05:00I used the SmartPhone web. I used my web services...I used the SmartPhone web. I used my web services site url, but I don't know that it really matters.Jacob Gablehttps://www.blogger.com/profile/06143537581139815312noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-69791747619262351542011-02-08T18:15:33.201-05:002011-02-08T18:15:33.201-05:00What kind of application did you create at admob? ...What kind of application did you create at admob? You can check this screenshot. Feel free to make comments there: https://docs0.google.com/drawings/edit?id=1ajmRPp8BImu2sZLxkzwNTD8TqW_K7nHGuerIte8IRn4&authkey=CO6rrvAB<br /><br /><br />(I'm outside of US. So, I'm gonna use with your solution)Unknownhttps://www.blogger.com/profile/15317949871594357998noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-62761835759230861422011-02-03T16:33:37.338-05:002011-02-03T16:33:37.338-05:00@Bill: Then in the AdMobService.cs you'll get ...@Bill: Then in the AdMobService.cs you'll get an error about the client not being there, replace the line with this:<br /><br />base.Headers["User-Agent"] = userAgent;Jacob Gablehttps://www.blogger.com/profile/06143537581139815312noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-78887950637196626972011-02-03T16:31:23.691-05:002011-02-03T16:31:23.691-05:00@Bill: sorry that was in the BaseJsonService.cs cl...@Bill: sorry that was in the BaseJsonService.cs class in the JSonHelpers\Service4u2Lib\Json directory. Around line 229.Jacob Gablehttps://www.blogger.com/profile/06143537581139815312noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-45785236685627625982011-02-03T16:29:41.844-05:002011-02-03T16:29:41.844-05:00@Bill It looks like you're right about the web...@Bill It looks like you're right about the webclient sharing being the problem. This is actually fixed on the latest codeplex source, but you should be able to copy the changes if you feel up to it. Here is what to do;<br /><br />1. Remove the static client property that is shared<br />2. Remove the constructor stuff dealing with the client property.<br />3. Replace the last StartService (The main one that does all the work) with this:<br /><br />public WebHeaderCollection Headers { get; private set; }<br /> /// summary><br /> /// Starts the service call.<br /> /// </summary><br /> /// <param name="serviceUri">The service URI.</param><br /> /// <param name="method">The method.</param><br /> /// <param name="postData">The post data.</param><br /> protected virtual void StartServiceCall(Uri serviceUri, HttpMethod method, ContentType type, string postData)<br /> {<br /> var client = new WebClient();<br /><br /> client.Headers = this.Headers;<br /><br /> if (method == HttpMethod.GET)<br /> {<br /> client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);<br /><br /> // Remove the content type header, in case it messes with our get.<br /> if (client.Headers["Content-Type"] != null)<br /> client.Headers["Content-Type"] = null;<br /><br /> client.DownloadStringAsync(serviceUri);<br /> }<br /> else<br /> {<br /> client.UploadStringCompleted += new UploadStringCompletedEventHandler(client_UploadStringCompleted);<br /><br /> switch (type)<br /> {<br /> case ContentType.UrlEncoded:<br /> client.Headers["Content-Type"] = "application/x-www-form-urlencoded";<br /> break;<br /> case ContentType.JSON:<br /> client.Headers["Content-Type"] = "application/json";<br /> break;<br /> default:<br /> client.Headers["Content-Type"] = "application/x-www-form-urlencoded";<br /> break;<br /> }<br /> client.UploadStringAsync(serviceUri, "POST", postData);<br /> }<br /> }<br /><br />That should do the trick. Thanks for the input.Jacob Gablehttps://www.blogger.com/profile/06143537581139815312noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-78488437471143897062011-02-03T16:09:06.772-05:002011-02-03T16:09:06.772-05:00Hi Jacob, it's bill again :)
I found another t...Hi Jacob, it's bill again :)<br />I found another thing in your control. It's difficult to reproduce it but it needs to be fixed.<br />There is a webClient exception about not supported concurrent I/O operations. This exception is raised when the 3G signal is very poor but there is connection. I think the problem is that you try to reuse the same webclient without checking if the previous is completed.Billnoreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-91980844566560813492011-02-01T13:03:04.222-05:002011-02-01T13:03:04.222-05:00yes that did the job thanx :)yes that did the job thanx :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-89720821417217870742011-01-31T11:27:55.991-05:002011-01-31T11:27:55.991-05:00@Bill: Here is some example code you can paste int...@Bill: Here is some example code you can paste into AdDisplayControl.cs<br /><br />public void StopRefreshing()<br />{<br /> adReloadTimer.Stop();<br />}<br /><br />public void Dispose()<br />{<br /> this.StopRefreshing();<br />}Jacob Gablehttps://www.blogger.com/profile/06143537581139815312noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-50597121634297979642011-01-31T11:26:26.216-05:002011-01-31T11:26:26.216-05:00@Bill: That seems entirely plausible. I don't...@Bill: That seems entirely plausible. I don't stop the timer that refreshes the ads when you navigate to a new page. You can fix this by adding a method called StopRefresh in the AdDisplayControl class. This method should just call adReloadTimer.Stop(). You can either call this before you navigate to the next page, or go ahead and implement the IDisposable interface and call that method on dispose.Jacob Gablehttps://www.blogger.com/profile/06143537581139815312noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-75096951935448224452011-01-30T16:05:54.950-05:002011-01-30T16:05:54.950-05:00I think there is a memory leak in the control. I h...I think there is a memory leak in the control. I have an ad in the second page of my application. Each time I go to the second page and then back to the first page (by closing the 2nd page) I see an increase in the total memory used in my application (between 2mb and 4mb). I noticed that threads created by the control for fetching ads are not terminated when I close the page. So each time I go to the 2nd page I have +1 thread that throws a WebException when I have no connection. So after 10 visits I can see 10 WebExceptions. <br />Can you confirm this? And is there some way that it can be fixed?Billnoreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-85365291240311630732011-01-18T09:59:06.883-05:002011-01-18T09:59:06.883-05:00I've noticed that happening on other web brows...I've noticed that happening on other web browser tasks, not just for the ad mob ones. Especially in the emulator. The code that handles the click and starts the web browser task can be found in AdDisplay.cs in a method called HandleAdTouch()<br /><br />Once I hand off to the web browser task, I really have no control over what happens. But it would be good to check that there is actually an ad URL being parsed and set correctly.Jacob Gablehttps://www.blogger.com/profile/06143537581139815312noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-8336763591845211012011-01-18T09:25:16.471-05:002011-01-18T09:25:16.471-05:00Jacob,
Thanks for publishing this. Although the ...Jacob,<br /><br />Thanks for publishing this. Although the MS Pubcenter ad control makes this somewhat obsolete in the US, for outside the US, other ad providers are still necessary, and I would like to make this work.<br /><br />I have it hooked up and displaying ads, but when I click on the ad, it goes to the wrong tab in the browser and displays a blank screen. Any ideas?<br /><br />- RickRick Keeneyhttp://richard.keeney.integra.netnoreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-6415215802374521752010-12-03T18:13:37.842-05:002010-12-03T18:13:37.842-05:00I think I used either the IPhone or Mobile website...I think I used either the IPhone or Mobile website choice.Jacob Gablehttps://www.blogger.com/profile/06143537581139815312noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-65845501625008314102010-12-03T05:28:32.486-05:002010-12-03T05:28:32.486-05:00How did you get the publisher id from admob? It re...How did you get the publisher id from admob? It requires you to add a site or an app type and WP7 is not an option. How did you get around this?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-52435137489178070222010-11-11T14:00:23.125-05:002010-11-11T14:00:23.125-05:00Thanks, be sure to check out the follow up post if...Thanks, be sure to check out the follow up post if you are interested in creating your own ad providers:<br /><br />http://jacob4u2.blogspot.com/2010/08/show-custom-in-house-ads-in-win-phone-7.htmlJacob Gablehttps://www.blogger.com/profile/06143537581139815312noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-37299839684839765312010-11-11T13:49:33.072-05:002010-11-11T13:49:33.072-05:00Thanks for the great job with the Control Jacob. F...Thanks for the great job with the Control Jacob. For people like me living outside the US it is currently the only solution for Ad Supported Trial Versions on WP7.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-49725865928945339342010-10-13T08:33:00.895-04:002010-10-13T08:33:00.895-04:00@anon
Check the previous comments;
"The cook...@anon<br />Check the previous comments; <br />"The cookie string is a way to uniquely identify a "client". It's used for analytics. It should really be generated from some unique device ID, but in the beta I haven't figured out how we can get a unique id for the phone."<br /><br />As for ads not showing up, AdMob is sketchy about showing ads for people with little or no traffic. If you don't get enough traffic/impressions they won't show you any ads. If it is working in test mode, then more than likely admob is just not serving you ads. I'd recommend the MS Ad Control from here; http://advertising.microsoft.com/mobile-appsJacob Gablehttps://www.blogger.com/profile/06143537581139815312noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-5961802989850680642010-10-13T06:30:53.399-04:002010-10-13T06:30:53.399-04:00ups, cannot post xaml code here...
here is the cod...ups, cannot post xaml code here...<br />here is the code I am using:<br /><br />http://dl.dropbox.com/u/3784027/moads.txtAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-63549003096660946882010-10-13T06:26:03.492-04:002010-10-13T06:26:03.492-04:00Hi
I'm having trouble getting it to work. Thi...Hi<br /><br />I'm having trouble getting it to work. This is my code:<br /><br /><b><br /><br /><br /><br /></b><br /><br />It is loading, but I dont see any add. What is cookiestring and AdKeywords for?<br /><br />ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-19339352178430835092010-09-07T23:42:11.641-04:002010-09-07T23:42:11.641-04:00The cookie string is a way to uniquely identify a ...The cookie string is a way to uniquely identify a "client". It's used for analytics. It should really be generated from some unique device ID, but in the beta I haven't figured out how we can get a unique id for the phone.<br /><br />More information about the AdMob request parameters are at: http://developer.admob.com/wiki/Requests. But for the most part, the AdMob Documentation is pretty useless.<br /><br />The "o" parameter is what you're looking for.Jacob Gablehttps://www.blogger.com/profile/06143537581139815312noreply@blogger.comtag:blogger.com,1999:blog-7763566905460067738.post-50628504823712059082010-09-07T10:43:11.777-04:002010-09-07T10:43:11.777-04:00What's the cookieString needed for and what va...What's the cookieString needed for and what value would I put?<br /><br />thanks,<br />SamSam Jarawanhttps://www.blogger.com/profile/16300331234907205647noreply@blogger.com