Android: How to set culture values for application
) i'm a C# developer and now i started to program apps for android. In C# we have the CultureInfo object where we can set the values for the culture of the aplication. There is a similar object in java (android) to let me do that ¿? i found that i can set the locale with this Locale.setDefault(Locale.FRENCH); but how i set the date, number adn monetaris symbols ¿? Here is the code in C# that i use: CultureInfo objCultureInfo = new CultureInfo("en-US", true); objCultureInfo.NumberFormat.NumberDecimalDigits = 2; objCultureInfo.NumberFormat.NumberDecimalSeparator = "."; objCultureInfo.NumberFormat.NumberGroupSeparator = ","; objCultureInfo.DateTimeFormat.DateSeparator = "/"; objCultureInfo.DateTimeFormat.TimeSeparator = ":"; objCultureInfo.DateTimeFormat.FullDateTimePattern = "MM/dd/yyyy HH:mm:ss"; objCultureInfo.DateTimeFormat.ShortDatePattern = "MM/dd/yyyy"; objCultureInfo.DateTimeFormat.ShortTimePattern = "HH:mm:ss"; objCultureInfo.NumberFormat.CurrencySymbol = "$"; Cultura.CulturaAplicacion = objCultureInfo; Thanks!
In my opinion you shouldn't change the Locale value at all. The user sets this value device wide in the settings. You can also set your date and time format there, too. You should use those values in your app instead of overriding them with custom ones, because the user knows better, which language and formats he/she wants to use.
I think I found what I needed here: http://developer.android.com/reference/java/text/NumberFormat.html Thanks!
HTC BLE problems and kontakt.io beacons api
Firebase query with wrong data doesn't give any call back [duplicate]
Android click Highlight issue: After updating to Android studio 2.2 preview 3
Android Studio - using webView.findAllAsync(text) to highlight text on website and then creating on click action on text
formatting text inside an array
android how to avoid this out of memory error
android- How to make screen helpers [closed]
DragonFly Black DAC connected with a Samsung Galaxy phone
Uber RideRequestButton gets stuck at “Requesting”
Android permissions are not getting updated even according to manifest.xml
File size written with getExternalFilesDirs to SD card are listed on internal memory
rounded Imageview in android eclipse?
Change textcolor of a custom ListView
android : communication myservice with other apps activity
textView border radius from right more than left
PreferenceCompatFragment null pointer when setting OnSharedPreferenceChangeListener