Rapid Subscribe Android App

Rapid Subscribe Android App
Rapid Subscriber

Recent Posts

How to create an Admob Banner ad in Android App | Place Admob Banner Ads




If you are an Android Developer and want to earn money from your android app. Then you have to place Ads in your Android App.

There is some type of ads you can place in your Android App.



Today, In this post we learn how to create a Banner ad in your Android App.

To place a Banner Ad, we have to create a new Admob Account and add your app there and then create a new Banner Ad there and create Ad unit Id. seen in the pictures below.


Your Application Name


Type of Ad


Banner Ad set-up


Then, in Android Studio, first, we have to add new google ads dependency in our app-level Gradle file.

app-level Gradle file
 implementation 'com.google.android.gms:play-services-ads:18.3.0'  

Then, we create a banner ad layout in our XML file.

MainActivity.xml

 <?xml version="1.0" encoding="utf-8"?>  
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
   xmlns:app="http://schemas.android.com/apk/res-auto"  
   xmlns:tools="http://schemas.android.com/tools"  
   android:layout_width="match_parent"  
   android:layout_height="match_parent"  
   tools:context=".MainActivity">  
   <TextView  
     android:layout_width="wrap_content"  
     android:layout_height="wrap_content"  
     android:text="Hello World!"  
     app:layout_constraintBottom_toBottomOf="parent"  
     app:layout_constraintLeft_toLeftOf="parent"  
     app:layout_constraintRight_toRightOf="parent"  
     app:layout_constraintTop_toTopOf="parent" />  
   <com.google.android.gms.ads.AdView  
     android:id="@+id/adView"  
     android:layout_width="wrap_content"  
     android:layout_height="wrap_content"  
     android:layout_alignParentBottom="true"  
     android:layout_centerHorizontal="true"  
     android:layout_gravity="bottom|center"  
     app:adSize="BANNER"  
     app:adUnitId="@string/bannerAdMobId">  
     </com.google.android.gms.ads.AdView>  
 </LinearLayout>  

Then place your application id in your manifest.xml under meta-data tag

For Application Id open your Admob Account and open your Ad unit then click on implementation instructions, Upper one which contains tilde (~) sign is your Application id and another one is your Ad unit Id.



Application Id and Ad Unit Id


AndroidManifest.xml

 <meta-data  
       android:name="com.google.android.gms.ads.APPLICATION_ID"  
       android:value="@string/bannerAdAppId" />  

Then create an instance and find the id in MainActivity.java and Load your Banner Ad

MainActivity.java
 public class MainActivity extends AppCompatActivity {  
   AdView madview;  
   @Override  
   protected void onCreate(Bundle savedInstanceState) {  
     super.onCreate(savedInstanceState);  
     setContentView(R.layout.activity_main);  
     madview = findViewById(R.id.adView);  
     AdRequest adRequest = new AdRequest.Builder().addTestDevice("XXXXXXXXXXXXXXXXXXXXXX").build();  
     madview.loadAd(adRequest);  
   }  
 }  

 Here, we load our ad and also add a test device because we run this ad through debugging. For test device id you can see logs of Ad-request inside run tab in Android Studio.


Find Test Device Id to run Banner Ad
  


Follow us for more posts like this, 
Subscribe Harpreet studio on Youtube  
Like Harpreet Studio on Facebook  
Follow me on Instagram 

86 comments:

  1. Great articles and great layout. Your blog post deserves all of the positive feedback it’s been getting. Phone Spy Apps

    ReplyDelete
  2. As always as widespread contractors go look at this web-site, app company
    agencies you're in inappropriate hands with those men!

    ReplyDelete
  3. The evolution of modern business is reflected in the growth of digital agencies. The concept of a digital agency, being relatively young, is clouded, vague and varying. Digital marketing

    ReplyDelete
  4. Some really marvelous work on behalf of the owner of this web site , dead great subject matter. iOS developer

    ReplyDelete
  5. Some really marvelous work on behalf of the owner of this web site , dead great subject matter. unlimited reseller hosting

    ReplyDelete
  6. Some really marvelous work on behalf of the owner of this web site , dead great subject matter. kiss918 apk

    ReplyDelete
  7. Some really marvelous work on behalf of the owner of this web site , dead great subject matter. kiss918

    ReplyDelete
  8. I like this site so much, saved to favorites . pussy888

    ReplyDelete
  9. Some really marvelous work on behalf of the owner of this web site , dead great subject matter. book accommodation in Gauteng

    ReplyDelete
  10. I absolutely love your blog and find a lot of your post’s to be exactly I’m looking for. can you offer guest writers to write content to suit your needs? I wouldn’t mind writing a post or elaborating on a few of the subjects you write in relation to here. Again, awesome weblog! XE88

    ReplyDelete
  11. Get started with wales ahead nearly every planking. Ones wales truly are a compilation of huge planks one particular depth advisors certainly is the identical to the entire hull planking however with even larger density to successfully thrust outward beyond the planking. planking ICCRC Agents in Dubai

    ReplyDelete
  12. I adore your wp web template, wherever would you obtain it through? buy copiers

    ReplyDelete
  13. Hi! Great post! Please do tell us when I will see a follow up! mega888 apk

    ReplyDelete
  14. Some really marvelous work on behalf of the owner of this web site , dead great subject matter. Islamic Apps

    ReplyDelete
  15. Quickly and easily build your web traffic and PR, which provides Web site visitors to add your page to any social bookmarking website. best reseller hosting

    ReplyDelete
  16. Great post, you have pointed out some fantastic points , I likewise think this s a very wonderful website. 안전놀이터

    ReplyDelete
  17. Thanks so much for this information. I have to let you know I concur on several of the points you make here and others may require some further review, but I can see your viewpoint. 온라인릴게임

    ReplyDelete
  18. Quickly and easily build your web traffic and PR, which provides Web site visitors to add your page to any social bookmarking website. Lodges in ladysmith

    ReplyDelete
  19. Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks nursing test bank

    ReplyDelete
  20. I certainly appreciate your stuff provided in the blogs.
    logo companies designers

    ReplyDelete
  21. House Lawyers… [...]just below, are some totally unrelated sites to ours, however, they are definitely worth checking out[...]… therapy

    ReplyDelete
  22. Good job on this article! I really like how you presented your facts and how you made it interesting and easy to understand. Thank you. Music for Sleeping

    ReplyDelete
  23. Good job on this article! I really like how you presented your facts and how you made it interesting and easy to understand. Thank you. Music for Stress Relief

    ReplyDelete
  24. Thanks for the write up! Also, just a heads up, your RSS feeds aren’t working. Could you take a look at that? เว็บหวยที่ดีที่สุด

    ReplyDelete
  25. Remarkably! It is as if you read my mind! A person appear to know therefore considerably relating to this, just like you authored the book inside it or something. I feel that you can do with a few images to drive the content residence a bit, on top of that, this really is great weblog. The outstanding study. I will definitely review again. เว็บซื้อหวยออนไลน์

    ReplyDelete
  26. I’m agitated all these article directories. It sure would be nice to have every article directory that instantly accepts articles. 해외 사이트

    ReplyDelete
  27. I’m agitated all these article directories. It sure would be nice to have every article directory that instantly accepts articles. เว็บแทงบอล

    ReplyDelete
  28. Just wanna input on few general things, The website design is perfect, the articles is very great : D. แทงบอลพรีเมียร์ลีก

    ReplyDelete
  29. Just wanna input on few general things, The website design is perfect, the articles is very great : D. สมัครแทงบอลลีกอังกฤษ

    ReplyDelete
  30. Just wanna input on few general things, The website design is perfect, the articles is very great : D. เดิมพันบอลอังกฤษ10บาท

    ReplyDelete
  31. Thank you for an additional great post. Exactly where else could anybody get that kind of facts in this kind of a ideal way of writing? I have a presentation next week, and I’m around the appear for this kind of data. CBD Doctors

    ReplyDelete
  32. Easily that good web page will clearly irrefutably regularly be well known in the midst of almost all publishing some sort of blog site individuals, mainly because conscientious information together with stories. 메이저놀이터

    ReplyDelete
  33. Easily that good web page will clearly irrefutably regularly be well known in the midst of almost all publishing some sort of blog site individuals, mainly because conscientious information together with stories. 우리카지노

    ReplyDelete
  34. I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well. https://topnotchchemstore.com

    ReplyDelete
  35. I am glad to be a visitor of this consummate web site! , appreciate it for this rare info ! . Fertility Clinic

    ReplyDelete
  36. I just found this blog and have high hopes for it to continue. Keep up the great work, its hard to find good ones. I have added to my favorites. Thank You. https://topnotchchemstore.com

    ReplyDelete
  37. Hello I am so delighted I located your site, I really located you by mistake, while I was looking on yahoo for something else, Anyways I am here now and could just like to say cheers for a tremendous post and a all round entertaining website. Please do keep up the great work. Mushrooms spores for sale

    ReplyDelete
  38. I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well. ufabet

    ReplyDelete
  39. Easily that good web page will clearly irrefutably regularly be well known in the midst of almost all publishing some sort of blog site individuals, mainly because conscientious information together with stories. ผลบอลสด7mล่าสุด

    ReplyDelete
  40. I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well. ผลบอลสด7mวันนี้

    ReplyDelete
  41. I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well. undefined

    ReplyDelete
  42. I just found this blog and have high hopes for it to continue. Keep up the great work, its hard to find good ones. I have added to my favorites. Thank You. Hardware

    ReplyDelete
  43. I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well. hidden wiki

    ReplyDelete
  44. Youre so cool! I dont suppose Ive read anything this way before. So nice to seek out somebody with many original ideas on this subject. realy we appreciate you beginning this up. this amazing site is something that is needed online, somebody with a bit of originality. valuable project for bringing a new challenge to your internet! Coworking space for rent

    ReplyDelete
  45. Surprisingly! It’s as if you read my mind! You appear to know therefore considerably relating to this, just like you wrote it in it or something. We feel that you simply can do with some pictures to drive the content residence a bit, on top of that, this really is great blog. A exceptional study. I will definitely revisit once more. evokecoconutcreek.com

    ReplyDelete
  46. As I website owner I conceive the content material here is rattling excellent , thanks for your efforts. buy youtube subscribers

    ReplyDelete
  47. I see that you are using WordPress on your blog, wordpress is the best.*:~-” kubslot

    ReplyDelete
  48. Nice post. I understand some thing very complicated on diverse blogs everyday. It will always be stimulating to see content using their company writers and practice something at their store. I’d would prefer to apply certain together with the content on my small weblog regardless of whether you do not mind. Natually I’ll supply you with a link on your internet weblog. Thanks for sharing. Seagate external hard drive

    ReplyDelete
  49. This sort of thing needs to happen! Really its a must to take a look past everything and get upset. Now this will let you take the next steps to becoming successful. Snapchat not working

    ReplyDelete
  50. After study many of the websites on the web site now, we genuinely much like your means of blogging. I bookmarked it to my bookmark internet site list and will also be checking back soon. Pls consider my web site at the same time and inform me what you consider. how to become a medical lab technician

    ReplyDelete
  51. when it comes to free email, i found gmail to be the best and yahoo the worst~ Dressoirs

    ReplyDelete
  52. I like the valuable information you offer for your articles. I will be able to bookmark your blog and feature my kids check up here generally. I am somewhat certain they are going to be informed numerous new stuff right here than anyone else! Personal reputation management online

    ReplyDelete
  53. I needed to create you the little bit of observation in order to thank you as before for these magnificent principles you have discussed above. This has been certainly pretty open-handed with people like you to allow freely precisely what many of us would’ve offered for sale as an ebook in order to make some profit on their own, certainly seeing that you might well have tried it if you wanted. Those principles likewise acted to be a great way to fully grasp most people have a similar fervor like my very own to know somewhat more in terms of this problem. I am sure there are a lot more enjoyable times up front for individuals who read carefully your blog. brievenbus voor pakjes

    ReplyDelete
  54. when i am downloading stuffs over the internet, psp game downloads are always my priority’ n95 mask made in usa

    ReplyDelete
  55. I am not sure where you’re getting your information, but great topic. I needs to spend some time learning more or understanding more. Thanks for wonderful info I was looking for this information for my mission. best heart rate monitor

    ReplyDelete
  56. My brother recommended I may like this web site. He was entirely right. This publish actually made my day. You can not consider just how so much time I had spent for this information! Thank you! user interview analysis

    ReplyDelete
  57. when i am downloading stuffs over the internet, psp game downloads are always my priority’ Removal company Hertfordshire

    ReplyDelete
  58. This sort of thing needs to happen! Really its a must to take a look past everything and get upset. Now this will let you take the next steps to becoming successful. 메이저놀이터

    ReplyDelete
  59. Easily that good web page will clearly irrefutably regularly be well known in the midst of almost all publishing some sort of blog site 먹튀폴리스

    ReplyDelete
  60. Rather than produce the same old content you have taken this subject to a whole new level . Kudos for not following the standard writing crowd. ทดลองเล่นสล็อตฟรี

    ReplyDelete
  61. This is an excellent weblog Website. I exhibit it. You've purchased loads of know-how relating to this problem, and a fantastic deal enthusiasm. Along with that, Site you find out how to create persons rally driving it, Plainly throughout the responses.สล็อตออนไลน์

    ReplyDelete
  62. it absolutely was an incredible possibility to pay a visit to this type of Web site and I am joyful to be aware of. thanks an extreme number of for supplying us a chance to have this chance..สล็อต 999

    ReplyDelete
  63. Many thanks for this amazing create, i appear on it truly fulfilling and seriously perfectly deemed out and place alongside one another. I search forward to researching your operate A lot quicker or later on.สล็อตวอเลท

    ReplyDelete
  64. Fantastic report with Remarkable get ready!Thanks for such a vital report. I actually just consider pleasure in for this excellent information..สล็อตแตกง่าย

    ReplyDelete
  65. Quite a few thanks for offering the most recent updates with regard to the dread, I anticipate undergo a great deal a lot more.บา คา ร่า วอ เลท</a

    ReplyDelete
  66. Fantastic report with Remarkable get ready!Thanks for such a vital report. I actually just consider pleasure in for this excellent information..a href="https://ipro356.com/บาคาร่า-ทรู-วอเลท-คาสิโน/">บา คา ร่า วอ เลท

    ReplyDelete
  67. Quite a few thanks for offering the most recent updates with regard to the dread, I anticipate undergo a great deal a lot more.บา คา ร่า วอ เลท

    ReplyDelete
  68. It ended up a terrific report certainly. I thoroughly savored hunting by way of it in my lunch time. Will definitely appear about and visit This great site a lot more usually. Quite a few lots of thanks for sharing.บา คา ร่า วอ เลท

    ReplyDelete
  69. I felt essentially delighted when reading via This great Website-site. This was truly seriously insightful World-wide-web site for me. I really appreciated it. This was truly a cordial compose-up. Plenty of many many thanks an entire ton!.สล็อต ฝาก-ถอน true wallet ไม่มี บัญชีธนาคาร

    ReplyDelete
  70. Enjoyable site web site web site, I will keep making an attempt out this blog website fairly often.บาคาร่าวอเลท

    ReplyDelete
  71. Enjoyable site web site web site, I will keep making an attempt out this blog website fairly often.สล็อตทรูวอเลท

    ReplyDelete
  72. You completed numerous awesome factors there. I did a lookup on the topic and located Pretty much all individuals will go together with employing your internet internet site.สล็อตxo

    ReplyDelete
  73. I discovered Which is an educational and intriguing publish so I believe so it may be vitally useful and Skilled. I want to due to endeavours You might have inbuilt generating this information and facts.เว็บสล็อตเว็บตรง

    ReplyDelete
  74. It ended up a terrific report certainly. I thoroughly savored hunting by way of it in my lunch time. Will definitely appear about and visit This great site a lot more usually. Quite a few lots of thanks for sharing.เว็บตรงสล็อต

    ReplyDelete
  75. I am able to’t feel concentrating lengthy ample to research; a lot less generate this kind of report. You’ve outdone you with this particular substance without a doubt. It is probably the best contents.เกมสล็อต

    ReplyDelete
  76. You made some decent points there. I appeared on the internet for the difficulty and found most individuals will go along with with your website. แทงบอลออนไลน์

    ReplyDelete
  77. The following time I learn a weblog, I hope that it doesnt disappoint me as much as this one. I imply, I do know it was my choice to read, however I really thought youd have something interesting to say. All I hear is a bunch of whining about one thing that you can repair should you werent too busy on the lookout for attention. ยูฟ่าเบท

    ReplyDelete
  78. When I originally commented I clicked the -Notify me when new comments are added- checkbox and today when a comment is added I am four emails with the exact same comment. Could there be by any means it is possible to get rid of me from that service? Thanks! สมัครคาสิโนออนไลน์ขั้นต่ำ5บาท

    ReplyDelete
  79. เราพร้อมให้ผู้เล่น ได้ใช้งานทุก ๆ คน และ โบนัสฟรี 100 รูปภาพที่ สวยงาม และ น่าเล่น และ การอัพเดตเกม สล็อตจาก เรานี้ได้ทุก ๆ ทดลองเล่นสล็อต

    ReplyDelete
  80. I am incapable of examining information on-line fairly typically, but I’m joyful I did at this moment. It's vitally proficiently penned, plus your specifics are well-expressed. I request you warmly, make sure you, don’t ever conclusion crafting.สล็อตออนไลน์

    ReplyDelete
  81. I am incapable of examining information on-line fairly typically, but I’m joyful I did at this moment. It's vitally proficiently penned, plus your specifics are well-expressed. I request you warmly, make sure you, don’t ever conclusion crafting.บา คา ร่า วอ เลท"

    ReplyDelete
  82. นิว I am incapable of examining information on-line fairly typically, but I’m joyful I did at this moment. It's vitally proficiently penned, plus your specifics are well-expressed. I request you warmly, make sure you, don’t ever conclusion crafting.สล็อตเว็บใหญ่

    ReplyDelete
  83. This is a good inspiring article.I'm almost proud of your excellent operate.You area certainly quite useful details. Protect it up. Retain jogging a blog site. Seeking to studying your subsequent write-up. ทางเข้าสล็อต

    ReplyDelete
  84. I look into your website often and advocate it to all people that required to boost their awareness simply. The shape of creating is great and On top of that the posts is best-notch. A lot of many thanks for that shrewdness you give the visitors! สล็อต 999

    ReplyDelete