Skip Navigation

Initialization, registration, and program setup

Apps that rely on the 
BlackBerry Dynamics Launcher Library
 must use 
Android
 support library
 com.android.support:support-v13
. Before any interaction with the 
Launcher
, it must be initialized.
  1. Initialize the 
    Launcher Library
    LauncherButton.initForApplication(Application context, Collection<Class> activities, ActivitiesTargetingMethod method);
    The LauncherButton.initForApplication should be called inside the onCreate of 'android.app.Application' derived class using application context.
    Item
    Description
    context
    This is a context of the app where the 
    Launcher Library
     is integrated.
    activities
    This is a list of the app activities where the the 
    Launcher
     button should or should not be shown. The third parameter, 
    ActivitiesTargetMethod
    , defines whether this is an excluded activities list or included activities list.
    method
    This can be one of two possible values:
    • LauncherButton.ActivitiesTargetingMethod.Exclusive
    • LauncherButton.ActivitiesTargetingMethod.Inclusive
  2. Notify the 
    Launcher
     of the 
    BlackBerry Dynamics
     authorization state change. The app that hosts the 
    Launcher Library
     should let the 
    Launcher Library
     know the authorization state with the following method:
      • Set to 
        true
         when the 
        BlackBerry Dynamics
         state EventListener notifies 
        onAuthorized
         state.
      • Set to 
        false
         when EventListener notifies 
        onLocked
         state.
  3. If necessary, register 
    GDServiceClientListener
    .
    The 
    Launcher Library
     uses 
    GDServiceClient
     to start apps listed on the 
    Launcher
     pad.
    The 
    GDServiceClient
     requires an instance of 
    GDServiceClientListener
     but only one listener can be set. In case your app already defines 
    GDServiceClientListener
    , it should be passed to the 
    Launcher Library
    . Otherwise, the default 
    GDServiceClientListener
     is set to 
    GDServiceClient
     and the app's 
    GDServiceClientListener
     is reset.
    HostingApp.getInstance().setClientServiceListener(GDServiceClientListener serviceClientListener);
  4. Handle the settings icon in the 
    Launcher
    .
    This button is intended to invoke your app settings screen. Your app must implement and then register the 
    LauncherCommandCallback
     interface.
    HostingApp.getInstance().setOnCommandCallback(LauncherCommandCallback commandCallback) public interface HostingApp.LauncherCommandCallback { public void onSettingsCommand(); }