Get the currency defined in Android

1

Is it possible to obtain in any way the currency that the user uses, that is, the symbol: $, € .... ?

    
asked by Webserveis 01.12.2016 в 15:27
source

1 answer

2

You can use Locale of java. This will return the values of the regional configuration by default of the user.

Locale locale= Locale.getDefault();
System.out.println("Locale: " + locale.getDisplayName()); //Localidad
Currency currency = Currency.getInstance(locale); //Datos configurado por defecto segun la localidad.
System.out.println("Currency Code: " + currency.getCurrencyCode()); //El codigo configurado por ejemplo (USD, etc)
System.out.println("Simbolo: " + currency.getSymbol()); //El simbolo que tu buscas, por ejemplo : $, €, etc..
    
answered by 01.12.2016 / 15:33
source