mattprecious / telescope Goto Github PK
View Code? Open in Web Editor NEWA simple tool to allow easy bug report capturing within your app.
License: Apache License 2.0
A simple tool to allow easy bug report capturing within your app.
License: Apache License 2.0
I'd like to be able to clean up the status bar with Demo Mode before taking the screenshot.
Something could go in trigger()
(maybe only invoked when the screenshot mode is not NONE
?), and the implementer would call through to continue the capture.
I don't yet have a clear idea of what the mechanism would look like; this might be a fork if it's overly complex.
Getting the external cache directory causes strict mode errors for disk access on mainthread. It looks like it might be possible to defer that call until after the constructor, possibly until the SaveScreenshotTask. I can try and submit a PR fixing this up.
07-05 13:31:41.118 8906-8906/com.app.package D/StrictMode: StrictMode policy violation; ~duration=58 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=4784159 violation=2
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)
at libcore.io.BlockGuardOs.statvfs(BlockGuardOs.java:297)
at java.io.File.getTotalSpace(File.java:1126)
at android.os.storage.StorageManager.getStorageLowBytes(StorageManager.java:943)
at android.os.storage.VolumeInfo.buildStorageVolume(VolumeInfo.java:362)
at com.android.server.MountService.getVolumeList(MountService.java:2758)
at android.os.storage.IMountService$Stub.onTransact(IMountService.java:1676)
at android.os.Binder.execTransact(Binder.java:453)
# via Binder call with stack:
android.os.StrictMode$LogStackTrace
at android.os.StrictMode.readAndHandleBinderCallViolations(StrictMode.java:1911)
at android.os.Parcel.readExceptionCode(Parcel.java:1601)
at android.os.Parcel.readException(Parcel.java:1570)
at android.os.storage.IMountService$Stub$Proxy.getVolumeList(IMountService.java:790)
at android.os.storage.StorageManager.getVolumeList(StorageManager.java:883)
at android.os.Environment$UserEnvironment.getExternalDirs(Environment.java:83)
at android.os.Environment$UserEnvironment.buildExternalStorageAppFilesDirs(Environment.java:127)
at android.os.Environment.buildExternalStorageAppFilesDirs(Environment.java:539)
at android.app.ContextImpl.getExternalFilesDirs(ContextImpl.java:465)
at android.app.ContextImpl.getExternalFilesDir(ContextImpl.java:458)
at android.content.ContextWrapper.getExternalFilesDir(ContextWrapper.java:213)
at android.content.ContextWrapper.getExternalFilesDir(ContextWrapper.java:213)
at com.mattprecious.telescope.TelescopeLayout.getScreenshotFolder(TelescopeLayout.java:392)
at com.mattprecious.telescope.TelescopeLayout.<init>(TelescopeLayout.java:138)
at com.mattprecious.telescope.TelescopeLayout.<init>(TelescopeLayout.java:80)
at com.mattprecious.telescope.TelescopeLayout.<init>(TelescopeLayout.java:76)
...
at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1189)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2398)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.access$900(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:764)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
When you target N sharing a file://
uri will cause a FileUriExposedException
(source). There is also a StrictMode check for this since API 18.
StrictMode E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding re
source leaks.
E java.lang.Throwable: Explicit termination method 'release' not called
E at dalvik.system.CloseGuard.open(CloseGuard.java:184)
E at android.view.Surface.setNativeObjectLocked(Surface.java:460)
E at android.view.Surface.<init>(Surface.java:152)
E at android.media.ImageReader.nativeGetSurface(Native Method)
E at android.media.ImageReader.<init>(ImageReader.java:130)
E at android.media.ImageReader.newInstance(ImageReader.java:100)
E at com.mattprecious.telescope.TelescopeLayout$6.run(TelescopeLayout.java:615)
E at android.os.Handler.handleCallback(Handler.java:739)
E at android.os.Handler.dispatchMessage(Handler.java:95)
E at android.os.Looper.loop(Looper.java:135)
E at android.app.ActivityThread.main(ActivityThread.java:5254)
E at java.lang.reflect.Method.invoke(Native Method)
E at java.lang.reflect.Method.invoke(Method.java:372)
E at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
looks like this is caused by imageReader not being closed at https://github.com/mattprecious/telescope/blob/master/telescope/src/main/java/com/mattprecious/telescope/TelescopeLayout.java#L616
found via strictmode
I have a class which extends TelescopeLayout. In the constructor, I call setProgressColor (to a blue color), setLens, and setScreenshotMode(ScreenshotMode.NONE). Everything works fine, except the progress border does not disappear after the screenshot is captured. If I instead call setScreenshotMode(ScreenshotMode.CANVAS), or do not call setScreenshotMode, the progress border correctly disappears after the screenshot is captured. Is this a bug, or is there something additional I should do in order to use ScreenshotMode.NONE correctly?
We are currently developping an application, and using Telescope as a mean for our beta-testers to send us screenshots of problems, but Telescope is crashing with ActivityNotFoundException on a specific phone (namely a HUAWEI P8 aka Huawei GRA-L09).
This seems to be a known bug of this specific model/vendor so nothing can be done... except catching the exception when it happens (most likely with a bit of log and comment ;))!
Exception happens in com.matttpreciousRequestCaptureActivity, when calling the "startActivityForResult" in requestCapture method (line 45).
Bug known and reported to huawei here : http://support.huawei.com/huaweiconnect/enterprise/thread-146661-1-1.html?lang=en
Bug known and reported to Android here : https://code.google.com/p/android/issues/detail?id=178352
03-01 10:01:53.078 12936-12936/com.mattprecious.telescope.sample W/Bundle: Key android.intent.extra.TEXT expected ArrayList<CharSequence> but value was a java.lang.String. The default value <null> was returned. 03-01 10:01:53.078 12936-12936/com.mattprecious.telescope.sample W/Bundle: Attempt to cast generated internal exception: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.ArrayList at android.os.BaseBundle.getCharSequenceArrayList(BaseBundle.java:1067) at android.os.Bundle.getCharSequenceArrayList(Bundle.java:922) at android.content.Intent.getCharSequenceArrayListExtra(Intent.java:5471) at android.content.Intent.migrateExtraStreamToClipData(Intent.java:8173) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1572) at android.app.Activity.startActivityForResult(Activity.java:3921) at android.app.Activity.startActivityForResult(Activity.java:3881) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:784) at android.app.Activity.startActivity(Activity.java:4208) at android.app.Activity.startActivity(Activity.java:4176) at com.mattprecious.telescope.EmailLens.onCapture(EmailLens.java:71) at com.mattprecious.telescope.TelescopeLayout$SaveScreenshotTask.onPostExecute(TelescopeLayout.java:582) at com.mattprecious.telescope.TelescopeLayout$SaveScreenshotTask.onPostExecute(TelescopeLayout.java:543) at android.os.AsyncTask.finish(AsyncTask.java:651) at android.os.AsyncTask.-wrap1(AsyncTask.java) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5443) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
I am getting this error log here to long press with two finger:
https://goo.gl/9uRTkz
Hey Matt,
I was just wondering if you intend backporting this library to minSdkVersion 8, or if you wouldn't mind accepting pull requests for these changes.
Thanks!
Crash being reported only on Android 10. The stack trace is as follows:
Caused by java.lang.SecurityException
Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
android.os.Parcel.createException (Parcel.java:2071)
android.os.Parcel.readException (Parcel.java:2039)
android.os.Parcel.readException (Parcel.java:1987)
android.media.projection.IMediaProjection$Stub$Proxy.start (IMediaProjection.java:231)
android.media.projection.MediaProjection.<init> (MediaProjection.java:58)
android.media.projection.MediaProjectionManager.getMediaProjection (MediaProjectionManager.java:104)
com.mattprecious.telescope.TelescopeLayout$4.onReceive (TelescopeLayout.java:198)
android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args (LoadedApk.java:1550)
android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run (-.java:2)
android.os.Handler.handleCallback (Handler.java:883)
android.os.Handler.dispatchMessage (Handler.java:100)
android.os.Looper.loop (Looper.java:214)
android.app.ActivityThread.main (ActivityThread.java:7356)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:930)
Is there a possibility of using telescope (or modifying it to be used) without having to add the TelescopeLayout to each of the activity layouts?
I'm thinking of something like adding a bit of code to the BaseActivity and then being able to enable bug reporting for every screen in the app for alpha/beta builds.
Hi guys,
Thanks for a great tool ๐
What about capturing dialogs? Are there any plans for supporting this?
There is no benefit to implementing BitmapProcessorListener for users. Perhaps it should be an abstract class.
I think the current one didn't use the palette intermediate image in ffmpeg.
I could send an updated gif, but I can't reproduce the current gif exactly easily since I can't tell Inbox that I have Matt's email.
If replication is important, there is a copypasta script here
If not, I can send a PR.
http://developer.android.com/about/versions/android-5.0.html#ScreenCapture
Two fingers triggers callback, dialog or something says "record video", two finger trigger again to stop. Bonus if you automatically clip the video to remove the two finger trigger from the end!
Then i try to take screenshot from camera preview, it take black screen.
How to fix it ?
Should omit the screenshot when an OOM error has occurred instead of crashing, or possibly re-try with an ALPHA_8
bitmap.
Was trying to put together a little demo video using this (v2) and didn't think about what would happen. Specifically, I was using AndroidTool to record a video. When I started the screen grab via telescope though, it appears to start, but then never completes/calls back to the lens.
When I have Google Maps in the hierarchy the screenshot shows just a black surface. Here is the screenshot taken with Telescope.
I think #13 would fix this for > Lollipop devices.
Hi,
I've been using the library and it is really helpful.
I have a rooted Nexus 6 with some gesture application. It was interfering with multi-touch events and 3+ pointerCount
was not working. I had the same issue with another cheap Android device. Since I have 2 devices not working I started debugging the library and spent ~3 hours. ๐ I forgot that I had that gesture application installed.
Since I have multi-touch pan-zoom features in my app, I want to use pointerCount 3.
For the other cheap device, I used FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND in PackageManager
to detect the device. This feature gives us that the device is capable to detect 5 fingers.
I assumed that there are no devices that detect only 3-4 fingers. It should be either 2 or 5 or 5+.
Do you think the library should have some built-in mechanism to detect this and adjust itself? Like make pointerCount
2 if the device is not capable to detect 5 fingers? Or at least give warning to developers.
What do you think? Depending on your comment, I would like to open a PR.
I haven't find any API method that will disable receiving touch events.
Is there one that should be used in such case?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.