Package com.jwplayer.pub.api.license
Class LicenseUtil
- java.lang.Object
-
- com.jwplayer.pub.api.license.LicenseUtil
-
public class LicenseUtil extends java.lang.Object
Reads license keys from (in this order): application's manifest, app_data_dir/LICENSE_FILENAME, SHARED_PREFERENCES_FILE_NAME, or BuildConfig.LICENSE_KEYWrites license keys to app_data_dir/LICENSE_FILENAME, or SHARED_PREFERENCES_FILE_NAME
-
-
Constructor Summary
Constructors Constructor Description LicenseUtil()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getLicenseKey(android.content.Context context)
Attempt to read the license key from several locations in this order: Application preferences BuildConfig.LICENSE_KEYvoid
setLicenseKey(android.content.Context context, java.lang.String license)
Writes the provided license to the shared preferences
-
-
-
Method Detail
-
getLicenseKey
public java.lang.String getLicenseKey(android.content.Context context)
Attempt to read the license key from several locations in this order:- Application preferences
- BuildConfig.LICENSE_KEY
- Parameters:
context
- Current context.- Returns:
- The license key, empty string if none could be found.
-
setLicenseKey
public void setLicenseKey(android.content.Context context, java.lang.String license)
Writes the provided license to the shared preferences- Parameters:
context
- The application's contextlicense
- The license key to write
-
-