0

I am working on a application to shows the live gold price in my android application, I am stuck at one point. I am pasting a link http://www.marketonmobile.com/gold_price_india.php

This web page have current gold price and I want to read only that gold price and want to show it only in my android application, please suggest me any proper solution.

dreamcrash
  • 47,137
  • 25
  • 94
  • 117
Saini
  • 1
  • 2
  • 2
  • You should not ask for adding rep to the site.. If your post is worth knowing then it will automatically done by your peers..!!! See FAQ for more details... – Ved Jan 31 '12 at 10:58
  • Hmm, http://stackoverflow.com/faq does not say anything about not asking for reputation. – user1076637 Jan 31 '12 at 17:11
  • @user1076637: I can't ever recall seeing it before :) so I'm not surprised it isn't in a FAQ. :) – sarnold Feb 01 '12 at 04:29
  • you need to create a webcrawler. there is an example here: http://stackoverflow.com/a/4131967/862629 take a look on regular expressions (regex) for understand how to extract pattern from strings – Sam Felix Jan 31 '12 at 10:37
  • You need to call web service for this. See the below reference for more details : [link](http://www.codeproject.com/Articles/112381/Step-by-Step-Method-to-Access-Webservice-from-Andr) Also you may like to view the SO answer : [Call web service from android](http://stackoverflow.com/q/297586/1130032) – Ved Jan 31 '12 at 10:38

4 Answers4

3

It's likely that this isn't a long-term solution. You'll have to subscribe to a service to get reliable stock and commodity prices.

Google and Yahoo Finance don't provide free prices anymore; their APIs have been disabled. You'll have to pay for the data you want.

duffymo
  • 305,152
  • 44
  • 369
  • 561
1

Extracting only part of the info from web sites might come under web scraping, which might be illegal.Read the Terms of Service for the website to check if they allow things like that!

Its better to buy API's or web service subscriptions to achieve what you are looking forl.

Flowerking
  • 2,551
  • 1
  • 20
  • 30
0

Try this formula:

=ImportXml("http://www.xmlcharts.com/cache/precious-metals.php", "/prices/currency[@access='eur']/price[@access='gold']")

But read http://www.xmlcharts.com/precious-metals.html and their terms of service carefully before using it.

Miao ZhiCheng
  • 617
  • 7
  • 9
0

read all the html contents, create substring from that html string, load substring into webview to show only gold price.

jeet
  • 29,001
  • 6
  • 52
  • 53