0

I am working on an android app where I query a third party API based on what user has input on first screen. I want to show user the result of the query in nice web format. For first screen I am using RelativeLayout. What do you guys recommend to use for next screen where I display result? Can I use webview without having a website for my app?

yogsma
  • 10,142
  • 31
  • 97
  • 154
  • You can display html files in a WebView, even being disconnected. But you can display some html in a TextView too... if it's only a few lines of text with a little formatting. – Phantômaxx Feb 22 '14 at 14:39
  • Thanks. Do you have any example of app for that kind of formatting? – yogsma Feb 22 '14 at 14:55
  • 1
    Have a look at this [question](http://stackoverflow.com/questions/2116162/how-to-display-html-in-textview) – Phantômaxx Feb 22 '14 at 14:58

1 Answers1

2

question is not much clear to me, As u said I query a third party API?? When you query the third part API it must sends some response in certain format like JSON or XML etc. the response may contains some links of images and some text. like this in json

    {
   "title":"USERS DATA",
   "Users":{
      "firstName":"ABC",
      "lastName":"XYZ",
      "img":"http://www.xxxxx.com/img/img1.jpg"
   },
   "Users":{
      "firstName":"ABC",
      "lastName":"XYZ",
      "img":"http://www.xxxxx.com/img/img2.jpg"
   },
   "Users":{
      "firstName":"ABC",
      "lastName":"XYZ",
      "img":"http://www.xxxxx.com/img/img3.jpg"
   },
   "Users":{
      "firstName":"ABC",
      "lastName":"XYZ",
      "img":"http://www.xxxxx.com/img/img3.jpg"
   }
}

you can parse this response in android's native controls like textviews and image views in list views.

as for as webview is concern the answer is yes you can show this in webview but I recommend to use the native android controls.

Qadir Hussain
  • 8,721
  • 13
  • 89
  • 124