Class AssetController

    • Field Detail

      • path

        public java.lang.String path
    • Constructor Detail

      • AssetController

        public AssetController​(android.content.Context context,
                               java.lang.String assetPath)
    • Method Detail

      • setupAssetUpdate

        public void setupAssetUpdate​(AssetContext assetContext,
                                     IAssetDelegate callback)
        Sets up the AssetController with a context to the Trainer project and a delegate to handle callbacks. After this method is called, the AssetController is considered 'active'.
        Parameters:
        assetContext - The context
        callback - The callback
      • lockUpdate

        public void lockUpdate()
      • isUpdateLocked

        public boolean isUpdateLocked()
      • createBackup

        public void createBackup()
        Creates a backup of the current assets
      • restoreBackup

        public void restoreBackup()
        Restores assets from a backup if it exists
      • deleteBackup

        public boolean deleteBackup()
        Deletes the backup folder
        Returns:
        success of the function
      • getPath

        public java.lang.String getPath()
        Gets the asset path
        Returns:
        asset path
      • setPath

        public void setPath​(java.lang.String path)
        Sets the asset path
        Parameters:
        path - asset path
      • getSchemaPath

        public java.lang.String getSchemaPath()
      • getAssetFiles

        public java.util.List<java.lang.String> getAssetFiles()
        Gets a list of all local assets that have been stored for this project.
      • getAssetVersion

        public java.lang.String getAssetVersion()
        Gets the asset version
        Returns:
        asset version
      • areLocalAssetsAvailable

        public boolean areLocalAssetsAvailable()
        Returns true if local assets are available.
      • isActive

        public boolean isActive()
        Returns true if the AssetController if 'SetupAssetUpdate' was called. Returns false if 'ResetAssetUpdate' was called or 'SetupAssetUpdate' has not been called.
      • checkForUpdates

        public void checkForUpdates()
        Checks whether asset updates are available
      • updateAssets

        public void updateAssets()
        Updates the assets, only after checkForUpdates() was successfully called
      • getReportingValues

        public java.lang.String getReportingValues()
      • setReportingValues

        public void setReportingValues​(java.lang.String reportingValues)
      • cancelUpdate

        public void cancelUpdate()
        Cancel an ongoing update
      • getAssetId

        public java.lang.String getAssetId()
      • deleteLocalAssets

        public boolean deleteLocalAssets()
        Delete the local assets