Android SDK core interfaces
The Android SDK provides a set of core interfaces that are used with all custom integrations. These core interfaces are methods that you call to perform basic tasks, such as initializing the SDK, authenticating and logging into a Docusign account within your app, and working with envelopes and templates.
Before beginning the development of your app with the Android SDK, you will need to create a Docusign developer account, if you don’t already have one.
The core interfaces listed in this topic are intended to highlight the most common ones. However, there are many additional classes and methods available in the Android SDK. Refer to the SDK reference for a complete listing of classes and methods. To learn how to write code to use these core interfaces, see How-to guides.
SDK initialization
Before you can call any Android SDK method, you will need to initialize the SDK by calling the init method of the Docusign class. The init method requires several OAuth parameters to be passed in. You will need to create and configure an app in the Apps and Keys page in your account to obtain these parameters. See Authenticate to learn more about OAuth and Docusign authentication.
To learn how to initialize the Android SDK, see How to log in to Docusign from your app.
Authentication and login
After you initialize the Android SDK, before you make any calls, your mobile app needs to authenticate with the Docusign platform and log in to your account using OAuth 2.0.
For your app to authenticate and log in with the Android SDK, call the login method of the DSAuthenticationDelegate class. The login method requires several OAuth parameters to be passed in. You will need to create and configure an app in the Apps and Keys page in your account to obtain these parameters. See Authenticate to learn more about OAuth and Docusign authentication.
To learn how to authenticate and log in, see How to log in to Docusign from your app.
Template caching
If you have created templates in your account by using the Docusign web UI, you can download and cache any of them on a mobile device using the Android SDK. This enables offline scenarios to still take advantage of the templates you have created, even with no internet connectivity. To learn about templates and how to create them in your Docusign account, see Create Templates.
Note: Before moving your mobile app to the production environment using Go-Live, create and test your templates in your developer account. Your app cannot locate the templates in your production account from your developer account.
To cache a template with the Android SDK, call the cacheTemplate method of the DSTemplateDelegate class. The cacheTemplate method requires the GUID template ID value of the specific template to cache. To learn how to retrieve the ID value of a template, see Locate a Template ID.
To learn how to cache templates, see Step 2 of How to create an envelope for offline signing (from a template).
Template sending and signing
If you have created templates in your account by using the Docusign web UI, you can use those templates to create envelopes and send requests for signature. To learn about templates and how to create them in your Docusign account, see Create Templates.
Note: Before moving your mobile app to the production environment using Go-Live, create and test your templates in your developer account. Your app cannot locate the templates in your production account from your developer account.
To send a signature request using a template with the Android SDK, call the useTemplateOffline method of the DSTemplateDelegate class, which requires the GUID template ID value of the specific template to use. To learn how to retrieve the ID value of a template, see Locate a Template ID.
To learn how to create an envelope from a template, see How to create an envelope for offline signing (from a template) .
Envelope creation and signing
You don’t need to have templates created in your account to be able to send documents for signature. You can create an envelope, specify documents in the envelope, the recipients for those documents, and the tags within those documents all from within your mobile code using the Android SDK. See Docusign objects to learn about these concepts..
To create an envelope to send a signature request without using a template with the Android SDK, call the composeAndSendEnvelope method of the DSEnvelopeDelegate class.
To learn how to create an envelope without a template, see How to create an envelope for offline signing (PDF).
Call the eSignature REST API directly
The Android SDK provides methods that you can use in your app for many common tasks. If you want to incorporate API functionality that hasn’t been implemented as an SDK method, you can call the eSignature REST API directly from the SDK. The SDK includes a module that enables you to supply parameters to pass in a request to an API endpoint, so you don’t have to build an API definition, methods, and parameters. The SDK also parses the response and returns a JSON object.
For sample code for calling the eSignature REST API directly from the SDK, see:
- How to make a direct API call
- The ESign REST API invocation from SDK section of the README.md file