quinta-feira, 15 de maio de 2014

Mobvista Basic4Android Lib

Another Basic4Android lib for all the die hard android money makers lovers. According to the folks at the makingmoneywithandroid forum, MobVista this days is one of the best ad networks available. This lib exposes all of the ad formats offered by Mobvista : banner, floating adView and interstitials. They now have a very nice 3d full screen ad.

This lib is free to everyone that registers via my referral link. Just mail me the registered username in MobVista and i'll send you the required files.

Sample project
Code:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region
#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region
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 banner As MobVistaBanner
    Dim bubble As MobVistaFloatAdView
    Dim interstitial As MobVistaInterstitial
   End Sub
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
   
    interstitial.Initialize()
    banner.Initialize("","banner",20)
    bubble.Initialize("")
   
    Activity.AddView(banner,0,100%y-60dip,100%x,60dip)
   
    Dim b1, b2, b3 As Button
   
    b1.Initialize("b1")
    b1.Text="OverlayAd"
   
    b2.Initialize("b2")
    b2.Text="AppWall"
   
    b3.Initialize("b3")
    b3.Text="FullScreenAd"
   
    Activity.AddView(b1,10%x,10dip,80%x,50dip)
    Activity.AddView(b2,10%x,70dip,80%x,50dip)
    Activity.AddView(b3,10%x,130dip,80%x,50dip)
   End Sub
Sub Activity_Resume
    bubble.onResumeEnd Sub
Sub Activity_Pause (UserClosed As Boolean)
    bubble.onPauseEnd Sub
Sub b1_click
    interstitial.showOverlayAd("")End Sub
Sub b2_click
    interstitial.showAppWall("")End Sub
Sub b3_click
    interstitial.showFullScreenAd("")End Sub

A compiled version of this app can be found here.