Easy Screenshot

Additional

Language
N/A
Version
N/A
Created
Sep 4, 2017
Updated
Jul 23, 2018
Owner
Newtron Labs (NewtronLabs)
Contributor
Newtron Labs (NewtronLabs)
1
Activity
Badge
Generate
Download
Source code

Announcement

Easy Screenshot

The easy way to take screenshots of your application programmatically.


In the build.gradle for your app include:

dependencies {
    compileOnly 'com.newtronlabs.easyscreenshot:easyscreenshot:2.0.0'
}

Step 2

Sample on how to use it.

public class MainActivity extends AppCompatActivity implements ICaptureListener
{
    private static final String TAG = "EasyScreenshot";

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        ScreenshotAdapter.getInstance().capture(this, this);
    }

    @Override
    public void onResult(@Result int result, Bitmap bitmap)
    {
        if(result == Result.FAILED)
        {
            Log.d(TAG, "Failed");
            return;
        }

        Log.d(TAG, "Succeeded");

        boolean res = ScreenshotAdapter.getInstance().saveToFolder(bitmap, "Screenshots", "MyScreenshot");   
    }
}