B4A Library Tapit Ads wrapper

Hello All, i've updated this wrapper to Version 1.7, it uses the Tapit's latest SDK, better performance, i apologize for taking so long in updating it, please feel free to report any problems with this library.
You can add Interstitial, Full Screen, Banner and Prompt Ads with this library, Wall offer and Video Ads are not working yet.
All the permissions are included in the library, so there's no need to add them manually on your manifest file.

There's an example included so you can test it out, theres also documentation included that will help you start implementing this library right away, just add the TapitV1.7.xml, TapitV1.7.jar and TapitAdview.jar files to your additional libraries folder
and you're ready to start adding ads to your applications.

The library can be downloaded from here

https://github.com/walterf25/TapitAdsV1_7

For processing some ORMMA feature like playing embedded video please
add this before the </application>:
<activity android:name="com.tapit.adview.ormma.util.OrmmaActionHandler"/>

you also need this in your xml file to display the ads
<activity android:name="com.tapit.adview.AdActivity"
android:configChanges="keyboard|keyboardHidden|ori entation"/>


Enjoy!!!!!!
Walter
 
Last edited:

walterf25

Expert
Licensed User
Longtime User
Hi Nad, i just updated the library, please download again from the first post, i fixed some minor issues, note that video ads are not working, at least on my phone i can not get them to display, if you can get it to work please let me know, i'm working with the guys from tapit.com as we speak, also let me know if you can see the ad requests register on the dashboard in the tapit.com webiste once you create your account, that is one of the issues we're seeing at this moment, and currently working on, but give it a go and give us some feedback!

cheers,
Walter
 

nad

Active Member
Licensed User
Longtime User
Hey Walter,

I have just created an account, added an application and got a Zone Id. Added that on an initialize and in Manifest Editor:

B4X:
'**************************************
'               TAPIT
'**************************************
AddApplicationText(
<activity android:name="com.tapit.adview.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>
)
AddApplicationText(
<activity android:name="com.tapit.adview.ormma.util.OrmmaActionHandler"/>
)

after tried

(one each time)

B4X:
Tap.Interstitial(5,20,5,True) ' this one opened the intersitial but totally black
Tap.Video_Ad(False,20) ' Same, just black for 20 secs and after a button to go back to app
Tap.Offer_Wall(False) ' This one directly opened google play with a third party app in view.

What steps did you follow to make it work?

Probably my case is that my app has not been approved yet and seems it takes a couple of days?

Cheers,
 
Last edited:

walterf25

Expert
Licensed User
Longtime User
Tapit Ads

Hi Nad, your code looks correct, did you ad the tapit sdk file to your libraries as well, and yes you may need to your application to be approved first before displaying any ads, note that Video ads are working but there's no ads being served yet, as far as interstitial and wall offer they all should be working, also make sure you put your Zone Id number and not Site ID, can you send me your code so i can take a look at it just to make sure?

thanks
Walter
 

straybullet

Member
Licensed User
Longtime User
See that's the killer I would never use an ad network that didn't allow me to show ads during my initial testing, at least demo ads so I didn't have t do a recompile after approval.

Hi Nad, your code looks correct, did you ad the tapit sdk file to your libraries as well, and yes you may need to your application to be approved first before displaying any ads, note that Video ads are working but there's no ads being served yet, as far as interstitial and wall offer they all should be working, also make sure you put your Zone Id number and not Site ID, can you send me your code so i can take a look at it just to make sure?

thanks
Walter
 

walterf25

Expert
Licensed User
Longtime User
Actually you do see ads before your app gets approved, you should see some test ads, i understand your comment straybullet, but believe me this is an awesome way of monetizing with your apps
cheers,
Walter
 

walterf25

Expert
Licensed User
Longtime User
Tapit Ads

Here's an example for everyone to check out this library, please give it a go, an any issues please let me know!

B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
Dim tapit As TapitAd

Dim button1, button2, button3, button4 As Button 

End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")

button1.Initialize("button1")
button2.Initialize("button2")
button3.Initialize("button3")
button4.Initialize("button4")



tapit.Initialize("tapit", "5809")
Activity.AddView(tapit, 0, 0, 100%x, 90)

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub tapit_begin
Log("starting download.....")
End Sub

Sub tapit_receivead
Log("succesfully showed ad")
End Sub

Sub tapit_error(reason As String)
Log(reason)
End Sub

Sub button1_Click
tapit.Interstitial(5, 20, 5, True)
End Sub

Sub button2_Click
tapit.Full_Screen(10, False)
End Sub

Sub button3_Click
tapit.Offer_Wall(False)
End Sub

Sub button4_Click
tapit.Video_Ad(False, 20)
End Sub



cheers,
Walter
 
Last edited:

nad

Active Member
Licensed User
Longtime User
Hi Walter,

with your code I get the following results:

Button1 I get this in logcat. See attached image


Offerwall is working (button3) and it offers some apps to download



The rest no, maybe its a problem of lack of ad inventory?

Cheers,
 

Attachments

  • errorbutton1.png
    errorbutton1.png
    15.7 KB · Views: 247

walterf25

Expert
Licensed User
Longtime User
Tapit Ads

Hi Nad, where are you located, i spent most of the day today polishing this library with the help of the people at tapit, and everything seems to work fine here, can you provide me with your zone Id so that we can target your area directly, it may be that there are no ads being served in your zone, please provide me with more info and we will get this sorted out, i'm glad you're giving this a try.
Can you also send me your code?

thanks
Walter
 

nad

Active Member
Licensed User
Longtime User
Thanks a lot Walter.

I am in Madrid, Spain. My zone id is 6018.

I have tried leadbolt, appbrain, adiquity, millenial, mobclix, admob, applovin and all had ads and inventory for my area so i find it strange.

I am using the exact code you pasted. As it did not have a designer file, i created a main.bal with 4 buttons.

First one (interstitial) gives an exception as you can see in my previous message attachment. Offerwall works fine, and i don't get anything for full_screen and video_add, i mean i get the black screen and buttons but no ad.

I have the latest version of your library (first post). Dated as of 20/06/2012. I have the latest sdk aswell.

My manifest is the following (not altered anything, it has the same options your library requests by default)

B4X:
<?xml version="1.0" encoding="utf-8"?>
<manifest
   xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.nadstech.tapittest"
   android:versionCode="1"
   android:versionName=""
   android:installLocation="internalOnly">
   
   <uses-sdk android:minSdkVersion="4" />
   <supports-screens android:largeScreens="true" 
       android:normalScreens="true" 
       android:smallScreens="true" 
       android:anyDensity="true"/>
   <uses-permission android:name="android.permission.INTERNET"/>
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
   <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
   <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
   <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
   <application
      android:icon="@drawable/icon"
      android:label="TapitTest">
      <activity
         android:windowSoftInputMode="stateHidden"
         android:launchMode="singleTop"
         android:name=".main"
         android:label="TapitTest"
         android:screenOrientation="unspecified">
         <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
         
      </activity>
   </application>
</manifest>

This is the app code (same as yours)

B4X:
'Activity module
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
Dim tapit As TapitAd

Dim button1, button2, button3, button4 As Button 

End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")

button1.Initialize("button1")
button2.Initialize("button2")
button3.Initialize("button3")
button4.Initialize("button4")



tapit.Initialize("tapit", "5809")
Activity.AddView(tapit, 0, 0, 100%x, 90)

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub tapit_begin
Log("starting download.....")
End Sub

Sub tapit_receivead
Log("succesfully showed ad")
End Sub

Sub tapit_error(reason As String)
Log(reason)
End Sub

Sub button1_Click
tapit.Interstitial(5, 20, 5, True)
End Sub

Sub button2_Click
tapit.Full_Screen(10, False)
End Sub

Sub button3_Click
tapit.Offer_Wall(False)
End Sub

Sub button4_Click
tapit.Video_Ad(False, 20)
End Sub

Do we need to rename their SDK jar file with a specific name?

Cheers and thanks a lot for your help.
 
Last edited:

walterf25

Expert
Licensed User
Longtime User
Tapit Ads

Hi Nad, you're missing this two lines in your manifest file.

<activity android:name="com.tapit.adview.ormma.util.OrmmaActionHandler"/>
<activity android:name="com.tapit.adview.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>

please add them, i tried your zone Id and i can see ads using your zone ID, aside from that everything else looks good, let me know how it goes :sign0089:

you don't need to rename the sdk jar file!

Also Make sure you have the latest library version, i updated it a couple of days ago, please download from first post!

Walter
 
Last edited:

nad

Active Member
Licensed User
Longtime User
Hello Walter,

Yes I did that as well but did not make any difference. I tried aswell following step by step everything in the link you posted in your last message.

Basic4Android : Support Center

For all the tests i have done I have always downloaded the latest version from both the sdk and your xml, jar in thread's first post.

I am still getting the following in logcat for button1

B4X:
java.lang.Exception: Sub tapit_error signature does not match expected signature.
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:172)
   at anywheresoftware.b4a.BA.raiseEvent2(BA.java:158)
   at anywheresoftware.b4a.BA.raiseEvent(BA.java:154)
   at com.dandre.tapit.TapItAds$UserAdDownload.error(TapItAds.java:89)
   at com.tapit.adview.AdViewCore$OnAdDownloadAdapter.error(AdViewCore.java:738)
   at com.tapit.adview.AdViewCore$LoadContentTask.doInBackground(AdViewCore.java:572)
   at com.tapit.adview.AdViewCore$LoadContentTask.doInBackground(AdViewCore.java:470)
   at android.os.AsyncTask$2.call(AsyncTask.java:185)
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
   at java.lang.Thread.run(Thread.java:1027)
java.lang.Exception: Sub tapit_error signature does not match expected signature.



Button2 displays a white screen for a second and then it displays the 4 buttons again.

Button3 is working fine.

Button4 seems to work fine but seems i am not getting any video ad.

Thanks a lot for your support is probably something i am missing

I have tried with two different mobiles with different android versions and makes no difference

Cheers and thanks a lot for your support on this.
 

susu

Well-Known Member
Licensed User
Longtime User
Hi Walter,

I'm trying TapIt but I can't find Offer Wall in their Dashboard.

For Phone there're: Banner, Video, Medium Rectangle, Full Screen/Interstitial, AdPrompts.
For Tablet there're: Leaderboard, Medium Banner, Video, AdPrompts.

One more question: My app is for Phone and Tablet so I need to use 2 Banner's Zone ID for each? Why they don't combine into 1 Zone ID?

I'm so confused with TapIt dashboard :(
 

Theera

Well-Known Member
Licensed User
Longtime User
Tapit ads

Hi walterf25,
Let me know that where is "5809" come from? I need to learn.
Best Regards
Theera
 

walterf25

Expert
Licensed User
Longtime User
Zone ID

Hi there, "5809" is actually your Zone ID you get this once you register on their website, it will be a different name for you of couse.

Good Luck!
 
Top