Skip to content

Android Screenshot Watcher (Screenshot Detection)

License

Notifications You must be signed in to change notification settings

marain87/shotwatch

 
 

Repository files navigation

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'

About

Android Screenshot Watcher (Screenshot Detection)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%