Google is committed to advancing racial equity for Black communities. See how.

CustomModel

public class CustomModel extends Object

Used to store information about custom models that are being downloaded or are already downloaded on a device. The model file associated with this model can be updated, once the new model file is fully downloaded, the original model file will be removed as soon as it is safe to do so.

Public Method Summary

boolean
long
getDownloadId()
The download id (returns 0 if no download in progress), which can be used with the AndroidDownloadManager to query download progress.
File
getFile()
The local model file.
String
getModelHash()
Retrieves the model Hash.
String
getName()
Retrieves the model name and identifier.
long
getSize()
The size of the file currently associated with this model.
int
String

Inherited Method Summary

Public Methods

public boolean equals (Object o)

public long getDownloadId ()

The download id (returns 0 if no download in progress), which can be used with the AndroidDownloadManager to query download progress. The retrieved progress information can be used to populate a progress bar, monitor when an updated model is available, etc.

Returns
  • The download id (if download in progress), otherwise returns 0.

public File getFile ()

The local model file. If null is returned, use the download Id to check the download status.

Returns
  • The local file associated with the model, if the original file download is still in progress, returns null, if file update is in progress returns last fully downloaded model.

public String getModelHash ()

Retrieves the model Hash.

Returns
  • The model hash

public String getName ()

Retrieves the model name and identifier.

Returns
  • The name of the model.

public long getSize ()

The size of the file currently associated with this model. If a download is in progress, this will be the size of the current model, not the new model currently being downloaded.

Returns
  • The local model size.

public int hashCode ()

public String toString ()