public class AylaNetworks
extends java.lang.Object
initialize(AylaSystemSettings)
, where the application
needs to provide the SDK with information about the system. This information includes the app
ID, app secret and an object that can assist the SDK by providing specifics about devices and
properties known to the application.
Once the SDK has been initialized, the CoreManager can be accessed globally via a call to the
sharedInstance()
static method.
After initialization, the CoreManager provides an AylaLoginManager
, which can be used to
sign in and obtain an AylaSessionManager
. The AylaSessionManager maintains the
session, updating the authorization as needed, and provides the AylaDeviceManager
,
which takes care of maintaining the set of devices registered to the user's account.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PLUGIN_ID_DEVICE_CLASS
Device Class plugin identifier.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeSessions() |
AylaConnectivity |
getConnectivity()
Returns the AylaConnectivity instance that can be used to register for network state
change notifications.
|
android.content.Context |
getContext()
Helper method to retrieve the context from the system settings
|
com.google.gson.Gson |
getGson()
Returns the Gson object used for object deserialization from JSON data.
|
AylaLoginManager |
getLoginManager() |
AylaMetricsManager |
getMetricsManager()
Returns the AylaMetricsManager instance used to upload logs to Ayla Log
Service.
|
AylaPlugin |
getPlugin(java.lang.String pluginId)
Returns an installed plug-in, if present
|
java.lang.String |
getServiceUrl(ServiceUrls.CloudService cloudService,
java.lang.String path)
Returns the service URL of the specified cloud service type, optionally appending the
specified path.
|
AylaSessionManager |
getSessionManager(java.lang.String sessionName)
Returns the
AylaSessionManager with the given name, or null if the session with that
name was not found. |
static java.lang.String |
getSupportEmail()
Returns the SDK support email address.
|
AylaSystemSettings |
getSystemSettings()
Returns a copy of the
AylaSystemSettings object used to initialize the
AylaNetworks. |
AylaUserDataGrant |
getUserDataGrants() |
com.android.volley.RequestQueue |
getUserServiceRequestQueue() |
static java.lang.String |
getVersion()
Returns the current version of the SDK
|
static AylaNetworks |
initialize(AylaSystemSettings systemSettings)
Initializes the Ayla library with the provided AylaSystemSettings.
|
void |
installPlugin(java.lang.String pluginId,
AylaPlugin plugin)
Installs a plug-in into the Ayla SDK.
|
static boolean |
isShutDown() |
void |
onPause()
Applications should call this method when the app is about to enter the background.
|
void |
onResume()
Applications should call this method when the app is resuming from the background
|
AylaAPIRequest |
sendUserServiceRequest(AylaAPIRequest<?> request)
Enqueues the provided request to the Ayla Cloud User Service.
|
void |
setUserDataGrants(int userDataGrants)
Set user's preferences for data usage.
|
static AylaNetworks |
sharedInstance()
Returns the global shared instance of the AylaNetworks.
|
static void |
shutDown()
Called when the application is about to exit.
|
void |
updateContext(android.content.Context context)
Updates the context used by the library.
|
public static final java.lang.String PLUGIN_ID_DEVICE_CLASS
DeviceClassPlugin
interface.public AylaUserDataGrant getUserDataGrants()
public void setUserDataGrants(int userDataGrants)
userDataGrants
- public static AylaNetworks initialize(AylaSystemSettings systemSettings)
systemSettings
- AylaSystemSettings object used to initialize the library.public static void shutDown()
public static boolean isShutDown()
public static java.lang.String getVersion()
public static java.lang.String getSupportEmail()
public static AylaNetworks sharedInstance()
initialize(AylaSystemSettings)
is called.public AylaSessionManager getSessionManager(java.lang.String sessionName)
AylaSessionManager
with the given name, or null if the session with that
name was not found.sessionName
- Name of the session to returnpublic AylaLoginManager getLoginManager()
public AylaSystemSettings getSystemSettings()
AylaSystemSettings
object used to initialize the
AylaNetworks.public com.android.volley.RequestQueue getUserServiceRequestQueue()
public void updateContext(android.content.Context context)
context
- New context to be used by the librarypublic java.lang.String getServiceUrl(ServiceUrls.CloudService cloudService, @Nullable java.lang.String path)
AylaSystemSettings.CloudProvider
,
AylaSystemSettings.ServiceType
and AylaSystemSettings.ServiceLocation
values from the
AylaSystemSettings
object used to initialize the core manager when determining the
correct base URL.
If the path field is null, the base URL for the specified cloud service will be returned. Otherwise the path will be appended to the base URL and returned.
cloudService
- Dynamic | User | Application | Logpath
- Optional path to append to the cloud service URL. May be null.protected void closeSessions()
public void onPause()
public void onResume()
public AylaConnectivity getConnectivity()
public AylaMetricsManager getMetricsManager()
public com.google.gson.Gson getGson()
public AylaAPIRequest sendUserServiceRequest(AylaAPIRequest<?> request)
request
- the request to sendpublic android.content.Context getContext()
public AylaPlugin getPlugin(java.lang.String pluginId)
pluginId
- the ID of the plugin service to obtainpublic void installPlugin(java.lang.String pluginId, AylaPlugin plugin)
pluginId
- The ID for this plug-in identifying its utilityplugin
- the plugin to install