com.annahid.libs.artenus.unified
UnifiedServices
Provides store-specific game functionality in a unified way. In-app billing, ad management, and
game services are handled by this class.
public abstract class UnifiedServices
Field Summary
| Modifier and Type | Field and Description |
|---|---|
public static final | SERVICE_ADSService flag for ads |
public static final | SERVICE_BILLINGService flag for in-app billing |
public static final | SERVICE_GAMESService flag for game services |
Constructor Summary
| Modifier and Type | Constructor and Description |
|---|---|
protected | UnifiedServices() Called by subclasses to construct an empty instance of UnifiedServices. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
public abstract AdManager | getAdManager() Gets an instance of AdManager provided by this implementation. |
public abstract GameServices | getGameServices() Gets an instance of GameServices provided by this implementation. |
public static UnifiedServices | getInstance(int services) Gets the current instance of UnifiedServices. |
public static UnifiedServices | getInstance() Gets the current instance of UnifiedServices. |
public abstract InventoryManager | getInventoryManager() Gets an instance of InventoryManager provided by this implementation. |
public abstract LoginManager | getLoginManager() Gets an instance of LoginManager provided by this implementation. |
public abstract Stores | getStore() Gets the app-store this instance operates in |
public final boolean | hasServices(int servicesMask) Checks if this instance supports specified services. |
protected abstract int | init(int inputServices) Called on sub-classes to initialize the services, and mask out those they do not support. |
public boolean | onActivityResult(int requestCode, int resultCode, Intent data) Called internally by onActivityResult(int, int, Intent). |
public abstract void | onCreate(Context context) Called internally as part of onCreate(Bundle). |
public abstract void | onDestroy(Context context) Called internally as part of onCreate(Bundle). |
public void | onPause() Called internally as part of onPause(). |
public void | onResume() Called internally as part of onResume(). |
public void | onStart() Called internally as part of onStart(). |
public void | onStop() Called internally as part of onStop(). |
Methods inherited from java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitField Detail
| SERVICE_ADS |
|---|
public static final SERVICE_ADS Service flag for ads |
| SERVICE_BILLING |
|---|
public static final SERVICE_BILLING Service flag for in-app billing |
| SERVICE_GAMES |
|---|
public static final SERVICE_GAMES Service flag for game services |
Constructor Detail
| UnifiedServices |
|---|
protected UnifiedServices()Called by subclasses to construct an empty instance of UnifiedServices. |
Method Detail
| getAdManager |
|---|
public abstract AdManager getAdManager() Gets an instance of AdManager provided by this implementation.Returns:
Ad manager instance, or null if ads are not supported |
| getGameServices |
|---|
public abstract GameServices getGameServices() Gets an instance of GameServices provided by this implementation.Returns:
Game services instance, or null if not supported |
| getInstance | ||
|---|---|---|
public static UnifiedServices getInstance(
int services
)Gets the current instance of UnifiedServices. If no such instance exists, a new
instance will be created, supporting services specified. Parameters:
Returns:
Current instance |
| getInstance |
|---|
public static UnifiedServices getInstance() Gets the current instance of UnifiedServices. Returns:
Current instance, or null if it is not yet created |
| getInventoryManager |
|---|
public abstract InventoryManager getInventoryManager() Gets an instance of InventoryManager provided by this implementation.Returns:
In-app billing manager instance, or null if not supported |
| getLoginManager |
|---|
public abstract LoginManager getLoginManager() Gets an instance of LoginManager provided by this implementation. The returned value
is never null.Returns:
Login manager instance |
| getStore |
|---|
public abstract Stores getStore() Gets the app-store this instance operates in Returns:
The store See Also:
|
| hasServices | ||
|---|---|---|
public final boolean hasServices(
int servicesMask
)Checks if this instance supports specified services. These might be different than those
provided in getInstance(int), as implementations mask out services they do not
support.Parameters:
Returns:
true if specified services are available, false otherwise |
| init | ||
|---|---|---|
protected abstract int init(
int inputServices
)Called on sub-classes to initialize the services, and mask out those they do not support. Parameters:
Returns:
Bit-masked list of requested services supported by the specific implementation |
| onActivityResult | ||||||
|---|---|---|---|---|---|---|
public boolean onActivityResult(
int requestCode,
int resultCode,
Intent data
)Called internally by onActivityResult(int, int, Intent). Unified services
implementations direct it to their sub-services to handle their own activity requests.Parameters:
Returns:
true if handled, false otherwise |
| onCreate | ||
|---|---|---|
public abstract void onCreate(
Context context
)Called internally as part of onCreate(Bundle).Parameters:
|
| onDestroy | ||
|---|---|---|
public abstract void onDestroy(
Context context
)Called internally as part of onCreate(Bundle).Parameters:
|
| onPause |
|---|
public void onPause() Called internally as part of onPause(). |
| onResume |
|---|
public void onResume() Called internally as part of onResume(). |
| onStart |
|---|
public void onStart() Called internally as part of onStart(). |
| onStop |
|---|
public void onStop() Called internally as part of onStop(). |