Class FullScreenAdService
java.lang.Object
com.codename1.impl.FullScreenAdService
- Direct Known Subclasses:
VServAds
Abstract class for fullscreen ads that appear before and possibly after application
execution as well as randomly between application screen transitions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbindTransitionAd(int timeForNext) Binds an ad to appear periodically after a given timeoutprotected abstract voidRemoves the pending ad data so we can fetch a new adprotected abstract ConnectionRequestCreates a new request for an adprotected abstract booleanfailed()Returns true if the connection failedprotected abstract StringReturns the URL for the adintReturns
protected abstract ComponentComponent representing a given adintThe timeout in milliseconds for an ad requestprotected abstract booleanJust checks if an ad is already fetchedbooleanReturns
booleanIf 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 timeout
-
Constructor Details
-
FullScreenAdService
public FullScreenAdService()
-
-
Method Details
-
createAdRequest
Creates a new request for an ad
Returns
the network operation
-
getPendingAd
Component representing a given ad
Returns
the ad that is currently pending
-
hasPendingAd
protected abstract boolean hasPendingAd()Just checks if an ad is already fetched
Returns
returns true if an ad is already waiting in the queue
-
clearPendingAd
protected abstract void clearPendingAd()Removes the pending ad data so we can fetch a new ad -
getAdDestination
Returns the URL for the ad
Returns
the ad URL
-
failed
protected abstract boolean failed()Returns true if the connection failed -
showWelcomeAd
public void showWelcomeAd()Invoked on application startup, this code will download an ad or timeout -
bindTransitionAd
public void bindTransitionAd(int timeForNext) Binds an ad to appear periodically after a given timeout
Parameters
timeForNext: the timeout in which an ad should be shown in milliseconds
-
isAllowWithoutNetwork
public boolean isAllowWithoutNetwork()If set to true this flag allows the application to load even if an Ad cannot be displayed
Returns
the allowWithoutNetwork
-
setAllowWithoutNetwork
public void setAllowWithoutNetwork(boolean allowWithoutNetwork) If set to true this flag allows the application to load even if an Ad cannot be displayed
Parameters
allowWithoutNetwork: the allowWithoutNetwork to set
-
getTimeout
public int getTimeout()The timeout in milliseconds for an ad request
Returns
the timeout
-
setTimeout
public void setTimeout(int timeout) The timeout in milliseconds for an ad request
Parameters
timeout: the timeout to set
-
getAdDisplayTime
public int getAdDisplayTime()Returns
the adDisplayTime
-
setAdDisplayTime
public void setAdDisplayTime(int adDisplayTime) Parameters
adDisplayTime: the adDisplayTime to set
-
isScaleMode
public boolean isScaleMode()Returns
the scaleMode
-
setScaleMode
public void setScaleMode(boolean scaleMode) Parameters
scaleMode: the scaleMode to set
-
isAllowSkipping
public boolean isAllowSkipping()Returns
the allowSkipping
-
setAllowSkipping
public void setAllowSkipping(boolean allowSkipping) Parameters
allowSkipping: the allowSkipping to set
-