2

Google plusで一度に複数の写真をアップロードする方法を知りたいですか?

Google プラスのサンプル コードから、一度に 1 つの写真と 1 つのメッセージをアップロードする方法を見つけました。

String action = "/?view=true";
Uri callToActionUrl = Uri.parse(getString(R.string.plus_example_deep_link_url) + action);
String callToActionDeepLinkId = getString(R.string.plus_example_deep_link_id) + action;

// Create an interactive post builder.
builder = new PlusShare.Builder(this, plusClient);

// Set call-to-action metadata.
builder.addCallToAction(LABEL_VIEW_ITEM, callToActionUrl, callToActionDeepLinkId);

// Set the target url (for desktop use).
builder.setContentUrl(Uri.parse(getString(R.string.plus_example_deep_link_url)));

// Set the target deep-link ID (for mobile use).
builder.setContentDeepLinkId(getString(R.string.plus_example_deep_link_id),
        null, null, null);

// Set the message.
builder.setText("user message");

// Set the image
Uri uri = Uri.fromFile(new File("[user file path]"));
builder.setStream(uri);

FacebookやTwitterのように複数の写真をアップロードすることについて知っている人はいますか?

4

1 に答える 1

0

メソッドで動作するはずaddStream()ですが、残念ながら...動作しません。実際、アプリケーションがクラッシュします。

長い検索の後、私は最終的にそれを手に入れました: 簡易化された G+ SDK を使用する場合は不可能です! (Android専用のもの)。

そこにある Google API ファミリーに含まれる 2 番目のものがあります。

http://code.google.com/p/google-api-java-client/wiki/APIs#Google+_API

これにより、複数の写真を含む、より高度な投稿を作成できます。

残念ながら、2 番目の SDK ははるかに低レベルであり、Android 専用ではありません。これは、http リクエストに対する一種の Java 抽象化です。

よろしく

于 2013-08-27T22:04:25.930 に答える