3

I'm trying get currency symbol based on where is user located (what language he have in smartphone). I'm using this code

String currency = Currency.getInstance(Locale.getDefault()).getSymbol();

On my phone Xiaomi Redmi 4 Prime it works. I tested english(GB,US), german and slovak language. But when I run test on firebase testlab devices I got error

Unsupported ISO 3166 country: de

I was looking into methods in Locale and Currency and I found

Locale.getDefault().getVariant() + "  " + Locale.getDefault().getCountry()

this code return on my smartphone in Slovak language " SK" and in German language " DE" but on firebase devices it returns " " nothing. And

Currency.getInstance

is using locale.getCountry() to determine country.

Thanks you any answers.

Šimon Marko
  • 69
  • 1
  • 11

0 Answers0