java.lang.Object | |
↳ | fi.moprim.tmd.sdk.TmdCloudApi |
This class offers static functions to interact with the Moprim Cloud. Most common use cases are fetching data and metadata and uploading data to the sync.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TmdCloudApi() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static Result<TmdActivity> |
annotateActivity(Context context, TmdActivity activity, String metadata)
Annotate the activity with new metadata
| ||||||||||
static Result<TmdActivity> |
correctActivity(Context context, TmdActivity activity, String correctedLabel)
Correct the label of activity
| ||||||||||
static Result<List<TmdActivity>> |
fetchData(Context context, Date date, boolean cacheOnly)
Fetch TMD activity data from the Moprim Cloud for the defined date
| ||||||||||
static Result<List<TmdActivity>> |
fetchData(Context context, Date date)
Fetch TMD activity data from the Moprim Cloud for the defined date
| ||||||||||
static Result<List<TmdActivity>> |
fetchData(Context context, long start, long end)
Fetching data from the Moprim cloud
| ||||||||||
static Result<List<TmdActivity>> |
fetchData(Context context, long start, long end, boolean cacheOnly)
Fetching data from the Moprim cloud
| ||||||||||
static Result<TmdCloudMetadata> |
fetchMetadata(Context context)
Fetch the metadata from the Cloud.
| ||||||||||
static Result<TmdStats> |
fetchStats(Context context, int last, boolean cacheOnly)
Fetching stats from the Moprim cloud
| ||||||||||
static Result<TmdStats> |
fetchStats(Context context, int last)
Fetching stats from the Moprim cloud
| ||||||||||
static PendingIntent | getUploadCallbackIntent() | ||||||||||
static void |
setUploadCallbackIntent(PendingIntent intent)
Sets an upload callback intent for the period upload.
| ||||||||||
static Result<TmdActivity> |
updateActivity(Context context, TmdActivity activity, String correctedLabel, String metadata)
Update the activity with new metadata and a corrected label
| ||||||||||
static Result<TmdUploadMetadata> |
uploadData(Context context)
Upload the collected data to the cloud pro-actively
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Annotate the activity with new metadata
context | the context |
---|---|
activity | the activity to correct |
metadata | the metadata |
Correct the label of activity
context | the context |
---|---|
activity | the activity to correct |
correctedLabel | the new label |
Fetch TMD activity data from the Moprim Cloud for the defined date
context | the context |
---|---|
date | the date |
cacheOnly | set to true if you wish to use the cache only |
Fetch TMD activity data from the Moprim Cloud for the defined date
context | the context |
---|---|
date | the date |
Fetching data from the Moprim cloud
context | the context |
---|---|
start | the start time (timestamp in ms) |
end | the end time (timestamp in ms) |
Fetching data from the Moprim cloud
context | the context |
---|---|
start | the start time (timestamp in ms) |
end | the end time (timestamp in ms) |
cacheOnly | set to true if you wish not to request data from the cloud |
Fetch the metadata from the Cloud. This function is usually called when one wants to know what data can be fetched from the Cloud
context | the contect |
---|
Fetching stats from the Moprim cloud
context | the context |
---|---|
last | the number of days for the last period |
cacheOnly | set to true if you wish not to request stats from the cloud |
Fetching stats from the Moprim cloud
context | the context |
---|---|
last | the number of days for the last period |
Sets an upload callback intent for the period upload.
intent | the intent to be executed |
---|
Update the activity with new metadata and a corrected label
context | the context |
---|---|
activity | the activity to correct |
correctedLabel | the new label |
metadata | the metadata |
Upload the collected data to the cloud pro-actively