Android Screenshot Watcher (Screenshot Detection)
Branch: master
Clone or download
Latest commit aa42d10 Aug 2, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Update readme.md and add gif Feb 15, 2017
gradle/wrapper s Jan 31, 2017
shotwatch Clean up AndroidManifest.xml Mar 1, 2017
.gitignore Merge branch 'master' of https://github.com/abangfadli/shotwatch Jan 31, 2017
LICENSE Initial commit Jan 31, 2017
README.md Fix markdown Aug 1, 2018
build.gradle Clean up AndroidManifest.xml Mar 1, 2017
gradle.properties s Jan 31, 2017
gradlew s Jan 31, 2017
gradlew.bat s Jan 31, 2017
settings.gradle s Jan 31, 2017
shotwatch.gif Update readme.md and add gif Feb 15, 2017

README.md

ShotWatch

Android Screenshot Watcher (Screenshot Detection) using ContentObserver

ShotWatch

Usage

ShotWatch mShotWatch;


void onCreate() {
	Listener listener = new Listener() {
		public void onScreenShotTaken(ScreenShotData data) {
			textView.setText(data.getFileName());
			imageView.setImageURI(URI.parse(data.getPath());
		}
	}
	
	mShotWatch = new ShotWatch(getContentResolver(), listener);
}

// Register to begin receive event
void onResume() {
	mShotWatch.register();
}

// Don't forget to unregister when apps goes to background
void onPause() {
	mShotWatch.unregister();
}

Permission

android.permission.READ_EXTERNAL_STORAGE

In Android M, you need to handle runtime permission.

Gradle

compile 'com.abangfadli.shotwatch:shotwatch:1.0.4'