All In One Script



PHP,HTLM,CSS,Jquery,AJAX,Javascript and etc doubts and sample codes

  • Home
  • Javascript
  • PHP
  • CSS
  • SQL/MYSQL

Proper use cases for Android UserManager.isUserAGoat()?

by Blogger 5:29:00 AM android java usermanager

Proper use cases for Android UserManager.isUserAGoat()?

I was looking at the new APIs introduced in Android 4.2. While looking at the UserManager class I came across the following method:
    public boolean isUserAGoat()
     Used to determine whether the user making this call is subject to teleportations.
    Returns whether the user making this call is a goat.
How and when should this be used?

Answer:

From their source, the method used to return false until it was changed in API 21.
/**
 * Used to determine whether the user making this call is subject to
 * teleportations.
 * @return whether the user making this call is a goat 
 */
public boolean isUserAGoat() {
    return false;
}
It looks like the method has no real use for us as developers. Someone has previously stated that it might be an Easter egg.
Edit:
In API 21 the implementation was changed to check if there is an installed app with the package com.coffeestainstudios.goatsimulator
/**
 * Used to determine whether the user making this call is subject to
 * teleportations.
 *
 * <p>As of {@link android.os.Build.VERSION_CODES#LOLLIPOP}, this method can
 * now automatically identify goats using advanced goat recognition technology.</p>
 *
 * @return Returns true if the user making this call is a goat.
 */
public boolean isUserAGoat() {
    return mContext.getPackageManager()
            .isPackageAvailable("com.coffeestainstudios.goatsimulator");
}
Here is the source link

http://stackoverflow.com/questions/13375357/proper-use-cases-for-android-usermanager-isuseragoat
READ MORE
SHARE :

Search This Blog

Followers

  • Popular
  • Recent
  • Comments
    Serving XHTML and self-closing tags
    Get first key in a (possibly) associative array?
    How to efficiently iterate over each Entry in a Map?
    In Java, difference between default, public, protected, and private
    Solved : curl_init() function not working in Ubuntu
    Does finally always execute in Java?
    How to avoid Java code in JSP files?
    How can I make the cursor a hand when a user hovers over a list item?
    How to get Real IP,ISP,Country,City and etc from Visitor using PHP
    Why does this code using random strings print “hello world”?

Instagram

About

Popular Posts

  • Serving XHTML and self-closing tags
    Serving XHTML and self-closing tags I am trying to follow the xhtml 1.0 strict standard as I am creating my website. Right now, validat...
  • Get first key in a (possibly) associative array?
    Get first key in a (possibly) associative array? What's the best way to determine the first key in a possibly associative array? My...
  • How to efficiently iterate over each Entry in a Map?
    How to efficiently iterate over each Entry in a Map? If I have an object implementing the  Map  interface in Java and I wish to iterate...
  • In Java, difference between default, public, protected, and private
    In Java, difference between default, public, protected, and private In Java , are there clear rules on when to use each of access modifi...
  • Solved : curl_init() function not working in Ubuntu
    Solved : curl_init() function not working in Ubuntu  Here solved the error  Fatal error: Call to undefined function curl_init() ...
  • Does finally always execute in Java?
    Does finally always execute in Java? I have a try/catch block with  return s inside it. Will the finally block be called? For example...
  • How to avoid Java code in JSP files?
    How to avoid Java code in JSP files? I'm new to Java EE and I know that something like the following three lines <%= x + 1 %...
  • How can I make the cursor a hand when a user hovers over a list item?
    How can I make the cursor a hand when a user hovers over a list item? I've got a list, and I have a click handler for its items: ...
  • How to get Real IP,ISP,Country,City and etc from Visitor using PHP
    How to get Real IP,ISP,Country,City and etc from Visitor using PHP Php Get Real visiter's IP and ISP and Country and City and Countr...
  • Why does this code using random strings print “hello world”?
    Why does this code using random strings print “hello world”? The following print statement would print "hello world". Could a...

statcounter



statcounter



Template Created By ThemeXpose & Blogger Templates