Thanks ianhanniballake for your help. I add this to clarify the answer (for example, achievements can be automatically published) and summarize what we learned by adding this function.
I hope that Googler will look at our Pro / Con, because with 1.0 SDK it is difficult to recommend API, but with improvements it would be useful.
Automatic sharing of Google gaming services achievements (starting from 7/13 SDK):
- Achieving progress (e.g. unlocking) is not shared / visible through g +
- sdk is not conducive to sharing achievements. Something like PlusShare.Builder.shareUnlock () will help if auto-sharing is not added, but for now to exchange achievements on g + you have to implement it from scratch
- imo nothing prevents Google from adding automatic distribution of achievements in the future. Their sign in the stream gets permission from the user to share "game progress," and other messages say the leaderboards have social sharing.
From our experience: Pro / Con Achievements with Google Play Services :
Pro
- Google’s official decision, so reliably, will be the deactivation of the Android standard
- Google could make progress common / visible through g + if they wanted to. That would make it much more valuable.
Con
- The user must be ready to log in to g + to view / save achievements. Some users will not do this and will be annoyed; they cannot use the achievements.
- Client-server synchronization has complex policy and implementation issues. For instance. the user can log in after significant progress of the game; can be played simultaneously on multiple devices; can log out and log in as another user game.
- Testing is difficult because there is no way to succeed with reset for test accounts via the Android API or server interface. I guess Google can fix this ... please! Some posts say deleting / re-adding a reset to the tester account, but this did not work for us, or maybe it only works with the pre-release
- Google’s design assumes that their server manages user interface assets (icons, strings) and achievement policies. It is good if achievements are visible in g + in the future, but until then it will be a hassle. For instance. see code below
- The client interface is approved but not polished. For instance. the text area of the description is limited, "Defeat of the skeleton king in battle" is truncated in some user interface modes, and there is no way to see the full information. Additional achievements are limited to 10,000 steps (why?)
The recommendation . If you think that Google will make achievements visible with g +, this is a great feature and explains most of the “con” above. However, if the achievements remain undisclosed, then using the Google API was less reliable and significantly more work than curtailing our own client implementation.
A WARNING. Google Play game services from 7/15/13 seem to have an intermittent error when using ImageManager. See ClassCastException: com.google.android.gms.common.images.e We switched to combining unlock images in the APK and no longer use ImageManager
This is our legacy bitmap extraction code when a user unlocks an achievement:
Uri unlockedUri = achievement.getUnlockedImageUri(); if (unlockedUri != null) { ImageManager im = ImageManager.create(context); // Warning -- loadImage may silently skip call back if called too soon after achievement load im.loadImage(new ImageManager.OnImageLoadedListener() { @Override public void onImageLoaded(Uri arg0, Drawable drawable) { // Attempt to convert the Drawable to a sharable image; if it fails we'll post text only Bitmap bitmap = null; if (drawable instanceof BitmapDrawable) { bitmap = ((BitmapDrawable) drawable).getBitmap(); } else { log.warn("not BitmapDrawable ", drawable); } listener.onBitmapLoaded(bitmap); } }, unlockedUri); } else { log.debug("no unlockedImageUri"); listener.onBitmapLoaded(null); }
One google option that does not provide automatic sharing of g + is that when you still need to roll your own exchange, you can also do this for other services in addition to g +. For instance. we offer sharing unlocked achievemets for twitter. But perversely, this is a good reason why Google should make social achievements on g + asap ... developers are lazy, and this would provide a lot of games in which social achievements were on g + at first; -)
source share