AndlyticsProject / andlytics

Google Play - Android Market statistics app
Other
537 stars 181 forks source link

Currency Converter (suggestion) #335

Closed realgpp closed 11 years ago

realgpp commented 11 years ago

Hi, it's the first time I send an Issue so...

I think it would be great converting dollars in the desired currency value. The most simple implementation I can think of it's with an edittext in preferences where the user can set the conversion value.

Cheers

CrosseyeJack commented 11 years ago

Interesting... A rough conversion can be pulled from Google Calculator using a HTTP GET such as http://www.google.com/ig/calculator?hl=en&q=100USD=?GBP which will return some json such as {lhs: "100 U.S. dollars",rhs: "63.8039941 British pounds",error: "",icc: true} Although it uses the iGoogle system so just how long that api will be around? Well iGoogle is going to stick around until November 1st, but after that? Answers on a postcard to...

CrosseyeJack commented 11 years ago

I'm not a huge fan of the idea of having a editable conversion rate in the app. Because even though the rate could be fairly stable, it still drifts about and would still need checked regularly to make sure its still in the right ballpark and how I would check is by firing off a Google search then returning to the app to tweak the rate as needed. Not that the rate given by Google or any other of the services on the net are going to give you your real conversion rate anyway, for example my bank don't charge a conversion fee but do tweak the rate in their favour but anyways.

So after thinking about it. I think the best way would be to add a long touch event on the AdMob balance that fires off an intent to Google Search to something like https://www.google.com/search?q=10USD+to+GBP much like how the Google Translate integration works (OK so it uses the native translate app not the Google web app) and allow Google search to display the conversion.

The iGoogle calculator API isn't really a viable plan as it is an undocumented API that could disappear/change at a moments notice, it is most likely that it will stick around until November, but after that? Who knows. And I don't know about anyone else, but i'm not a fan of using undocumented API's.

There are Free/Low cost solutions such as http://openexchangerates.org/ but for a Open Source App you are only given 1000 free queries per month each person who wants to use it would have to sign up personally and use there own API key.

They offer 1000 look ups a month for free but this wouldn't be enough and paying for more lookups would put the API key in the public and could be used for abuse (people nicking the key and using it in their own apps/services on the coin of who ever paid for it)

A replay server would also be open to such abusive (A server makes and stores a query once an hour as Open Exchange Rates update their free api thus staying under the 1000 limit per month, replays that data to the app as requested) as abusers would only need to grab the replay url from the source and use it themselves.

So unless anyone else can think of a good idea I say if this get added its done by doing a Google Search.

nelenkov commented 11 years ago

I say if you need precise reporting and currency conversion, use the AdMob, etc. console :)

CrosseyeJack commented 11 years ago

Does the AdMob console offer the ability to offer conversions? I've only ever seen US Dollars being displayed. Random thought, Is it possible to feed a search to the Google Search App programmatically?

nelenkov commented 11 years ago

No, but you can generate a report, export as CSV, import in Excel and convert, etc. at will. As for the Search app, probably, but there is no public API (that I know of).

LyricistApps commented 11 years ago

Hi, that's actually a good feature to add, I guess. I was looking for a solution to it, the most accurate I've found so far is doing a HTTP GET to the following: https://www.google.com/finance/converter?a=65&from=EUR&to=USD My main concern is that it's mandatory to parse the response (it return a HTML form) so if Google update the form parsing must be updated as well.

There is also this: http://currency-api.appspot.com/documentation Which is easy to use but it's not as accurate as Google Finance and I don't really know where it comes from and there is no insurance that it will stay online forever. EDIT: I just saw that this solution is limited to 3000 request/month see instead: http://rate-exchange.appspot.com/currency?from=USD&to=EUR&q=1

It's possible to get currency's symbol using Android's Currency: http://developer.android.com/reference/java/util/Currency.html It's even possible to get default currency using user's locale

I finally found something interesting: http://query.yahooapis.com/v1/public/yql?q=select%20Rate%20from%20yahoo.finance.xchange%20where%20pair%20=%20%22USDEUR%22&env=store://datatables.org/alltableswithkeys (here for USD to EUR change rate) It might be the best solution.

nelenkov commented 11 years ago

No longer relevant: new AdMob reports in local currency. Same for dev console revenue summary.