Reputation: 411
I'm working on a project that needs share image from my app to Google+. But when find out some samples relating to my problems, they requires installed Google+ from Google Play for sharing anything. So the question is : How can I share from my app without installing any extra app? Or install Google+ from Google Play is the only way to solve my problem?
Thank you for your attention!
Upvotes: 0
Views: 1205
Reputation: 3215
Hope May this help you...
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");
The Google+ app only supports content:// URIs. You will need to use the MediaStore
API for this...
Upvotes: 2
Reputation: 6319
I guess you can always take a look at the web api if they provide you with means to authenticate your user and upload posts with an image.
I assume however, that simply using the app itself will save you a lot of hassle.
Upvotes: 0