7
votes

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?

2

2 Answers

4
votes

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

1
votes

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