Android- isUserAMonkey()

View previous topic View next topic Go down

Android- isUserAMonkey()

Post by BIT0122-Amit on Sun Jun 05, 2011 8:59 pm

Today I just noticed some of the functions available in Android libraries. Apparently, Google decided to make programmers give a chance to humor themselves while coding.

Like:

public static int wtf (String tag, Throwable tr)
Since: API Level 8
What a Terrible Failure: Report an exception that should never happen.
Similar to wtf(String, String), with an exception to log.

And

public static boolean isUserAMonkey()

Since: API Level 8
Returns "true" if the user interface is currently being messed with
by a monkey.

Of course, we know that it seriously does not mean, "what a terrible failure"

Anyway, check this link guys. Gave me a good laugh

http://www.reddit.com/r/programming/comments/c6u6f/new_android_22_froyo_api_logwtf/

_________________________________________________________________
Adminship / Moderatorship is not about power, it is about Responsibility.

|About me|My Blog|
avatar
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

View user profile http://iitdu.forumsmotion.com

Back to top Go down

Re: Android- isUserAMonkey()

Post by BIT0112-Rokon on Mon Jun 06, 2011 4:50 am

Interesting ..SmileSmile

I will write some like this:)Smile

if(isUserMonkey()){
// do something ..
}else if(isUserAmit()){
kickOnHisButt();
} else {
// do something else
}

_________________________________________________________________


Code Explosion Blog | Code Explosion Wiki | The Rokonoid | নির্ঝরিণী
avatar
BIT0112-Rokon
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : O+
Posts : 673
Points : 1269

View user profile http://blog.codexplo.org

Back to top Go down

Re: Android- isUserAMonkey()

Post by BIT0122-Amit on Mon Jun 06, 2011 12:37 pm

I would write:

Code:
if(isUserMonkey()){
 if(userIsBRR){
          System.out.println("Br br br br br br brrrrrrrrrrrrrrrrrrrrrrrrrr");
          System.Exit(9);
}

}

very very funny

_________________________________________________________________
Adminship / Moderatorship is not about power, it is about Responsibility.

|About me|My Blog|
avatar
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

View user profile http://iitdu.forumsmotion.com

Back to top Go down

Re: Android- isUserAMonkey()

Post by benjamin444 on Fri Aug 05, 2011 7:52 pm

I get the exception when trying to use the isUserAMonkey API on a keydown. mAM = (android.app.ActivityManager)getSystemService(Context.ACTIVITY_SERVICE); if (mAM.isUserAMonkey()) {return true;} Any reason why this may be happening?

benjamin444
Pre-Alpha Release
Pre-Alpha Release

Course(s) :
  • N/A

Blood Group : NULL
Posts : 3
Points : 3

View user profile

Back to top Go down

Re: Android- isUserAMonkey()

Post by johnmathew44 on Fri Feb 24, 2012 11:09 pm

What is Monley runner?actually

johnmathew44
Pre-Alpha Release
Pre-Alpha Release

Course(s) :
  • N/A

Blood Group : NULL
Posts : 1
Points : 1

View user profile

Back to top Go down

Re: Android- isUserAMonkey()

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum