9

I was looking at the new APIs introduced in Android 2.2. While looking at the ActivityManager class I came across the following method:

public static boolean isUserAMonkey()

Used to determine whether the user making this call is subject to teleportations.

Returns whether the user making this call is a monkey.

How and when should this be used?

Community
  • 1
  • 1
Confuse
  • 5,646
  • 7
  • 36
  • 58
  • 1
    possible duplicate of [Strange function in ActivityManager: isUserAMonkey. What does this mean, what is its use?](http://stackoverflow.com/questions/7792123/strange-function-in-activitymanager-isuseramonkey-what-does-this-mean-what-is) – Hacketo Jun 22 '15 at 11:27

2 Answers2

4

as per android docs

Returns "true" if the user interface is currently being messed with by a monkey. 

to know the application is testing using monkey or not

Rathan Kumar
  • 2,567
  • 2
  • 17
  • 24
1

well if you do some automatic testing there will be test users. this method checks if the current user is such a test user.

about how to use it there are already a lot of topics, see: clickMe

12dollar
  • 645
  • 3
  • 17