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 

94 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. You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you. BizOp

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

    ReplyDelete
  18. 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
  19. 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
  20. 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
  21. I certainly appreciate your stuff provided in the blogs.
    logo companies designers

    ReplyDelete
  22. Continue the good work; keep posting more n more n more.
    top 10 website design company

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

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

    ReplyDelete
  27. 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
  28. I’m agitated all these article directories. It sure would be nice to have every article directory that instantly accepts articles. 해외 사이트

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

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

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

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

    ReplyDelete
  33. 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
  34. 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
  35. 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
  36. 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
  37. I am glad to be a visitor of this consummate web site! , appreciate it for this rare info ! . Fertility Clinic

    ReplyDelete
  38. 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
  39. 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
  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. ufabet

    ReplyDelete
  41. 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
  42. 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
  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. undefined

    ReplyDelete
  44. 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
  45. 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
  46. you will need support or suggestions, write me privately.
    I interested in your implementation/use case.
    the best kera4d
    Togel2win

    ReplyDelete
  47. 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
  48. I like this website it's a master piece! Glad I found this on google. evokewellness.com/disturbing-behaviors-drunk-people-exhibit/

    ReplyDelete
  49. 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
  50. As I website owner I conceive the content material here is rattling excellent , thanks for your efforts. buy youtube subscribers

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

    ReplyDelete
  52. 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
  53. 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
  54. 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
  55. when it comes to free email, i found gmail to be the best and yahoo the worst~ Dressoirs

    ReplyDelete
  56. 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
  57. 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
  58. when i am downloading stuffs over the internet, psp game downloads are always my priority’ n95 mask made in usa

    ReplyDelete
  59. 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
  60. 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
  61. when i am downloading stuffs over the internet, psp game downloads are always my priority’ Removal company Hertfordshire

    ReplyDelete
  62. 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
  63. 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
  64. 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
  65. 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
  66. 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
  67. 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
  68. Fantastic report with Remarkable get ready!Thanks for such a vital report. I actually just consider pleasure in for this excellent information..สล็อตแตกง่าย

    ReplyDelete
  69. 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
  70. 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
  71. 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
  72. This is actually an unbelievable seek for me. I have bookmarked it and I am looking ahead to wanting through new article content or site posts or internet site posts. Sustain The nice reason!.สล็อตเว็บใหญ่

    ReplyDelete
  73. 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
  74. 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
  75. Enjoyable site web site web site, I will keep making an attempt out this blog website fairly often.บาคาร่าวอเลท

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

    ReplyDelete
  77. encomendasdofacebook.blogspot.com/2021/07/money-train-2-money-train-aaaaaaa-aaaa.htmlสล็อตแตกง่าย

    ReplyDelete
  78. 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
  79. I really amazed pursuing look at this as remaining a consequence of some good quality objective and academic thoughts . I just wanna say a lot of thanks for The author and wish you every probably the greatest for coming!.เว็บสล็อต

    ReplyDelete
  80. 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
  81. 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
  82. It's really a outstanding publishing thanks for sharing this instructive awareness. I'm heading to take a look at your internet site routinely for just a few most up-to-day build. I'll drop by your web site routinely For lots of most up-to-day submit.เว็บ ตรง

    ReplyDelete
  83. 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
  84. Pretty pleasant submit. I just stumbled on your weblog and planned to state that I've genuinely loved searching your weblog posts. After all I’ll be subscribing to the feed and I hope you produce once more before long!สล็อต เว็บ ตรง

    ReplyDelete
  85. 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
  86. 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
  87. 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
  88. เราพร้อมให้ผู้เล่น ได้ใช้งานทุก ๆ คน และ โบนัสฟรี 100 รูปภาพที่ สวยงาม และ น่าเล่น และ การอัพเดตเกม สล็อตจาก เรานี้ได้ทุก ๆ ทดลองเล่นสล็อต

    ReplyDelete
  89. 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
  90. 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
  91. นิว 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
  92. 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
  93. 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