realworldincome
Aspiring developer
Profile
Posts: 36
Reg: Feb 22, 2012
location unknow...
1,160
07/12/12 04:57 AM (13 years ago)

Appbrain (applift) code insertion?

In trying to add code for an advertising interstitial to one my apps, I am getting several error messages after following Appbrain's instructions. Has anyone had experience in adding their code? If so, I would really appreciate some clarification (help) in where the following code snippets should go. So far, following the directions, all I get is errors in Eclipse in the BT_activity_base.java --- AppBrain.initApp(this); in the onCreate. Then _outside_ of onCreate (in your activity class): @Override public void onBackPressed() { AppBrain.getAds().maybeShowInterstitial(this); finish(); }
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
07/12/12 05:10 AM (13 years ago)
Where do you want the interstitials to show? I come across lots of issues adding code to the activity base. Not so many problems adding to individual screens.
 
realworldincome
Aspiring developer
Profile
Posts: 36
Reg: Feb 22, 2012
location unknow...
1,160
like
07/12/12 05:42 AM (13 years ago)
Hi Raveyd, Since it is for checking out other free app offers, ideally every page. But, if I can do it on a page-by-page basis instead, that would work. I'm using (learning) Buzztouch 2 Thanks!
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
07/12/12 05:49 AM (13 years ago)
hmmm... I think it would soon annoy users and lead to bad feedback if they were getting interstitials on every screen. Most networks say to use interstitials sparingly for best effect, like once on start up, in which case the code would go in your first activity, like a button menu.
 
realworldincome
Aspiring developer
Profile
Posts: 36
Reg: Feb 22, 2012
location unknow...
1,160
like
07/12/12 05:54 AM (13 years ago)
Makes sense. So using Eclipse, Appbrain support had me put the code inside and outside the BT_activity_base.java portion. It errored out. How and where would I insert code on an individual page? I'm not seeing instructions on their developer site to do that.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
07/12/12 07:25 AM (13 years ago)
Well, this would go in an oncreate method, like the oncreate in a button menu java file: AppBrain.initApp(this); Like this: //onCreate @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); this.activityName = "BT_screen_menuListSimple"; BT_debugger.showIt(activityName + ":onCreate"); AppBrain.initApp(this); and this would go somewhere after the oncreate @Override public void onBackPressed() { AppBrain.getAds().maybeShowInterstitial(this); finish(); } maybe after onstart and before onresume? you'd have to experiment with that.
 
realworldincome
Aspiring developer
Profile
Posts: 36
Reg: Feb 22, 2012
location unknow...
1,160
like
07/12/12 07:49 AM (13 years ago)
Okay, I will give that a try and report back. Thanks raveyd!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.