Skip to content

Instantly share code, notes, and snippets.

@darko1002001
Created September 15, 2011 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darko1002001/1219030 to your computer and use it in GitHub Desktop.
Save darko1002001/1219030 to your computer and use it in GitHub Desktop.
GCAsset.upload()
// create the request with account, an upload progress listener and the asset id that was previously
verified and marked as new or verified ( not complete). Can accept one or multiple asset Ids.
returns an JSONArray of the status of each upload with asset id and status code and a response
GCAssetCollection with the parsed response.
GCBaseRequest request = GCAssets.upload(GCAccount.getInstance(getApplicationContext()),
new GCUploadProgressListener() {
@Override
public void onUploadStarted(String assetId, String filepath) {
Log.e(TAG, "Started: " + assetId + filepath);
}
@Override
public void onUploadFinished(String assetId, String filepath) {
Log.e(TAG, "Started: " + assetId + filepath);
}
@Override
public void onProgress(int total, int uploaded) {
Log.e(TAG, "Progress: " + "Total: " + total + " Uploaded" + uploaded);
}
}, "416");
sync:
request.execute();
async:
new GCAsyncRunner(request, this).execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment