public class APKExpansionPolicy extends Object implements Policy
These values will vary based on the the way the application is configured in the Android Market publishing console, such as whether the application is marked as free or is within its refund period, as well as how often an application is checking with the licensing service.
Developers who need more fine grained control over their application's licensing policy should implement a custom Policy.
| Modifier and Type | Field and Description |
|---|---|
static int |
MAIN_FILE_URL_INDEX
The design of the protocol supports n files.
|
static int |
PATCH_FILE_URL_INDEX |
LICENSED, NOT_LICENSED, RETRY| Constructor and Description |
|---|
APKExpansionPolicy(android.content.Context context,
Obfuscator obfuscator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowAccess()
Check if the user should be allowed access to the application.
|
String |
getExpansionFileName(int index) |
long |
getExpansionFileSize(int index) |
String |
getExpansionURL(int index)
Gets the expansion URL.
|
int |
getExpansionURLCount()
Gets the count of expansion URLs.
|
long |
getMaxRetries() |
long |
getRetryCount() |
long |
getRetryUntil() |
long |
getValidityTimestamp() |
void |
processServerResponse(int response,
ResponseData rawData)
Process a new response from the license server.
|
void |
resetPolicy()
We call this to guarantee that we fetch a fresh policy from the server.
|
void |
setExpansionFileName(int index,
String name) |
void |
setExpansionFileSize(int index,
long size) |
void |
setExpansionURL(int index,
String URL)
Sets the expansion URL.
|
public static final int MAIN_FILE_URL_INDEX
public static final int PATCH_FILE_URL_INDEX
public APKExpansionPolicy(android.content.Context context,
Obfuscator obfuscator)
context - The context for the current applicationobfuscator - An obfuscator to be used with preferences.public void resetPolicy()
public void processServerResponse(int response,
ResponseData rawData)
This data will be used for computing future policy decisions. The following parameters are processed:
processServerResponse in interface Policyresponse - the result from validating the server responserawData - the raw server response datapublic long getRetryCount()
public long getValidityTimestamp()
public long getRetryUntil()
public long getMaxRetries()
public int getExpansionURLCount()
public String getExpansionURL(int index)
index - the index of the URL to fetch. This value will be either
MAIN_FILE_URL_INDEX or PATCH_FILE_URL_INDEXURL - the URL to setpublic void setExpansionURL(int index,
String URL)
index - the index of the expansion URL. This value will be either
MAIN_FILE_URL_INDEX or PATCH_FILE_URL_INDEXURL - the URL to setpublic String getExpansionFileName(int index)
public void setExpansionFileName(int index,
String name)
public long getExpansionFileSize(int index)
public void setExpansionFileSize(int index,
long size)
public boolean allowAccess()
allowAccess in interface PolicyCopyright © 2012–2014 simpligility technologies inc.. All rights reserved.