Does Google+ support sharing from an Android app yet? I wanted to know because I have implemented this for twitter and facebook on my app and would like to do the same for Google+. I did read that they have an API now but it's only for development and testing and apps cannot be published. Is this correct?
The Google+ Android API can be found here: https://developers.google.com/+/mobile/android/
The code snippet for sharing on Google+ is a little ways down that page https://developers.google.com/+/mobile/android/#share_on_google :
For example, in your XML:
<Button
android:id="@+id/share_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Share on Google+" />
In your Activity:
Button shareButton = (Button) findViewById(R.id.share_button);
shareButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// Launch the Google+ share dialog with attribution to your app.
Intent shareIntent = ShareCompat.IntentBuilder.from(ExampleActivity.this)
.setType("text/plain")
.setText("Welcome to the Google+ platform. https://developers.google.com/+")
.getIntent()
.setPackage("com.google.android.apps.plus");
startActivity(shareIntent);
}
});
Take a peek at this post from Julia Ferraiol i on the Google Plus developer blog :
Sharing Rich Content From Your Android Apps, to Google+ and Beyond
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.