Fabric

public class Fabric extends Object

Fabric initializes and stores the provided Kit's.

Nested Class Summary

class Fabric.Builder Fluent API for creating Fabric instances. 

Constant Summary

String TAG Logging tag.

Public Method Summary

ActivityLifecycleManager
String
getAppIdentifier()
The value for the Application Identifier (defaults to package name).
String
getAppInstallIdentifier()
The overridden value for the Application Install Identifier, or a generated value.
Activity
ExecutorService
String
static <T extends Kit> T
getKit(Class<T> cls)
Collection<Kit>
getKits()
Returns the Kits registered with SDK.
static Logger
getLogger()
Returns the global Logger.
Handler
String
static boolean
isDebuggable()
Returns the global value for debug mode.
static boolean
isInitialized()
Returns true when all kits have finished asynchronous initialization.
Fabric
setCurrentActivity(Activity activity)
Used for Fabric to Display UI components.
static Fabric
with(Fabric fabric)
Entry point to initialize Fabric and contained Kits.
static Fabric
with(Context context, Kit... kits)
Entry point to initialize Fabric and contained Kits.

Inherited Method Summary

Constants

public static final String TAG

Logging tag.

Constant Value: "Fabric"

Public Methods

public ActivityLifecycleManager getActivityLifecycleManager ()

public String getAppIdentifier ()

The value for the Application Identifier (defaults to package name).

public String getAppInstallIdentifier ()

The overridden value for the Application Install Identifier, or a generated value.

public Activity getCurrentActivity ()

Returns
  • the current foreground Activity if available, may be null. Caller is expected to check lifecycle state before using, see isFinishing().

public ExecutorService getExecutorService ()

public String getIdentifier ()

Returns
  • identifier of Sdk

public static T getKit (Class<T> cls)

Parameters
cls Class extending Kit
Returns
  • Kit instance Will return null if Component not initialized with SDK.
Throws
IllegalStateException if @{link Fabric} has not been initialized.

public Collection<Kit> getKits ()

Returns the Kits registered with SDK.

public static Logger getLogger ()

Returns the global Logger.

public Handler getMainHandler ()

public String getVersion ()

Returns
  • version for Sdk

public static boolean isDebuggable ()

Returns the global value for debug mode.

public static boolean isInitialized ()

Returns true when all kits have finished asynchronous initialization.

public Fabric setCurrentActivity (Activity activity)

Used for Fabric to Display UI components.

Parameters
activity

public static Fabric with (Fabric fabric)

Entry point to initialize Fabric and contained Kits. Subsequent calls to this method will return the original instance. Only the Application context is retained. See http://developer.android.com/resources/articles/avoiding-memory-leaks.html

Parameters
fabric instance to initialize and set as primary

public static Fabric with (Context context, Kit... kits)

Entry point to initialize Fabric and contained Kits. Only the Application context is retained. See http://developer.android.com/resources/articles/avoiding-memory-leaks.html.

Parameters
context Android context used for initialization
kits List of Kit to be built, must not be empty