Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 8    Views: 1692

Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
06/05/13 05:33 AM (12 years ago)

TUTORIAL : Integrating Applovin to your Buzztouch android app.

Hello everyone, In this post i am going to tell you steps of adding applovin sdk in to your Buzztouch android apps. Applovin is a advertising service which can be used in your apps to generate some revenue. Absentia had put a thread recently informing all of us that Applovin has been recently his favorite ad network. I too use applovin in some of my android apps and since @Dusko asked me to put a tutorial for integrating the same for android apps, i am up here with the steps to include it in your apps. Step 1- Registration * First of all you have to register yourself with the applovin at https://www.applovin.com * Download the latest android sdk from your dashboard Step 2- Importing the SDK * Open your project in eclipse. Put the downloaded jar file (sdk) in libs folder and configure build path. You can do so by right clicking the libs folder and select---> Build Path--> Configure Build Path--> select Libraries---> add JARS---> select the project file--> libs folder and select the sdk. After that click the order and export tab and tick your sdk and then click ok. Step 3- Changes in Manifest file * Add the following line into your AndroidManifest.xml.This needs to go inside the "application" tag: <meta-data android:name="applovin.sdk.key" android:value="lmITR0F9HFh7TlSKHQWCREWPClFHtW_ozTbF4KfG5g9NwqfivBSdsyGFfKLQLfkB_" /> * Note that the android:value given above is just for example. Yours might be different. You have to check it in your Docs section of your applovin dashboard. * You need not make any changes in the apps permission field in the manifest file since all the necessary permissions are already there in the bt apps. But in any case double check that you have the following permissions declared in your manifest. <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> Step 4 - Interstitals --- Changes in Plugins (Activities) * Now we will see hot to integrate the applovin interstitals in your app. For the purpose of tutorial i will be using the Sp_youtube_android class file. Remember you can use the following information in any other plugin you prefer to display the interstitals. * Put the following couple of lines code in the onCreate method of the Sp_youtube_android.java file. //Applovin AppLovinSdk.initializeSdk(getBaseContext()); AppLovinInterstitialAd.show( thisActivity ); You can put the above line of code just below the following code- //onCreate @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); this.activityName = "Sp_youtube_android"; BT_debugger.showIt(activityName + ":onCreate"); So after you put the necessary code it should look like the following- //onCreate @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); this.activityName = "Sp_youtube_android"; BT_debugger.showIt(activityName + ":onCreate"); //Applovin AppLovinSdk.initializeSdk(getBaseContext()); AppLovinInterstitialAd.show( thisActivity ); Thats it, you have now successfully integrated applovin sdk in your buzztouch app. The above line of code will fire up the interstital ad. However if you want to add banner ads as well then follow the following step too. Step 5 - Banners --- Changes to be made in layout files. * To add banner ads you have to make changes in the layout file. For example, i am going to use the layout file of Sp_youtube_android plugin. You can add banner ads in any other plugins layout file of your choice. * Open the layout file screen_sp_youtube_android.xml. Now add the following lines of code just above the closing tag of Relative layout in the bottom- <com.applovin.adview.AppLovinAdView xmlns:applovin="http://schemas.applovin.com/android/1.0" android:layout_width="wrap_content" android:layout_height="wrap_content" applovin:loadAdOnCreate="true"/> After putting the above code, the layout file should look like below- <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/transparent" > <ImageView android:id="@+id/imageVideo" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/transparent" android:scaleType="centerInside" > </ImageView> <TextView android:id="@+id/textDescription" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentTop="true" android:background="@android:color/transparent" android:scrollHorizontally="false" android:scrollbars="vertical" android:singleLine="false" android:text="" android:textSize="16dip" > </TextView> <Button android:id="@+id/play" android:layout_width="100dp" android:layout_height="100dp" android:layout_centerHorizontal="true" android:layout_centerInParent="true" android:background="@drawable/btn_play1" /> <com.applovin.adview.AppLovinAdView xmlns:applovin="http://schemas.applovin.com/android/1.0" android:layout_width="wrap_content" android:layout_height="wrap_content" applovin:loadAdOnCreate="true"/> </RelativeLayout> Thats it, now the banner ads will show in the bottom of the sp youtube screen of the app. Hope you all find the above tutorial to be easy to follow. Thanks a lot.
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
06/05/13 05:35 AM (12 years ago)
Nice one buddy, good stuff. Sure a load of folk will appreciate this. Happy hump day!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
06/05/13 05:49 AM (12 years ago)
Very Cool! Thanks Sandeep! Cheers! -- Smug
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
06/05/13 05:50 AM (12 years ago)
This is great, I hope someone will do the same for iOS.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
06/05/13 08:25 AM (12 years ago)
@Sandeep Many thanks for this post!
 
Akshay
I hate code!
Profile
Posts: 193
Reg: Mar 07, 2013
Pune ,India
1,930
like
06/05/13 08:54 AM (12 years ago)
awesome!
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
06/05/13 07:23 PM (12 years ago)
thanks Sandeep im gonna try applovin in some of my apps
 
Mike the App Guy
Lost but trying
Profile
Posts: 435
Reg: Sep 19, 2011
Birmingham, Ala...
5,900
like
07/06/13 07:54 AM (12 years ago)
Sandeep, you are THE MAN!!! I struggled with integrating AppLovin into my Android app, and found your guide. It was a breath of fresh air!! Worked like a charm!!! I remember your guide for RevMob was PERFECT, just like this, and sure enough, AppLovin is up and running now! Thank you SO MUCH for doing this!!! Would you ever consider doing a guide like this for Pingjam? The thing I think where I get hung up is that on the ad networks install guides, it isn't a direct walkthrough with the Buzztouch screens and files.
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
07/06/13 09:29 AM (12 years ago)
@Daniel - Sure, i will make a tutorial to integrate Pingjam for bt apps. But you will have to wait a couple of days for that coz am busy with some personal stuffs.
 

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.