从Android获取Blobstore上传URL的语法是什么?

时间:2011-11-17 11:00:39

标签: android blobstore

我有Blobstore上传为GWT工作,但现在我需要我的Android应用程序上传到Blobstore。我看到这篇文章解释了如何在我有URL后上传,但它没有显示获取URL: Using Google BlobStore with an Android application

我的问题是:

  1. 我发送到哪个URL?
  2. 获取blobstore的语法是什么?
  3. 由于

1 个答案:

答案 0 :(得分:0)

我喜欢这样:

Widget.presenter.java:

uploadButton.addClickHandler(new ClickHandler() {
 @Override
 public void onClick(ClickEvent event) {
 //init action
 imageService.getBlobStoreUploadUrl(new AsyncCallback<String>() {
      @Override
      public void onFailure(Throwable caught) {
        Window.alert("Oups Error at ImageUploaderPresenter");
      }
      @Override
      public void onSuccess(String result) {
        uploadForm.setActionUpload(result);
        uploadForm.submit();
      }
    }
  });
}

ImageServiceImpl.java:

@Override
public String getBlobStoreUploadUrl() {
    //Map the UploadURL to the uploadservice which will be called by
    //submitting the FormPanel
    return blobstoreService.createUploadUrl("/imageUpload");
}