How To Retrieve Table Data From A Website And Display It In A Textview In Android
I am developing a simple app in android but am stuck. I need help to retrieve data from a table on this website and display it in a TextView. Below is the code I've been trying to
Solution 1:
Try This
Document doc = Jsoup.connect("http://www.mtn.co.ug/Mobile-Plans/PayAsYouGo/MTN-PerMinute.aspx").userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0")
.timeout(9999999).followRedirects(true).header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8").get();;
for (Element Yello: doc.select("div:contains(bundle) tr") ) {
String results = Yello.select("td").text().trim();
tv.setTxt(results)
}
}
Post a Comment for "How To Retrieve Table Data From A Website And Display It In A Textview In Android"