This tutorial demonstrates how to configure and integrate the Connect SDK with a new Android app created in the Android Studio development environment. The purpose of the app is to log in to the Pega® Platform application instance and display a success message. To learn more about the Connect SDK, see the Connect SDK overview.
Before you start, download the HelloConnectSDK.zip file, which contains sample Java code and other application project files for the Android app described in this tutorial.
You can connect to any Pega Platform instance to test the sample Android app.
The users of the Pega Platform mobile app that you are creating must have the PegaRULES:PegaAPI role assigned to them. If required, to enable the use of HTTP server URLs, in the Context tab of the API Service Package rule, clear the Require TLS/SSL for REST services in this package check box.
Compile and run the application
After you create the required Java code and resources in your Android Studio project that make calls to the Connect SDK library, you can compile and run the new Android app in a emulator to test that it works correctly.
- To build your project on Android Studio, click Gradle Console on the bottom right of the window to show compiling progress information. and select . You can also click the
To run or debug your application, select Run (or > debug) from the Android Studio menu bar. This compiles the project (if necessary), creates a default run configuration, and installs and starts the application on an emulator, depending on the deployment target selected by the run configuration.>
HelloWorld first (login) screen
Enter a valid user name and a password for the app. The content that displays depends on the portal that is associated with the access group of the operator.