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.- Initialize theLauncher 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.ItemDescriptioncontextThis is a context of the app where theLauncher Libraryis integrated.activitiesThis is a list of the app activities where the theLauncherbutton should or should not be shown. The third parameter,ActivitiesTargetMethod, defines whether this is an excluded activities list or included activities list.methodThis can be one of two possible values:
- LauncherButton.ActivitiesTargetingMethod.Exclusive
- LauncherButton.ActivitiesTargetingMethod.Inclusive
- Notify theLauncherof theBlackBerry Dynamicsauthorization state change. The app that hosts theLauncher Libraryshould let theLauncher Libraryknow the authorization state with the following method:
- Set totruewhen theBlackBerry Dynamicsstate EventListener notifiesonAuthorizedstate.
- Set tofalsewhen EventListener notifiesonLockedstate.
- If necessary, registerGDServiceClientListener.TheTheLauncher LibraryusesGDServiceClientto start apps listed on theLauncherpad.GDServiceClientrequires an instance ofGDServiceClientListenerbut only one listener can be set. In case your app already definesGDServiceClientListener, it should be passed to theLauncher Library. Otherwise, the defaultGDServiceClientListeneris set toGDServiceClientand the app'sGDServiceClientListeneris reset.HostingApp.getInstance().setClientServiceListener(GDServiceClientListener serviceClientListener);
- Handle the settings icon in theLauncher.This button is intended to invoke your app settings screen. Your app must implement and then register theLauncherCommandCallbackinterface.HostingApp.getInstance().setOnCommandCallback(LauncherCommandCallback commandCallback) public interface HostingApp.LauncherCommandCallback { public void onSettingsCommand(); }