As an Android developer, you can integrate custom modules with Pega Mobile Client by using dependencies on existing product modules, as well as increase their versatility by including third-party libraries. After developing a custom module in an external development environment, you can compile, debug, and test the module before building the final application.
The distribution package is a .zip file that you can obtain from your Pegasystems Global Customer Support representative. The file contains the required resources for building a Pega Mobile Client-based custom mobile app, such as libraries, product modules, documentation, scripts, styles, and graphic files.
Activity plug-in classes
To extend the Pega Mobile Client, for example, to grant the custom mobile app access to activity life cycle events, you can use actvity plug-in classes. Custom modules can contain one or more such classes. Activity plug-in classes must implement the basic
com.pega.mobile.activity.plugin.ActivityPlugin abstract that is provided by the API in the /extensions/API directory of the distribution package. Implemented methods are called in response to activity life cycle events, which are described in the Android APIs reference. An activity plug-in class enables simple initialization such as creating singleton instances or registering for Android activity events. Its instance is created once, at client startup, and remains valid within the context of the client for its lifetime. If the library of the custom module contains more than one activity plug-in class, Pega Mobile Client creates an instance for each of them.
To learn how to create activity plug-in classes, see Extending Pega Mobile Client with activity plug-in classes.
Dependencies on product modules
Pega Mobile Client consists of several product modules. The
Base module contains the basic functionality of the Pega Mobile Client and is a required dependency. For the custom module to have dependencies on modules other than the
Base module, you must add a dependency in the build.gradle file that is in your custom module directory, for example:
All Pega Mobile Client modules are in a local Maven repository, in the repository directory of the Android Studio project.
For more information, see Adding third-party dependencies.
Source-code versus compiled custom modules
Custom Pega Mobile Client modules in a source-code format are easier to package than compiled ones. However, transferring them and building the app in the Pega Platform takes longer. Binary custom modules help you save time when transferring the files and compiling the app. Using the compiled (binary) form is the preferred method to deliver custom modules.
For more information about packaging custom modules in source-code and binary form, see Packaging the custom module.
Android 6 permission model
Pega Mobile Client supports the run-time permission model that was introduced in Android 6. The user of an app is asked to accept permissions at run time and can revoke certain permissions later. You must list the permissions in the AndroidManifest.xml file of your custom module, and review the permission status every time you want to use it.
Pega Mobile Client provides a simplified API to support the new permission mechanism. This API is transparent for devices that do not support this functionality. To become familiar with the API, review the Javadoc information that is provided in the distribution package.
For short usage instructions, see Requesting a permission to perform an action.