Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Need help integrating leadbolt ads into a paid for template(Lost when it comes to implementing ads in android apps.)
Need help integrating leadbolt ads into a paid for template [message #1450569] Wed, 22 October 2014 15:35 Go to next message
Anthony Rodriguez is currently offline Anthony RodriguezFriend
Messages: 3
Registered: October 2014
Junior Member
I have been trying to do this for over a week now and have searched high and low on how to integrate leadbolt ads into my app.

I bought an android app template and I want to add leadbolt ads to this source code.
I followed all the steps on the leadbolt page(sorry cannot post urls yet) and am lost on step 4.

This is the sample code I need to integrate with the attached java file.
/*
Other imports here
*/
import com.appfireworks.android.listener.AppModuleListener;
import com.appfireworks.android.track.AppTracker;

import com.YOUR_SDK_PACKAGE_NAME.AdController;

public class MainActivity extends Activity 
{
	private AdController interstitial;
	private AdController audioad;
	private Activity act = this;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		if(savedInstanceState == null) {
			initializeLeadBolt();
		}
	}

	private void initializeLeadBolt() {
		audioad = new AdController(act, "YOUR_LB_AUDIO_ID");
		audioad.loadAudioAd(); 
		AppTracker.startSession(act, "APPFIREWORKS_API_KEY", new AppModuleListener() {
			@Override
			public void onModuleLoaded() {}
			@Override
			public void onModuleFailed() {
				loadDisplayAd();
			}
			@Override
			public void onModuleClosed() {}
			@Override
			public void onModuleCached() {}
		});
	}

	private void loadDisplayAd() {
		// use this else where in your app to load a Leadbolt Interstitial Ad
		interstitial = new AdController(act, "YOUR_LB_INTERSTITIAL_ID");
		interstitial.loadAd();
	}

	public void onPause() {
		super.onPause();
		if (!isFinishing()) {
			AppTracker.pause(getApplicationContext());
		}
	}

	public void onResume() {
		super.onResume();
		AppTracker.resume(getApplicationContext());
	}

	public void onDestroy() {
		super.onDestroy();
		if(isFinishing()) {
			AppTracker.closeSession(getApplicationContext(), true);
		}
		if(audioad != null) {
			audioad.destroyAd();
		}
		if(interstitial != null) {
			interstitial.destroyAd();
		}
	}
}


The problem I am having is that on my main_activity java page it already has some of the same code as what is mentioned in the sample code page. So I am unsure how I can merge the code without causing errors.

I know that I cannot just copy and paste this into the bottom of my java file. I also tried taking different code from sections and placing them in sections that were the same in my java file and still that did not work.

I can include a copy of my main_activity java page so that hopefully someone can help me accomplish my goal.

I have added all the files needed to the lib folder and have the two permission in my android manifest file. I just need help to add the ad serving code.

I have attached the java file that needs the ads integrated.

Thanks in advance for any help.

Re: Need help integrating leadbolt ads into a paid for template [message #1450599 is a reply to message #1450569] Wed, 22 October 2014 16:39 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 3510
Registered: July 2009
Senior Member

This is not an Android development forum.

https://www.eclipse.org/forums/index.php/t/225513/


Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Need help integrating leadbolt ads into a paid for template [message #1450635 is a reply to message #1450569] Wed, 22 October 2014 17:54 Go to previous messageGo to next message
Anthony Rodriguez is currently offline Anthony RodriguezFriend
Messages: 3
Registered: October 2014
Junior Member
Sorry that I posted in the wrong place. I will look at one of the other forums.

[Updated on: Wed, 22 October 2014 17:56]

Report message to a moderator

Re: Need help integrating leadbolt ads into a paid for template [message #1450749 is a reply to message #1450635] Wed, 22 October 2014 22:01 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 10/22/2014 11:54 AM, Anthony Rodriguez wrote:
> Sorry that I posted in the wrong place. Is there a way for me to move
> this post to the correct place or can a mod do it? Thanks and once again
> my apologies.

No, there is no Android development forum hosted by Eclipse. Eclipse was
chosen to host Android development, but the support comes from the
Android forums.
Re: Need help integrating leadbolt ads into a paid for template [message #1450834 is a reply to message #1450749] Thu, 23 October 2014 01:06 Go to previous message
Anthony Rodriguez is currently offline Anthony RodriguezFriend
Messages: 3
Registered: October 2014
Junior Member
Thanks for the info. Much appreciated.
Previous Topic:Items` palette
Next Topic:Eclipse won't start? READ THIS FIRST didn't work
Goto Forum:
  


Current Time: Wed Oct 16 09:51:41 GMT 2019

Powered by FUDForum. Page generated in 0.03443 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top