Class VServAds
java.lang.Object
com.codename1.impl.FullScreenAdService
com.codename1.impl.VServAds
The v-serv ad service implements full screen ads
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidRemoves the pending ad data so we can fetch a new adprotected ConnectionRequestCreates a new request for an adprotected booleanfailed()Returns true if the connection failedprotected StringReturns the URL for the adintReturns
Returns
Returns
Returns
protected ComponentComponent representing a given adReturns
protected booleanJust checks if an ad is already fetchedbooleanReturns
voidsetCategory(int category) Parameters
voidsetCountryCode(String countryCode) Parameters
voidParameters
voidsetNetworkCode(String networkCode) Parameters
voidParameters
Methods inherited from class FullScreenAdService
bindTransitionAd, getAdDisplayTime, getTimeout, isAllowWithoutNetwork, isScaleMode, setAdDisplayTime, setAllowSkipping, setAllowWithoutNetwork, setScaleMode, setTimeout, showWelcomeAdModifier and TypeMethodDescriptionvoidbindTransitionAd(int timeForNext) Binds an ad to appear periodically after a given timeoutintReturns
intThe timeout in milliseconds for an ad requestbooleanIf set to true this flag allows the application to load even if an Ad cannot be displayedbooleanReturns
voidsetAdDisplayTime(int adDisplayTime) Parameters
voidsetAllowSkipping(boolean allowSkipping) Parameters
voidsetAllowWithoutNetwork(boolean allowWithoutNetwork) If set to true this flag allows the application to load even if an Ad cannot be displayedvoidsetScaleMode(boolean scaleMode) Parameters
voidsetTimeout(int timeout) The timeout in milliseconds for an ad requestvoidInvoked on application startup, this code will download an ad or timeoutMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Field Details
-
CAT_ID_ACTION_ADVENTURE
public static final int CAT_ID_ACTION_ADVENTURE- See Also:
-
CAT_ID_SPORTS
public static final int CAT_ID_SPORTS- See Also:
-
CAT_ID_MOVIES
public static final int CAT_ID_MOVIES- See Also:
-
CAT_ID_KIDS
public static final int CAT_ID_KIDS- See Also:
-
CAT_ID_RACING
public static final int CAT_ID_RACING- See Also:
-
CAT_ID_ARCADE
public static final int CAT_ID_ARCADE- See Also:
-
CAT_ID_ADULT
public static final int CAT_ID_ADULT- See Also:
-
CAT_ID_STRATEGY
public static final int CAT_ID_STRATEGY- See Also:
-
CAT_ID_TRAVEL
public static final int CAT_ID_TRAVEL- See Also:
-
CAT_ID_EDUCATION
public static final int CAT_ID_EDUCATION- See Also:
-
CAT_ID_PRODUCTIVITY
public static final int CAT_ID_PRODUCTIVITY- See Also:
-
CAT_ID_ENTERTAINMENT
public static final int CAT_ID_ENTERTAINMENT- See Also:
-
CAT_ID_MULTIMEDIA
public static final int CAT_ID_MULTIMEDIA- See Also:
-
CAT_ID_SPIRITUAL
public static final int CAT_ID_SPIRITUAL- See Also:
-
CAT_ID_UTILITY
public static final int CAT_ID_UTILITY- See Also:
-
CAT_ID_SOCIAL_NETWORKING
public static final int CAT_ID_SOCIAL_NETWORKING- See Also:
-
CAT_ID_HEALTH
public static final int CAT_ID_HEALTH- See Also:
-
CAT_ID_OTHERS
public static final int CAT_ID_OTHERS- See Also:
-
-
Constructor Details
-
VServAds
public VServAds()
-
-
Method Details
-
createAdRequest
Creates a new request for an ad
Returns
the network operation
- Specified by:
createAdRequestin classFullScreenAdService
-
hasPendingAd
protected boolean hasPendingAd()Description copied from class:FullScreenAdServiceJust checks if an ad is already fetched
Returns
returns true if an ad is already waiting in the queue
- Specified by:
hasPendingAdin classFullScreenAdService
-
clearPendingAd
protected void clearPendingAd()Removes the pending ad data so we can fetch a new ad- Specified by:
clearPendingAdin classFullScreenAdService
-
getPendingAd
Component representing a given ad
Returns
the ad that is currently pending
- Specified by:
getPendingAdin classFullScreenAdService
-
getAdDestination
Returns the URL for the ad
Returns
the ad URL
- Specified by:
getAdDestinationin classFullScreenAdService
-
failed
protected boolean failed()Returns true if the connection failed- Specified by:
failedin classFullScreenAdService
-
getCountryCode
Returns
the countryCode
-
setCountryCode
Parameters
countryCode: the countryCode to set
-
getNetworkCode
Returns
the networkCode
-
setNetworkCode
Parameters
networkCode: the networkCode to set
-
getLocale
Returns
the locale
-
setLocale
Parameters
locale: the locale to set
-
getCategory
public int getCategory()Returns
the category
-
setCategory
public void setCategory(int category) Parameters
category: the category to set
-
getZoneId
Returns
the zoneId
-
setZoneId
Parameters
zoneId: the zoneId to set
-
isAllowSkipping
public boolean isAllowSkipping()Returns
the allowSkipping
- Overrides:
isAllowSkippingin classFullScreenAdService
-