The best and easiest way to have your app determine if the device is a smartphone or a tablet is to place a boolean value in a specific value file such as res/values-xlarge.

Then, in the folder res/values, you can add the same XML code but with a false value.

In your Android code, you can get the value with this code:

You can use this XML list of countries to populate an AutoCompleteTextView or Spinner component in Android. While you can always hard code these countries in your code, placing this list in the XML under the string resource folder is better because your application code should focus on behavior, not content.

Related Posts Plugin for WordPress, Blogger...