ScreenshotApp adds a Quick Settings tile that grabs the current screen, lets you outline a rectangle, and copies the cropped result directly to the clipboard. The full workflow runs without any floating overlays so it stays out of the way until you need it.
- Quick Settings tile for one-tap captures.
- Full-screen grab followed by an on-device cropping surface.
- Cropped image automatically saved and placed on the clipboard.
- Screen capture permission cached so repeated captures do not re-prompt.
- Persistent logging written to
Android/data/<package>/files/logs/screenshot_app.log.
- Install the app on your device.
- Launch ScreenshotApp from the launcher.
- Tap Grant Screen Capture Access to approve the MediaProjection permission. A confirmation toast appears when the permission is stored.
- Tap Open Quick Settings Editor (or manually open the editor) and add the Screenshot tile. Position it wherever it is convenient.
- Pull down the Quick Settings shade and tap the Screenshot tile.
- The app captures the current screen and opens the cropping view.
- Drag to select the rectangle you want to keep. When you release, the cropped image is saved and copied to the clipboard automatically. Use the Cancel button if you want to discard the capture.
The capture service and crop activity log detailed events to:
Android/data/com.example.screenshotapp/files/logs/screenshot_app.log
You can retrieve the log file with:
adb pull /sdcard/Android/data/com.example.screenshotapp/files/logs/screenshot_app.logRun unit tests before committing changes:
./gradlew testThe suite runs on Robolectric so Android framework classes (e.g., Bitmap, Intent) behave like they do on device.
ProjectionPermissionRepositorycaches the most recent MediaProjection approval. Callstoreafter any successful permission flow andclearwhen tokens become invalid.ProjectionRequestActivityrequests a full-display capture on Android 14+ usingMediaProjectionConfig.createConfigForDefaultDisplay()so users skip the partial-share picker.ScreenshotCaptureServiceperforms the foreground capture and launchesCropScreenshotActivitywith a cached PNG. The crop view scales the bitmap using a center-fit matrix; keep scaling logic in sync if you change rendering behaviour.- Clipboard integration still uses a FileProvider-backed URI. Update
file_paths.xmlif the storage location changes. ScreenshotTileServicemust stay exported so System UI can bind; theandroid.permission.BIND_QUICK_SETTINGS_TILEpermission continues guarding access.- Remember to keep
.gitignorein sync when new build artifacts appear.
This project is licensed under the GNU General Public License v3.0.
You are free to use, modify, and distribute this app as long as any derivative work is also released under the GPL v3 license and includes proper attribution to the original author.