-2

I am developing an application in which there is a button on click of that button i want the screenshot of android screen not that application screen my phone is unrooted. Is it possible to take screenshot of unrooted phone.?

  • similar ques http://stackoverflow.com/questions/2661536/how-to-programatically-take-a-screenshot-on-android – Abhishek Sep 17 '15 at 05:30

1 Answers1

3

Yes it is possible.

have a look at 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.

How to Implement?

Modifying the manifest XML

In order for Android service to be accessible, add the following declaration to your client application's XML manifest:

<service android:name="pl.polidea.asl.ScreenshotService">
    <intent-filter>
            <action android:name="pl.polidea.asl.ScreenshotService.BIND" />
            <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>
</service>

Binding service

To obtain the IScreenshotProvider interface one must bind to the ASL service (pl.polidea.asl.ScreenshotService) using Context.bindService - for example:

// (using class name)
Intent intent = new Intent();
intent.setClass (this, pl.polidea.asl.ScreenshotService.class);
bindService (intent, aslServiceConnection, Context.BIND_AUTO_CREATE);

References

Chintan Rathod
  • 25,864
  • 13
  • 83
  • 93