在Android应用中将图像分享到Google+?

我正在开发一个项目,需要将我的应用中的图片共享到Google+。 但是,当找出与我的问题相关的一些示例时,他们需要从Google Play安装Google+才能分享任何内容。 所以问题是:我如何从我的应用程序分享,而无需安装任何额外的应用程序?或者从Google Play安装Google+是解决我的问题的唯一方法?在Android应用中将图像分享到Google+?

感谢您的关注!

回答:

希望五月帮你...

File tmpFile = new File("/path/to/image"); 

final String photoUri = MediaStore.Images.Media.insertImage(

getContentResolver(), tmpFile.getAbsolutePath(), null, null);

Intent shareIntent = ShareCompat.IntentBuilder.from(this)

.setText("Hello from Google+!")

.setType("image/jpeg")

.setStream(Uri.parse(photoUri))

.getIntent()

.setPackage("com.google.android.apps.plus");

的Google+应用只支持内容://的URI。您需要为此使用MediaStore API ...

回答:

我想你总是可以看看web api,如果他们提供的手段来验证你的用户和上传与图像的职位。

但是,我认为只是使用应用程序本身会为您节省很多麻烦。

以上是 在Android应用中将图像分享到Google+? 的全部内容, 来源链接: utcz.com/qa/264533.html

回到顶部