website logo
⌘K
Getting Started
Introduction
Basic Concepts
Opening an Account
Creating & Configuring Products
Integrating SDK and Configuring License Fulfillment
Activate a Key-Based License
Vendor Platform
Issuing New Licenses
License Detail View
Order Detail View
Customer Detail View
Metadata
Analytics
Settings
Product Configuration
Product Features
Product Custom Fields
Product Versioning
License Policies
Product Bundles
License Entitlements
License Types
Activations & Device Transfers
Features
Custom Fields
License Start Date
License Note
Maintenance Period
Trial Licenses
Floating Licenses
License Activation Types
Portals
End-User Portal
Offline Portal
Air-Gapped Portal
License API
License API Authorization
License Activation/Deactivation
License Check
Consumption
Floating
Trial Key
Product Details
Device Variables
Changing Password
Management API
Making API Requests
Management API Authorization
Customer
Product
Order
License
Device
Analytics
SDKs
Tutorials
.NET/C# SDK
.NET/C# Management SDK
C++ SDK
Java SDK
Python SDK
Go SDK
Delphi SDK
Swift/Objective-C SDK
Android SDK
Unity SDK
Errors and Response Codes
Floating Server
API Reference
Deployment
Configuration
Floating Server UI
Securing the Server
Whitelabeling
FAQ
Floating Server Changelog
Integrations
Salesforce
FastSpring
Stripe
Shopify
Common Scenarios
Single Sign On (SSO)
Glossary
General
SDK Glossary
Vendor Platform
Product Configuration Glossary
License Configuration
Postman Collections
Frequently Asked Questions
Changelog
License API changelog
Platform changelog
Docs powered by
Archbee
SDKs
Android SDK

SDK Initialization

2min

The SDK behaves as a singleton - this means you initialize the SDK only once and use it many times. As soon as you initialize the SDK, it will contact the LicenseSpring server to check if there is an existing license for the current computer / product combination.

If there is a current license available, it will be immediately accessible as a License object.

At the minimum there are three parameters you will need to initialize the SDK:

  • apiKey, your company API key
  • productCode, a two-letter string identifying product (particular application)
  • sharedKey, company-specific encryption key, used when signing requests

All of these values are available to you in the LicenseSpring web platform under "SDK integration" section.

LicenseManager takes two arguments for initialization, LicenseSpringConfiguration and application context. Application context is used for saving license files to internal app storage.

Java
|
LicenseSpringConfiguration configuration = LicenseSpringConfiguration.builder()
                        .apiKey("api_key")
                        .productCode("product_code")
                        .sharedKey("shared-key")
                        .appName("My application")
                        .appVersion("1.0.0")
                        .build();

        LicenseManager manager = LicenseManager.getInstance();

        manager.initialize(configuration, getApplicationContext());


During initialization the LicenseManager will try to read the license information from specified license file and check the license information with the license server. In case it succeeds LicenseManager.getCurrent() will return License object with detailed license information specified.

The SDK has a hardware key generator based on the Secure Android ID. If the Secure Android ID is null, UUID will be used as a hardware key.

Updated 05 Sep 2023
Did this page help you?
PREVIOUS
Android SDK
NEXT
LicenseManager
Docs powered by
Archbee
Docs powered by
Archbee