Adlib
Public Member Functions | Properties
AdProvider Class Reference

Public Member Functions

ErrorType InitAdlib (string banner_site_id, string interstitial_site_id, string js_namespace, string js_src_url, string conf_str)
 
ErrorType DeinitAdlib ()
 
void SetGender (GenderPreference gender)
 
void SetEthnicity (string ethnicity)
 
void SetAge (int age)
 
void SetDateOfBirth (string dob)
 
void SetIncome (string income)
 
void SetEducation (string education)
 
void SetLocation (string location)
 
void SetInterests (string interests)
 
void SetPostalcode (string postalcode)
 
void SetAreaCode (string areacode)
 
ErrorType SetBannerAdListener (IntPtr handle, BannerAdListener appListener)
 
ErrorType AddBannerAd (BannerAdSize size, out IntPtr adhandle)
 
ErrorType BannerAdLoad (IntPtr handle)
 
ErrorType BannerAdSetPosition (IntPtr handle, BannerAdPosition pos)
 
ErrorType BannerAdMove (IntPtr handle, int xpos, int ypos)
 
ErrorType BannerAdSetVisibility (IntPtr handle, bool value)
 
ErrorType BannerAdDestroy (IntPtr handle)
 
ErrorType BannerAdEnableAutoRefresh (IntPtr handle, bool value)
 
ErrorType BannerAdSetRefreshInterval (IntPtr handle, int duration)
 
ErrorType AddInterstitialAd ()
 
ErrorType SetInterstitialAdListener (InterstitialAdListener appListener)
 
ErrorType InterstitialAdLoad ()
 
ErrorType InterstitialAdShow ()
 

Properties

static AdProvider Instance [get]
 

Member Function Documentation

ErrorType AddBannerAd ( BannerAdSize  size,
out IntPtr  adhandle 
)
inline

This api will add the banner ad on the parent received.

Parameters
[out]adhandle: banner ad handle to be used for this ad instance.
[in]size: size of the ad to be shown.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_PARAMETERSInvalid parameter.
ADLIB_AD_ADLIB_NOT_INITIALIZEDIf adlib is not initialised. i.e adlib_init() not called.
Note
This will only create the handle and will not show ad.
ErrorType AddInterstitialAd ( )
inline

This api will add the interstitial ad on the parent received.

Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INTERNAL_ERRORInternal error.
ADLIB_AD_INVALID_PARAMETERSInvalid parameter.
ADLIB_AD_ADLIB_NOT_INITIALIZEDIf adlib is not initialised. i.e adlib_init() not called.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
Note
This will only create the object and will not show ad.
ErrorType BannerAdDestroy ( IntPtr  handle)
inline

To delete the banner ad from a view. Application can delete the banner ad while exiting from a view or use visibility option to reuse the same in other views.

Parameters
[in]handle: banner ad handle to be used for this ad instance.
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ADLIB_AD_INTERNAL_ERRORInternal error.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType BannerAdEnableAutoRefresh ( IntPtr  handle,
bool  value 
)
inline

This api will set the auto refresh feature to either enabled or disabled. If set to disabled ads will not refresh automatically and the app needs to call adview_banner_load for loading a new ad.

Parameters
[in]handle: banner ad handle to be used for this ad instance.
[in]value: Boolean to enable or disable auto refresh feature.
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType BannerAdLoad ( IntPtr  handle)
inline

Loads and shows the ad. Returns the success or failure result to the listener callbacks.

Parameters
[in]handle: banner ad handle to be used for this ad instance.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ErrorType BannerAdMove ( IntPtr  handle,
int  xpos,
int  ypos 
)
inline

Move the position of the ad to relative coordinates. Application can set the position of the ad to the relative screen coordinates (x, y) position

Parameters
[in]handle: banner ad handle to be used for this ad instance.
[in]xposx coordinate position
[in]yposy coordinate position
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ADLIB_AD_INTERNAL_ERRORInternal error.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType BannerAdSetPosition ( IntPtr  handle,
BannerAdPosition  pos 
)
inline

Sets the position of the ad to predefined positions. Application can set the position of the ad to the predefined positions defined in adlib_adposition_e

Parameters
[in]handle: banner ad handle to be used for this ad instance.
[in]posposition of the ad
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ADLIB_AD_INTERNAL_ERRORInternal error.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType BannerAdSetRefreshInterval ( IntPtr  handle,
int  duration 
)
inline

This api will set the auto refresh interval for the ad. Minimum refresh interval should be greater than 10 secs.

Parameters
[in]handle: banner ad handle to be used for this ad instance.
[in]duration: Refresh interval value should be >= 10.
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ADLIB_AD_INVALID_PARAMETERSInvalid parameter.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType BannerAdSetVisibility ( IntPtr  handle,
bool  value 
)
inline

Sets the visibility of the ad. Application can set the visibility of the ad according to success or failure events and also during navigating between views.

Parameters
[in]handle: banner ad handle to be used for this ad instance.
[in]valueTrue to Show and False to Hide
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ADLIB_AD_INTERNAL_ERRORInternal error.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType DeinitAdlib ( )
inline

Disconnects adlib core and clears networkconnection.

Returns
void
ErrorType InitAdlib ( string  banner_site_id,
string  interstitial_site_id,
string  js_namespace,
string  js_src_url,
string  conf_str 
)
inline

Initializes adlib and its core.

Parameters
[in]banner_site_id: site id provided for the application by Inmobi during registration for banner ads.
[in]interstitial_site_id: site id provided for the application by Inmobi during registration for interstitial ads.
[in]js_namespacenamespace provided for the application
[in]js_src_urlsource url provided for inmobijs to the application
[in]conf_strinmobi configuration string provided for the application
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INTERNAL_ERRORInternal error.
ADLIB_AD_INVALID_PARAMETERSInvalid parameter.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType InterstitialAdLoad ( )
inline

Loads the interstitial ad. Returns the success or failure result to the listener callbacks. Please see OnLoadFailed and OnLoadSucceeded callbacks.

Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INTERNAL_ERRORInternal error.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
ErrorType InterstitialAdShow ( )
inline

Shows the interstitial ad.

Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INTERNAL_ERRORInternal error.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
void SetAge ( int  age)
inline

Preference API to set age

Parameters
[in]age:age as integer
Returns
void
void SetAreaCode ( string  areacode)
inline

Preference API to set area code

Parameters
[in]areacode:areacode as string
Returns
void
ErrorType SetBannerAdListener ( IntPtr  handle,
BannerAdListener  appListener 
)
inline

Adds the banner ad callback handler.

Parameters
[in]handle: banner ad handle to be used for this ad instance.
[in]appListener: The set of listener functions to handle ad lifecycle events
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INVALID_AD_HANDLEInvalid Handle passed.
ADLIB_AD_INVALID_PARAMETERSInvalid parameter.
Returns
ErrorType : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
void SetDateOfBirth ( string  dob)
inline

Preference API to set DateofBirth

Parameters
[in]dob:date of birth as string in YYYY:MM:DD format
Returns
void
void SetEducation ( string  education)
inline

Preference API to set education

Parameters
[in]education:education as string
Returns
void
void SetEthnicity ( string  ethnicity)
inline

Preference API to set ethnicity

Parameters
[in]ethnicity:asian or hispanic
Returns
void
void SetGender ( GenderPreference  gender)
inline

Preference API to set the Gender

Parameters
[in]gender: Female or Male
Returns
void
void SetIncome ( string  income)
inline

Preference API to set income

Parameters
[in]income:income as string
Returns
void
void SetInterests ( string  interests)
inline

Preference API to set interests

Parameters
[in]interests:interests as comma separated strings
Returns
void
ErrorType SetInterstitialAdListener ( InterstitialAdListener  appListener)
inline

Adds the interstitial ad callback handler.

Parameters
[in]appListener: The set of callback functions to handle ad lifecycle events
Return values
ADLIB_AD_NO_ERRORSuccess.
ADLIB_AD_INTERNAL_ERRORInternal error.
ADLIB_AD_INVALID_PARAMETERSInvalid parameter.
ADLIB_AD_ADLIB_NOT_INITIALIZEDIf adlib is not initialised. i.e adlib_init() not called.
Returns
adlib_err : Returns ADLIB_AD_NO_ERROR on success or with the error occurred.
void SetLocation ( string  location)
inline

Preference API to set location

Parameters
[in]location:location as string in City-State-Country format
Returns
void
void SetPostalcode ( string  postalcode)
inline

Preference API to set postal code

Parameters
[in]postalcode:postal code as string
Returns
void

Property Documentation

AdProvider Instance
staticget

Returns the AdProvider instance on which application has to call member functions.