• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

ad ads to my android project

Last edited:
Upvote 0
thank u for that ; but my problem its how can i set banner in all activity

Add the admob java code to any activity you wish to display ads. And also add the admob layout to the layout resource file of those activities where you will have admob. There's also comments in the code to further explain things.

Just follow the tutorial which teaches how to ad admob to one activity. Once you know that, adding admob to more activities becomes simple.

edit: fixed spelling error :p
 
Last edited:
Upvote 0
Ad the admob java code to any activity you wish to display ads. And also ad the admob layout to the layout resource file of those activities where you will have admob. There's also comments in the code to further explain things.

Just follow the tutorial which teaches how to ad admob to one activity. Once you know that, adding admob to more activities becomes simple.
yes i adding admob to the main activity ;; but when i try with other acitvities i gat some errors
 
Upvote 0
yes i adding admob to the main activity ;; but when i try with other acitvities i gat some errors

What are the errors exactly since it doesn't help to just say you got "some errors"?

You can post code and/or error logs here wrapped in code tags:
Code:

You can also post a link to your project on github if you have it there.
 
Upvote 0
What are the errors exactly since it doesn't help to just say you got "some errors"?

You can post code and/or error logs here wrapped in code tags:
Code:

You can also post a link to your project on github if you have it there.
What are the errors exactly since it doesn't help to just say you got "some errors"?

You can post code and/or error logs here wrapped in code tags:
Code:

You can also post a link to your project on github if you have it there.
can i get your gmail i will send you the project ;; maybe i get some help for that ok
 
Upvote 0
can i get your gmail i will send you the project ;; maybe i get some help for that ok

I think it's best if you post your code or logs here or your project on github. Gmail situation doesn't really work for me. Besides handling this here means that other developers would see and possibly assist.

As I mentioned before though, it's really easy stuff. You're really just gonna copy/paste to activities you wish to display ads. It's all recent code that I updated at the beginning of the this month so you won't have to update any of it.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones