Display localized prices in an Android application

I am creating an Android application with billing in the application and I want to do two things:

  • Show prices of the static number of items (1-month / 3-month / 12-month subscription) from the application localized to the face. Currency Android Market.
  • Change prices without resubmitting the entire application to the Android Market.

I have determined that there is no way to request the Android Market at prices similar to how you can request the Apple App Store. In doing so, I want to add an API call on my server, which returns the prices that I set in admin on the Android Market.

Then the problem arises - how do I know in which currency to show prices? Is there any way for me to find out at runtime what currency the user market will show so that I can add an argument to a new API call and display the correct currency and price from the application?

Thanks in advance.

+4
source share
3 answers

Now it is supported by Payment in application version 3 .

From the docs:

Usually you want to inform the user about the products available for purchase. To request product information for an application defined on Google Play, the application may send a getSkuDetails request. You must provide a list of product identifiers in the request request. If the request is successful, Google Play returns a package containing product information, including the price of the product, name, description and type of purchase.

+3
source

Not really. You need to know which countries support prices in local currency (you can see it in the developer's console, new countries are added from time to time). Then, based on the current country (from the SIM code, etc.), Find the local price and return the value. If no local price has been set, the currency will convert your base price for valuation. In general, it is nontrivial and should be part of the IAB API. If you can handle this, make it open source :)

+2
source

I found the conversion API currency, but I have no experience using it. If this works, I would look at coding the ISO country code for the ISO currency code index. The current country code is available in the default locale object. This page indexes countries according to ISO currency codes, and on the linked pages - ISO country codes. All of these bits should satisfy your requirements, prohibiting any accidental price increase for taxation in the user locale that you are not aware of.

0
source

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


All Articles