Back to project page snappyfrog.
The source code is released under:
Apache License
If you think the Android project snappyfrog listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.masseranolabs.snappyfrog; /* ww w. j av a2 s . c o m*/ import android.content.Intent; import android.net.Uri; import com.badlogic.gdx.Gdx; public class AndroidServices implements PlatformServices { @Override public boolean isSharingAvailable() { return Gdx.files.isExternalStorageAvailable(); } @Override public boolean shareCurrentScreen() { Intent sharingIntent = new Intent(Intent.ACTION_SEND); String screenshotPath = ScreenshotFactory.saveScreenshot(Gdx.files.getExternalStoragePath() + "/screenshots/", true); // If we were able to take a screenshot if (!screenshotPath.equals("")){ Uri screenshotUri = Uri.parse("file://" + screenshotPath); sharingIntent.setType("image/png"); sharingIntent.putExtra(Intent.EXTRA_SUBJECT, "You MUST try this game!"); sharingIntent.putExtra(Intent.EXTRA_TEXT, "This was my score! http://www.playsnappyfrog.com"); sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri); MainActivity.app.startActivity(Intent.createChooser(sharingIntent, "Share via")); return true; }else{ return false; } } @Override public boolean willResumeAfterShare() { return true; } @Override public boolean delayHint() { return false; } @Override public boolean supportsFreetype() { return true; } @Override public boolean isGamePadButtonPressed() { return false; } @Override public void initGamePadControllers() {} }