10

Is there an Android API analogous to java.awt.Robot, i.e. an API allowing to take screenshots?

Paŭlo Ebermann
  • 73,284
  • 20
  • 146
  • 210
manju
  • 847
  • 3
  • 16
  • 43
  • You need to ask 1 question: http://stackoverflow.com/questions/4416059/how-to-download-some-java-jar-library-files – zengr Dec 11 '10 at 10:21

4 Answers4

7

If you would like to simulate touch events (just like robot does with mouse clicks) use the utility class TouchUtils.

dacwe
  • 43,066
  • 12
  • 116
  • 140
3

java.awt.Robot is not available in the Android SDK.

If you want to make screenshots by your own during development you can use DDMS. If your application should make screenshots, I think this requires root. There are application that can do that, e.g.

http://handheld.softpedia.com/get/Others/Screenshot-Android-71410.shtml

There is also a library available that may be useful for you:

Android Screenshot Library (ASL)

However, there is also a disucssion on SO:

How to capture the android device screen content?

Community
  • 1
  • 1
1

Robot class is only available in Java, this is not supported in Android, Too see what are the classes supported in Android, pls click this

Vishal Yadav
  • 3,642
  • 3
  • 25
  • 42
Sankar Ganesh PMP
  • 11,927
  • 11
  • 57
  • 90
0

class TouchUtils... This class was deprecated in API level 24. Use Espresso UI testing framework instead. New tests should be written using the Android Testing Support Library.

https://developer.android.com/training/testing/ui-automator

Marin
  • 1
  • 1