Skip to content

Android library that enables users to take screenshots for Views and Activities.

Notifications You must be signed in to change notification settings

abdallahalaraby/Blink

Repository files navigation

Blink

Download

Android library that enables users to take screenshots for Views and Activities.

Dependency:

Include Blink into your project by adding the following line in your module-level build.gradle
compile 'com.abdallahalaraby.blink:library:0.1.2@aar'

Usage:

Bitmap bitmap = Screenshot.getInstance().takeScreenshotForView(view); // Take Screenshot for View
imageView.setImageBitmap(bitmap);

In case you want to take a screenshot for the whole activity use:

Bitmap bitmap = Screenshot.getInstance().takeScreenshotForScreen(activity); // Take Screenshot for Activity
imageView.setImageBitmap(bitmap);

If you want to store the bitmap to storage:

Bitmap bitmap = Screenshot.getInstance().takeScreenshotForView(view);
String path = Environment.getExternalStorageDirectory().toString() + "/test";
FileUtils.getInstance().storeBitmap(bitmap, path);

Permissions:

The following permission is needed if you want to store the bitmaps:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />