Taking device screenshot while application is clos

2019-08-12 17:26发布

I know this question is ask number of times but wait i am asking something different.

I follow this post and able to take screen shot. but is it possible to take screen shot when my application is closed.

Supposed i set timer like after 1 hour and i close my app. Then exactly after 1 hour device need to take a screen shot whatever on a screen.

Is this possible with Background Services?

I already follow code and also did some research but is this possible?
Is it necessary to root device to take screenshot.

Please give me any hint or reference.
Thanks in advance.

1条回答
Ridiculous、
2楼-- · 2019-08-12 17:52

Try using : call the methods in this library from service.

http://code.google.com/p/android-screenshot-library/

Android Screenshot Library (ASL) enables to programmatically capture screenshots from Android devices without requirement of having root access privileges. Instead, ASL utilizes a native service running in the background, started via the Android Debug Bridge (ADB) once per device boot.

DeveloperGuide

UPDATE:

The method mentioned in your reference will not work in that case, as it reads the view that are drawn and in application context. where as if application is closed then you cant get that context.( at-least on non rooted phone).

On rooted device you can read complete frame-buffer so no need to worry about the application context.

I did tried to use the ASL once and it worked out good for me.

查看更多
登录 后发表回答