App错误报告捕获工具:Telescope
一个简单的工具能够轻松在你的App中捕获Bug报告的工具。
Usage
Place aTelescopeLayoutat the root of your hierarchy.
Add a callback to the view group withsetLens(Lens). Telescope provides two default implementations:
- EmailLens: Compose an email with the provided addresses and subject (optional).
- EmailDeviceInfoLens: EnhancesEmailLensby pre-populating the email body with app and device info
Screenshots will be stored on the external storage in/Telescope/com.app.package/. To have Telescope clean up the screenshots folder, callTelescopeLayout.cleanUp(Context). Ideally, this would be called in theonDestroy()method of yourActivityorFragment.
If you are using the Gradle-based build system, you can wrap this view group around your activity layouts only in the debug builds.
Permissions
Pre-KitKat,WRITE_EXTERNAL_STORAGEis required for saving screenshots. Screenshots can be disabled using the configuration options below.
Configuration
The view group can be configured as follows:
- Set the number of fingers to trigger withapp:pointerCount/setPointerCount(int)
- Set the progress color withapp:progressColor/setProgressColor(int)
- Disable screenshots withapp:screenshot/setScreenshot(boolean)
- Screenshot children only withapp:screenshotChildrenOnly/setScreenshotChildrenOnly(boolean)
- Set the screenshot target withsetScreenshotTarget(View)
- Disable vibration withapp:vibrate/setVibrate(boolean)
Download
Download the latest JAR or grab via Gradle:
compile 'com.mattprecious.telescope:telescope:1.4.0@aar'
or Maven:
<dependency> <groupId>com.mattprecious.telescope</groupId> <artifactId>telescope</artifactId> <version>1.4.0</version> <type>apklib</type> </dependency>