A utility plugin to enable various native capabilities in Sunbird-mobile-app.
cordova plugin add https://github.com/Sunbird-Ed/sb-cordova-plugin-utility.git#<branch_name>
To install it locally
Clone the repo then execute the following command
cordova plugin add <location_of_plugin>/sb-cordova-plugin-utility
- sbutility
- .getBuildConfigValue(package, property, successCallback, errorCallback)
- .getBuildConfigValues(package, successCallback, errorCallback)
- .rm(directoryPath, directoryToBeSkipped, successCallback, errorCallback)
- .openPlayStore(appId, successCallback, errorCallback)
- .getDeviceAPILevel(successCallback, errorCallback)
- .checkAppAvailability(packageName, successCallback, errorCallback)
- .getDownloadDirectoryPath(successCallback, errorCallback)
- .exportApk(destination, successCallback, errorCallback)
- .getDeviceSpec(successCallback, errorCallback)
- .createDirectories(parentDirectory, identifiers, successCallback, errorCallback)
- .writeFile(fileMapList, successCallback, errorCallback)
- .getMetaData(fileMapList, successCallback, errorCallback)
- .getAvailableInternalMemorySize(successCallback, errorCallback)
- .getUtmInfo(successCallback, errorCallback)
- .clearUtmInfo(successCallback, errorCallback)
- .getStorageVolumes(successCallback, errorCallback)
- .copyDirectory(sourceDirectory, destinationDirectory, successCallback, errorCallback)
- .renameDirectory(sourceDirectory, toDirectoryName,successCallback, errorCallback)
- .canWrite(directory, successCallback, errorCallback)
- .writeFile(successCallback, errorCallback)
- .getFreeUsableSpace(directory, successCallback, errorCallback)
- .readFromAssets(filePath, successCallback, errorCallback)
- .copyFile(sourceDirectory, destinationDirectory, fileName, successCallback, errorCallback)
- .getApkSize(successCallback, errorCallback)
- .verifyCaptcha(apiKey, successCallback, errorCallback)
- .startActivityForResult(params, successCallback, errorCallback)
- .getAppAvailabilityStatus(appList, successCallback, errorCallback)
- .openFileManager(successCallback, errorCallback)
Retrieves the property value from BuildConfig.class in android
packagerepresents packageName of BuildConfig.class.propertyrepresents property name.
Retrieves all the properties available in BuildConfig.class
packagerepresents packageName of BuildConfig.class.
Deletes the file located in given directory path.
directoryPathrepresents path of the directory.directoryToBeSkippedrepresents path of the directory which is to be skipped.
appIdrepresents appId of the application to be opened in playstore.
Returns the device API version
Returns true if the app is avaialable in the device.
packageNamerepresents packageName of the app.
Returns download directory path.
Extracts the apk to given location.
destinationrepresents destination directory.
Extracts the apk to given location.
destinationrepresents destination directory.
Createss directories inside given root directory.
parentDirectoryrepresents root directory.identifiersrepresents folder names.
Writes file in the given directory path.
fileMapListrepresents a map containing file name as key and destination as value.
Returns metadata of the files given in the map.
fileMapListrepresents a map containing file name as key and destination as value.
Returns internal memory size.
If a playstore link is clicked and that link has some UTM info then those UTM info is stored in preference and this method returns the UTM info.
Clears the UTM info stored while playstore link click.
Returns number of storage volumes available in the device.
Copies directory from source directory to destination.
sourceDirectoryrepresents source directory path.destinationDirectoryrepresents destination directory path.
Rename the directory name.
sourceDirectoryrepresents source directory path.toDirectoryNamerepresents new directory name.
Returns if directory is writable or not.
directoryrepresents directory path.destinationDirectoryrepresents destination directory path.
Returns free space available in given directory
directoryrepresents source directory path.
Clears the UTM info stored while playstore link click.
directoryrepresents source directory path.
Copies file from source directory to destination directory.
sourceDirectoryrepresents source directory path.destinationDirectoryrepresents destination directory path.fileNamerepresents name of the file.
Returns size of the APK.
verifies the captcha.
apiKeyrepresents API key of Google CAPTCHA.
Starts a new activity while wating for result.
paramsrepresents parametrs taht will be sent to another activity.
Returns app availability status on the device.
appListrepresents list of app package id.
Opens File Manager