How can I find out google custom country?

In my application, I have billing support in applications, since there is no API to get the price of an item before actually showing the user the user interface for purchase, currently I am thinking of hard coding the price for billing elements in the application inside the application.

However, the price will vary depending on the country, so I will need to find a way to find out the country in which the user is included in order to show the correct price in the application.

I found that the price displayed by the user depends on the country that the user selected when creating the Google Play account, so I need a way to find out the country associated with the Google Play account. Does anyone know how to do this?

thanks

+6
source share
1 answer

Use the SkuDetails object and getter for the price, it will return you the localized price for the element.

  • Get Inventory Object
  • Receive from SKU item:

    userInventory.getSkuDetails (IabHelper.YOUR_SKU) .getPrice ();

More details here - http://developer.android.com/training/in-app-billing/preparing-iab-app.html

+2
source

Source: https://habr.com/ru/post/925315/


All Articles