Search code examples
javaandroideclipseunits-of-measurementmetric

How to get the user preferred units? (metric (meters) or imperial (miles))?


I would like to know what are the user-preferred units between miles and meters. It seems that the "Locale" class doesn't allow that.


Solution

  • I don't think there's necessarily a correct answer to the Metric/Imperial question for all locales.

    For example, in the UK we generally use miles for large distances like a car journey, feet and inches for people's height but may use meters to describe the dimensions of a room.

    We almost always use litres for measuring liquid volume except for beer and sometimes milk which can still be sold in pints.

    Kilograms are usually preferred to pounds and ounces but most recipe books will list both since some people still have scales which use the latter.

    I think you will have to do some research to find out which countries use which scale for what you're interested in measuring (and of course, give the user the option to select one or the other manually.)