How to post an image on Google Plus in an Android Application
android, camera, google-plus, image, post
Solution
You can specify the MediaStore Uri (which looks like content://media/external/images/media/42) instead of the absolute path on the file system.
Here's an example that takes an picture with the camera, and fires the ACTION_SEND intent with that image. If the Google+ app is installed, the user will be able to post the image they took from the Google+ app.
public class MyActivity extends Activity {
...
static final int IMAGE_REQUEST = 0;
protected void pickImage() {
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, IMAGE_REQUEST);
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == IMAGE_REQUEST) {
Uri uri = data.getData();
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/png");
// uri looks like content://media/external/images/media/42
intent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(i , "Share"));
}
}
}
Problem
I have post an image to Google Plus account in android application. I take a picture from camera and i want to post it on my google+ account. How can i do it ?